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
CONTRAPUNK · DESKTOP · TAURI V2

GET THE APP.
OR RUN IT IN BROWSER.

Native. Offline. Sub-10ms pluck-to-note on M-series Macs. Open source. Your audio never leaves your machine.

◆ ◇ ◆ ◇ ◆ LIVE IN BROWSER
WASM · WEB AUDIO · WEB MIDI

CONTRAPUNK IN YOUR BROWSER

Same Rust core compiled to WebAssembly. No install, no signup. Grant mic access, plug in MIDI, play.

app.contrapunk.com · WASM · 48KHZ OPEN IN NEW TAB ↗
◆ ◇ ◆ ◇ ◆ DOWNLOAD FOR MAC
NATIVE · LOWER LATENCY

DOWNLOAD THE APP

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.

DOWNLOAD

MACOS

UNIVERSAL · INTEL + APPLE SILICON
CORE AUDIO · < 10MS · MACOS 11+
DOWNLOAD

WINDOWS

x64 · NSIS · TAURI V2
WASAPI · ASIO
DOWNLOAD

LINUX

BUILD FROM SOURCE
ALSA · JACK · PIPEWIRE
DOWNLOAD

BROWSER

WASM · WEB AUDIO API
NO INSTALL · MIC ACCESS
LAUNCH →

Pre-built binaries only for Mac today. Windows / Linux: clone the repo and cargo tauri dev. It takes 90 seconds.

◆ ◇ ◆ ◇ ◆ NEW IN v1.2.0
PALESTRINA PROTEUS · LANES & VOICE LIBRARY

What just shipped

The largest UX overhaul since the harmony engine itself. Native + browser parity — every feature below works on macOS, Windows, and at app.contrapunk.com.

COMPANION TAB

Lane cards

Canon + Counterpoint Lanes sit as peer cards under one Companion master toggle. Future lane types (Drum, Drone, Looper) plug in the same way.

COUNTERPOINT LANE

Real Fux species

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.

CANON LANE

Per-voice mini-engines

Each canon voice owns its own stateful harmony engine — StrictCounterpoint, ContraryMotion, BachChorale all maintain independent history per voice instead of contaminating a shared engine.

CASCADE

Stateful cascade across voices

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.

VOICES TAB

Named voice presets

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.

FTUX

Plays from the first note

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.

UI

Knobs, draggable timeline, cascades

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).

◆ ◇ ◆ ◇ ◆ WHAT YOU GET
01 · HARMONY

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.

02 · SCALES

FIFTY-SEVEN SCALES

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.

03 · GUITAR

GUITAR → MIDI

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.

04 · VOICE

FOUR-VOICE LEADING SOLVER

Cartesian-product placements across Soprano / Alto / Tenor / Bass registers. Rejects parallel 5ths and 8ves, prevents voice crossings, scores spacing, common tones, contrary motion.

05 · HUMANIZE

HUMANIZER

Timing jitter, velocity variation, swing on offbeats, duration extension. BeatClock tracks tempo and time signature. Per-note records match Note-Off to Note-On.

06 · HOST

HOSTS CLAP PLUGINS

A full CLAP plugin host via clack-host. Route harmony straight into your favorite instrument inside Contrapunk — no DAW required. macOS, Windows, Linux.

07 · BROWSER

RUNS IN YOUR BROWSER

Same Rust core compiled to WebAssembly at app.contrapunk.com. No install, no signup, no email. WebMIDI out for DAWs and hardware.

08 · OPEN

OPEN SOURCE FOREVER

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.