Show HN: Contrapunk – Real-time counterpoint harmony from guitar input, in Rust
11 hours ago
- #MIDI Tools
- #Music Technology
- #Open Source
- Contrapunk is a real-time MIDI harmony generator and guitar-to-MIDI converter that ensures proper counterpoint rules.
- It operates with sub-10ms latency, making it suitable for live performances, and is built in Rust.
- The tool is free, requires no login, and works in Chrome browsers with any MIDI controller.
- Features include an 8-mode harmony engine with historical rules, 28 scale modes, and deterministic voicing.
- Guitar input allows real-time pitch detection, onset tracking, and auto-calibration for converting guitar playing to counterpoint.
- Latency is minimized through single-cycle detection, 2-frame voting, and 128-sample buffers.
- Contrapunk runs on multiple platforms: native desktop via Tauri, browsers via WebAssembly, and server mode for studios, all using the same Rust core.
- Voice leading features enforce music theory rules, such as rejecting parallel fifths, preventing voice crossing, and applying spacing rules.
- It is open source under the MIT license, aiming to make centuries of music theory knowledge accessible to all musicians.