Website · Try in Browser · Download for Mac · Contributing
Real-time counterpoint harmony generator. Plug in a guitar or MIDI controller, pick a key and voice leading style, and Contrapunk generates harmony voices that follow actual counterpoint rules -- Palestrina, Bach Chorale, Jazz, or Free. Built in Rust.
Counterpoint is the art of combining independent melodic lines. Contrapunk implements these rules so you play one note and hear harmonically correct accompaniment in real-time.
Browser (no install): app.contrapunk.com
macOS DMG: GitHub Releases
Prerequisites: Rust, Node.js, Tauri CLI
git clone https://github.com/contrapunk-audio/contrapunk.git
cd contrapunk
cargo tauri devFor WASM only:
cd ui && npm install && npm run build:wasm && npm run devGuitar/MIDI Input
|
Pitch Detection (McLeod + single-cycle, 128-sample buffer, ~2.7ms)
|
Harmony Engine (scales, modes, voice leading rules)
|
Humanizer (timing jitter, velocity variation, swing)
|
MIDI Output
Harmony: 8 modes (diatonic thirds, contrary motion, strict counterpoint, Barry Harris, etc.), 28 scales, 4 voice leading styles. Voice position is configurable -- play as soprano, alto, tenor, or bass.
Guitar Input: audio-to-MIDI with onset detection, pitch voting, auto-calibration, and string/fret identification. Sub-10ms pluck-to-note-on on M-series Macs.
Runs everywhere: native desktop (Tauri v2), browser (WebAssembly), same Rust core.
cargo run --release --example guitar_tuner # Live tuner with auto-calibration
cargo run --release --example guitar_harmony # Guitar audio -> harmony -> MIDI out
cargo run --release --example guitar_capture # ML training data capturecargo test # Full suite
cargo test --test audio_pipeline -- --nocapture # Audio pipeline integration
cargo test -p contrapunk guitar # Guitar modulePre-commit hook (fmt, clippy, test, wasm check):
cp scripts/pre-commit .git/hooks/pre-commit && chmod +x .git/hooks/pre-commitSee CONTRIBUTING.md for build setup, architecture overview, and guidelines.
Issues and PRs welcome. If you hit a bug or have a feature idea, open an issue.
- Engine Deep Dive -- technical internals with diagrams
- Project Journey -- the story of building Contrapunk
- ML Concepts -- educational guide to the ML/audio pipeline
MIT. See LICENSE.