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
Native. Offline. Sub-10ms pluck-to-note on M-series Macs. Open source. Your audio never leaves your machine.
Same Rust core compiled to WebAssembly. No install, no signup. Grant mic access, plug in MIDI, play.
Native pipeline, ~40% lower latency than browser. Universal macOS .dmg (Intel + Apple Silicon) and Windows x64 .exe — both signed by CI, open source. Latest: v1.2.0 — Palestrina Proteus.
Pre-built binaries only for Mac today. Windows / Linux: clone the repo and cargo tauri dev. It takes 90 seconds.
The largest UX overhaul since the harmony engine itself. Native + browser parity — every feature below works on macOS, Windows, and at app.contrapunk.com.
Canon + Counterpoint Lanes sit as peer cards under one Companion master toggle. Future lane types (Drum, Drone, Looper) plug in the same way.
Dedicated lane that subdivides time per species — Species 2 emits 2 notes per cantus, Species 3 emits 4, Species 4 enters syncopated. Pitches are scored through the same parallel-5th-avoiding rules the engine uses.
Each canon voice owns its own stateful harmony engine — StrictCounterpoint, ContraryMotion, BachChorale all maintain independent history per voice instead of contaminating a shared engine.
V2 inherits V1's full counterpoint state — interval history, harmony pitch buffer, melodic contour — before picking its own pitch. The cascade chain hears itself: no parallel fifths between V1 and V2, varied intervals across the chord, proper polyphonic memory.
Library of harmony presets — SATB chorale roles, Counterpoint Solo, Pass-Through Echo, Bach 4-Voice Chorale. Bind a canon voice to a preset and edits live-update every voice using it.
Fresh install boots with transport auto-playing, reverb on, Computer-Keyboard auto-routed, StrictCounterpoint + Palestrina voice-leading + Octave Spread + 4-voice SATB with the player as Bass.
Sliders replaced by Serum-style knobs (delay 0–16b, speed 0.125–8×). Drag voice dots on the timeline to set delay visually. "Relative to" picker per voice lets V2 harmonize off V1's emitted subject (fugue-style chain).
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.
A full CLAP plugin host via clack-host. Route harmony straight into your favorite instrument inside Contrapunk — no DAW required. macOS, Windows, Linux.
Same Rust core compiled to WebAssembly at app.contrapunk.com. No install, no signup, no email. WebMIDI out for DAWs and hardware.
Counterpoint rules are centuries of shared human knowledge. The code that applies them is open source — fork it, ship it, use it in research, sell it.