Hacker News Viewer

Show HN: Contrapunk – Real-time counterpoint harmony from guitar input

by waveywaves on 4/5/2026, 12:40:18 AM

Hi HN, I built Contrapunk because I wanted to play guitar and hear counterpoint harmonies generated in real-time. It takes audio from your guitar, MIDI player or your computer keyboard and generates harmony voices that follow counterpoint rules to generate harmonies. You can choose the key you would like to improvise&#x2F;play in and the voice leading style and which part of the harmony you would like to play as, as well.<p>macOS DMG: <a href="https:&#x2F;&#x2F;github.com&#x2F;contrapunk-audio&#x2F;contrapunk&#x2F;releases&#x2F;tag&#x2F;v1.0.0" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;contrapunk-audio&#x2F;contrapunk&#x2F;releases&#x2F;tag&#x2F;...</a><p>Source: <a href="https:&#x2F;&#x2F;github.com&#x2F;contrapunk-audio&#x2F;contrapunk" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;contrapunk-audio&#x2F;contrapunk</a> (do open any issues if you have any)<p>Would love feedback on the DSP approach and the harmony algorithms. I am also looking at training a ML model for better realtime guitar to midi detection. I believe that will take some time.

https://contrapunk.com/

Comments

by: anentropic

Very cool!<p>FYI in this phrase: &quot;AI is not going to kill music till people keep playing music together.&quot;<p>The &quot;till&quot; (until) kind of inverts what I think is the intended meaning.<p>A better replacement would be &quot;as long as&quot;.

4/5/2026, 12:50:24 PM


by: owenfi

I&#x27;ve been thinking of and briefly working on a similar project.<p>One idea is to analyze timing as well, and &quot;trigger&quot; things after certain sequences (so play 1-3-5 as say eighth notes and then get an in-rhythm arpeggio one octave higher) or detect the beat and play on the upbeat.<p>I haven&#x27;t done any Rust, but this might give me a good reason to give a try.<p>Have you considered making it a plugin? (makes replay easier in my opinion, but brings other pain like relaunching the DAW between builds...)

4/5/2026, 7:25:09 AM


by: chrisweekly

&quot;Realtime&quot; as in &quot;while playing guitar&quot; has some pretty challenging latency requirements. Even if your solution is optimal, hardware specs will play a meaningful role. I&#x27;d be really interested if you&#x27;ve solved for this e2e.

4/5/2026, 3:07:06 AM


by: seertaak

<i>Gradus ad Parnassum!</i> What a cool idea, and the fact it&#x27;s counterpoint gives you a nice little time buffer for any DSP. Super cool

4/5/2026, 8:45:43 AM


by: Slow_Hand

Cool idea!<p>I&#x27;ve got a few thoughts for features, if you&#x27;re open to them:<p>1. Ability to specify where your &quot;played&quot; voice resides in the voicing: As the bass note, as an inner voice, or as the top line.<p>2. Options for first species, second species, third, florid, etc counterpoint for each of the generated voices. Ex: You play a single note and the upper voice plays two notes for every one of yours, etc, etc.<p>3. If you want to get real fancy, make the generated voices perform a canon of your played notes.

4/5/2026, 5:32:21 AM


by: korginator

There was a 1970&#x27;s Indonesian progressive rock band called Contrapunk that released an album called &quot;Putri Mohon Diri&quot; [1]<p>You can find the recording on YT [2] They were really unique - blending traditional Indonesian instruments, intense guitar work and classical influences.<p>[1] <a href="https:&#x2F;&#x2F;www.discogs.com&#x2F;release&#x2F;17424685-Contrapunk-Putri-Mohon-Diri" rel="nofollow">https:&#x2F;&#x2F;www.discogs.com&#x2F;release&#x2F;17424685-Contrapunk-Putri-Mo...</a><p>[2] <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=jb1792ZuXcY" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=jb1792ZuXcY</a>

4/5/2026, 8:18:29 AM


by: dundercoder

I’m very excited to try this. I haven’t looked deep into it but Steinberg makes an sdk for vst&#x2F;au development. It has rust bindings!<p><a href="https:&#x2F;&#x2F;steinbergmedia.github.io&#x2F;vst3_doc&#x2F;vstsdk&#x2F;index.html" rel="nofollow">https:&#x2F;&#x2F;steinbergmedia.github.io&#x2F;vst3_doc&#x2F;vstsdk&#x2F;index.html</a>

4/5/2026, 11:08:47 AM


by: pieterk

Nicely done! I saw you&#x27;re building a cloud version so wanted to refer the excellent <a href="https:&#x2F;&#x2F;github.com&#x2F;sonosaurus&#x2F;sonobus" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;sonosaurus&#x2F;sonobus</a> which you might be able to integrate. All the best!

4/5/2026, 11:37:41 AM


by: moropex

This is actually super cool!

4/5/2026, 6:43:17 PM


by: marssaxman

What a cool idea. I don&#x27;t have a music setup capable of running this right now - perhaps in a couple of months - but if you were to post some sample recordings, I&#x27;d gladly listen to them.<p>How do you generate velocity values for the accompaniment notes?<p>Given that you already have a pitch tracker, it could be interesting to add key detection; just start playing, instead of telling the machine what key you&#x27;re in, and it starts following along as soon as it catches on.

4/5/2026, 2:23:44 AM


by: swiftcoder

Seems like the Mac app has a packaging problem. Tahoe on an M2 Max views it as corrupted and refuses to launch it

4/5/2026, 7:05:18 AM


by: r2ob

Wow that&#x27;s is really cool! Thanks for sharing! I will definitely take a look

4/5/2026, 4:19:05 AM


by: rohit_g

finally some good stuff on here

4/5/2026, 9:35:47 AM


by:

4/5/2026, 12:45:48 AM