logoalt Hacker News

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

81 pointsby waveywavestoday at 12:40 AM36 commentsview on HN

Comments

waveywavestoday at 12:45 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/play in and the voice leading style and which part of the harmony you would like to play as, as well.

macOS DMG: https://github.com/contrapunk-audio/contrapunk/releases/tag/...

Source: https://github.com/contrapunk-audio/contrapunk (do open any issues if you have any)

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.

show 3 replies
owenfitoday at 7:25 AM

I've been thinking of and briefly working on a similar project.

One idea is to analyze timing as well, and "trigger" 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.

I haven't done any Rust, but this might give me a good reason to give a try.

Have you considered making it a plugin? (makes replay easier in my opinion, but brings other pain like relaunching the DAW between builds...)

show 2 replies
pieterktoday at 11:37 AM

Nicely done! I saw you're building a cloud version so wanted to refer the excellent https://github.com/sonosaurus/sonobus which you might be able to integrate. All the best!

dundercodertoday at 11:08 AM

I’m very excited to try this. I haven’t looked deep into it but Steinberg makes an sdk for vst/au development. It has rust bindings!

https://steinbergmedia.github.io/vst3_doc/vstsdk/index.html

show 1 reply
korginatortoday at 8:18 AM

There was a 1970's Indonesian progressive rock band called Contrapunk that released an album called "Putri Mohon Diri" [1]

You can find the recording on YT [2] They were really unique - blending traditional Indonesian instruments, intense guitar work and classical influences.

[1] https://www.discogs.com/release/17424685-Contrapunk-Putri-Mo...

[2] https://www.youtube.com/watch?v=jb1792ZuXcY

show 1 reply
marssaxmantoday at 2:23 AM

What a cool idea. I don'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'd gladly listen to them.

How do you generate velocity values for the accompaniment notes?

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're in, and it starts following along as soon as it catches on.

show 1 reply
swiftcodertoday at 7:05 AM

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

show 3 replies
r2obtoday at 4:19 AM

Wow that's is really cool! Thanks for sharing! I will definitely take a look

show 1 reply
rohit_gtoday at 9:35 AM

finally some good stuff on here

show 1 reply