SEVEN HARMONY MODES
PassThrough. Diatonic Thirds. Diatonic Fourths. Random Below. Random Below (No 2nds). Contrary Motion. Strict Counterpoint. Each is a file in src/harmony/modes.rs — two are stateful, five are pure.
let harmony = Engine.new(Palestrina);fn detect_pitch(buf) -> Note
const MAX_VOICES: usize = 4;
voice_leading.reject_parallels()struct GuitarInput { onset }
engine.harmonize(note, scale)fn detect_pitch( buf: &[f32] ) -> Option<Note>
let voices =
counterpoint::
generate(line, mode);if interval == Fifth
&& motion == Parallel
{ reject() }#[inline(always)] fn onset( frame: &Frame ) -> bool
block_size: 128 sample_rate: 48_000 latency_ms: 7.2
// Palestrina // counterpoint // rules.rs
Run Contrapunk locally as a native app or use the WebAssembly build in a browser. Audio processing stays on your device.
The WebAssembly build supports computer-keyboard, Web MIDI, and microphone input without installation.
Universal macOS .dmg (Intel + Apple Silicon) and Windows x64 .exe. Latest: v1.3.1 — Holdsworth HAL.
macOS builds are signed and notarized. The Windows installer is unsigned. Linux users can build from source.
Production workspace, arrangement presets, DAW plug-ins, and guitar-to-MIDI routing.
The full workspace now ships across desktop, browser, VST3, CLAP, and Audio Unit builds.
Apply complete harmony and Companion configurations, then duplicate them with Save As.
Harmonize track MIDI or convert mono/stereo guitar audio to CoreMIDI for instruments such as Analog Lab V.
Run Contrapunk before a DAW instrument using the host's event-routing workflow.
Faster analysis, live pitch telemetry, and a centered expression-roll trace.
Read the guide for every surface, arrangement, and routing workflow.
PassThrough. Diatonic Thirds. Diatonic Fourths. Random Below. Random Below (No 2nds). Contrary Motion. Strict Counterpoint. Each is a file in src/harmony/modes.rs — two are stateful, five are pure.
Ten families: diatonic, harmonic minor, melodic minor, harmonic major, double harmonic, pentatonic, blues/bebop, symmetric, world, Barry Harris. Modal interchange with a tunable borrowing range.
McLeod + single-cycle pitch detection on 128-sample buffers (~2.7ms). Onset detection, pitch voting, auto-calibration, string/fret ID. Sub-10ms pluck-to-note on M-series Macs.
Cartesian-product placements across Soprano / Alto / Tenor / Bass registers. Rejects parallel 5ths and 8ves, prevents voice crossings, scores spacing, common tones, contrary motion.
Timing jitter, velocity variation, swing on offbeats, duration extension. BeatClock tracks tempo and time signature. Per-note records match Note-Off to Note-On.
Load a CLAP instrument through clack-host, route generated MIDI to it, and mix its audio output in the standalone app on macOS, Windows, or Linux.
The Rust core is compiled to WebAssembly at app.contrapunk.com. It supports computer-keyboard input and Web MIDI output without installation.
The harmony engine, application, browser build, and plug-in adapters are available on GitHub under the MIT license.