- Updated: April 5, 2026
- 7 min read
Contrapunk Introduces Low‑Latency Real‑Time MIDI Harmony Generator
Contrapunk’s real‑time MIDI harmony generator is a Rust‑based, sub‑10 ms latency engine that automatically creates counterpoint‑compliant harmonies from live guitar input, delivering studio‑grade voice leading in the browser or as a native app.
Contrapunk Unveils a Low‑Latency Real‑Time MIDI Harmony Generator for Musicians and Developers
In a bold move that could reshape live‑performance workflows, Contrapunk has released a real‑time MIDI harmony generator and guitar‑to‑MIDI converter. The tool promises sub‑10 ms latency, deterministic voice leading, and eight distinct harmony modes—all powered by a single Rust core that runs everywhere from WebAssembly in Chrome to native desktop builds via Tauri. For music producers, composers, and audio engineers who demand instant, theory‑correct harmonization, this is a game‑changing addition to the modern music‑tech stack.
Core Features at a Glance
- Counterpoint‑aware harmony engine – Implements centuries‑old voice‑leading rules (parallel fifths rejection, spacing, voice crossing prevention).
- Sub‑10 ms latency – Single‑cycle pitch detection, 2‑frame voting, and 128‑sample buffers keep the response fast enough for live stage use.
- Rust‑first implementation – Guarantees memory safety, deterministic performance, and cross‑platform compilation to WebAssembly, macOS, Windows, and Linux.
- Eight harmony modes – From Palestrina and Bach to Jazz and Free, each mode respects its stylistic counterpoint conventions.
- 28 scale modes – Major, minor, modal, and exotic scales are available for instant tonal flexibility.
- Browser‑first experience – No login, no install; works in Chrome with any MIDI controller or guitar‑to‑audio interface.
- Open‑source MIT license – The core engine is fully transparent, encouraging community extensions and custom integrations.
Technical Architecture: Rust, WebAssembly, and Tauri
The engine’s backbone is a pure‑Rust library that compiles to wasm32-unknown-unknown for browser execution and to native binaries for desktop via Tauri. This “write once, run everywhere” approach eliminates the performance gap between web and native environments.
Latency‑Optimized Pipeline
- Audio capture – 44.1 kHz input is sliced into 128‑sample frames (≈2.9 ms each).
- Pitch detection – A single‑cycle YIN algorithm extracts fundamental frequency in under 1 ms.
- Onset tracking – Two‑frame voting smooths transient spikes, ensuring reliable note‑on events.
- Harmony generation – The Rust engine applies the selected counterpoint mode, respecting voice‑leading constraints.
- MIDI output – Generated notes are streamed via the Web MIDI API or native MIDI ports with virtually zero queuing delay.
Harmony Modes and Voice‑Leading Safeguards
Each harmony mode encodes a distinct set of compositional rules:
| Mode | Key Characteristics |
|---|---|
| Palestrina | Strict species counterpoint, limited dissonance, strong cadential motion. |
| Bach | Four‑voice chorale style, voice crossing prohibited, parallel fifths auto‑rejected. |
| Jazz | Extended chords, swing‑compatible voice leading, controlled chromaticism. |
| Free | No hard constraints, ideal for experimental sound design. |
Regardless of mode, the engine enforces:
- Parallel fifths and octaves rejection.
- Minimum interval spacing (e.g., 3rd‑5th between inner voices).
- Voice crossing prevention to keep each line within its register.
- Deterministic voicing – the same input always yields the same harmonic output, essential for reproducible compositions.
Real‑World Use Cases for Musicians and Developers
Contrapunk’s tool is not just a novelty; it solves concrete workflow bottlenecks:
- Live looping rigs – Generate instant harmonies while improvising, keeping the audience engaged without a full band.
- Composition assistants – Sketch chord progressions on a guitar, let the engine suggest counterpoint lines, then export MIDI for DAW integration.
- Educational platforms – Teach counterpoint theory by letting students hear rule‑compliant harmonies in real time.
- Game audio pipelines – Developers can embed the Rust library to produce adaptive music that reacts to player actions without latency spikes.
- AI‑driven music generation – Pair the engine with large language models to create hybrid human‑AI compositions.
How Contrapunk Stacks Up Against Competing Tools
Below is a concise side‑by‑side comparison with three popular alternatives:
| Feature | Contrapunk | Melodyne (Celemony) | Ableton Live’s MIDI Effects | Open‑Source midiharmony |
|---|---|---|---|---|
| Latency (typical) | <10 ms | ≈30 ms (offline) | ≈15 ms (depends on CPU) | ≈20 ms (Python‑based) |
| Counterpoint Rules | Built‑in Palestrina, Bach, Jazz, Free | Manual editing only | Basic chord‑generation, no strict rules | User‑defined, no defaults |
| Platform Coverage | Web (Wasm), macOS, Windows, Linux | macOS, Windows | Desktop + iOS (via Ableton Link) | Linux‑centric |
| Open‑Source License | MIT | Proprietary | Proprietary | GPL |
What the Creators Say
“Our goal was to bring centuries‑old counterpoint theory into the hands of anyone with a guitar and a browser. By leveraging Rust’s performance and WebAssembly’s reach, we finally achieved sub‑10 ms latency without sacrificing musical correctness.” – Alexei Morozov, Founder & Lead Engineer, Contrapunk
Boost Your Workflow with UBOS: From Prototyping to Production
While Contrapunk delivers the core harmony engine, UBOS provides a low‑code environment to wrap that engine into full‑featured SaaS products, internal tools, or custom plugins.
Rapid Prototyping with the Web App Editor
Use the Web app editor on UBOS to drag‑and‑drop the Rust‑compiled WebAssembly module, expose a clean UI, and instantly publish a live demo without writing a single line of backend code.
Automate MIDI Pipelines with Workflow Automation Studio
The Workflow automation studio lets you chain the harmony generator with other audio‑processing services—such as AI Audio Transcription and Analysis—creating end‑to‑end pipelines for podcast post‑production or game‑audio generation.
Monetize with UBOS Templates
Kick‑start a commercial offering by leveraging ready‑made templates like the AI SEO Analyzer or the AI Article Copywriter. These templates illustrate how to embed third‑party APIs, handle billing, and manage user authentication—all within minutes.
Scale with the Enterprise AI Platform
For studios that need multi‑tenant deployment, the Enterprise AI platform by UBOS offers Kubernetes‑ready containers, role‑based access control, and built‑in observability, ensuring your harmony service stays reliable under heavy load.
Pricing Transparency
Explore the UBOS pricing plans to find a tier that matches your project’s scale—from a free starter tier for hobbyists to an enterprise plan with dedicated support.
Community & Partnerships
Join the UBOS partner program to co‑market your Contrapunk‑powered solution, gain early access to new AI modules, and collaborate with other music‑tech innovators.
Getting Started with Contrapunk in Three Simple Steps
- Open the web demo – Visit the Contrapunk homepage and click “Try in Browser”. No account required.
- Connect your instrument – Plug a guitar or any line‑level audio source into your computer’s audio interface. The built‑in pitch detector will auto‑calibrate within seconds.
- Select a harmony mode – Choose Palestrina, Bach, Jazz, or Free. Play a melody and hear the generated MIDI harmonies in real time. Export the MIDI file for further editing in your DAW.
For developers, the GitHub repository (linked from the original site) provides a Cargo crate, WebAssembly build scripts, and example integrations with GPT‑Powered Telegram Bot for remote control.
Why Musicians and Developers Should Act Now
Real‑time, theory‑correct harmony generation has been a holy grail for decades. Contrapunk finally delivers it with the speed and accessibility modern creators demand. By pairing it with UBOS’s low‑code platform, you can:
- Launch a SaaS product that monetizes live harmony generation.
- Integrate counterpoint‑aware MIDI into existing DAWs or game engines.
- Teach counterpoint in classrooms with instant auditory feedback.
- Prototype AI‑augmented composition tools without writing backend infrastructure.
Ready to explore the possibilities? Dive into the UBOS homepage for more inspiration, or head straight to the UBOS portfolio examples to see how other innovators have turned open‑source engines into thriving businesses.
Take the next step: Try Contrapunk’s real‑time MIDI harmony generator today, then use UBOS to scale your idea into a market‑ready solution.