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 WEEKEND JAM·WK 01·Koji Kondo· STARTS IN 2DAYS→ /jam
CONTRAPUNK · DESKTOP · TAURI V2

GET THE APP.
OR RUN IT IN BROWSER.

Native. Offline. Sub-10ms pluck-to-note on M-series Macs. MIT-licensed. 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 MAC APP

Native CoreAudio pipeline, ~40% lower latency than browser. Apple Silicon, ~18 MB, MIT.

DOWNLOAD

MACOS

APPLE SILICON · TAURI V2
CORE AUDIO · < 10MS
DOWNLOAD

WINDOWS

BUILD FROM SOURCE
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.

◆ ◇ ◆ ◇ ◆ 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

MIT LICENSED FOREVER

Counterpoint rules are centuries of shared human knowledge. The code that applies them is MIT — fork it, ship it, use it in research, sell it.