Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Show HN: Tweak your chord progressions for practice or composition (chord-alt.vercel.app)
78 points by java_city on June 29, 2023 | hide | past | favorite | 46 comments
I'm excited to share with HN a new pet project I've been working on to explore how AI can create and explain harmonic chord progressions - Chord Variations.

The project uses GPT-4 to generate unique and interesting chord combinations based on user input chord progression. It's akin to having a virtual musical assistant that can help non-musicians and musicians alike explore and create harmonious sound without needing any prior knowledge of music theory. The generated chord suggestions maintain a similar vibe to the user input. Alternative chord progression includes extended chords, chord substitutions, unique passing chords, and more.

Additionally, musical theory explanations within the tool is helpful for users not just to create music, but understand the underlying structure it's built on a bit better. These chord progression suggestions can be used for practice or composition. As a musician myself, I am having quite a lot of fun playing around with it.

One of the things I'm proud of is how the application really dips into music theory. It includes nuanced aspects such as dominant chords, secondary dominant chords, and the famous 2-5-1 chord progressions.

That said, the development journey was full of lessons. Dealing with the latency of the GPT-4 API was particularly challenging. I used a Celery based queue system + client polling to manage the delay between request and response (from OpenAI API). Additionally, to keep the chord names consistent, I used a combination of prompting and regex. There are still some bugs that need to be squashed but overall I am pretty happy with the results.

I'd love to hear your thoughts and feedback on the project. Also, if you're curious about anything, I am happy to delve into the details in comments.

Feel free to take Chord Variations for a spin here: https://chord-alt.vercel.app/

Looking forward to some interesting discussions!



Hugged to death at the moment I think. But please consider not deleting the chord when I click it. It's very counter intuitive to have data/buttons/options vanish by simply clicking on it.


The site was down for a while, thanks HN! Yeah I can see how the UX might be confusing. A cross icon button on top of each chord could be better than a click listener on the chord box.


Curious, why would that be? How else would you interact with the existing chords besides deleting them?


To edit them, change them, move them, duplicate them, ...

Pretty much anything except delete them. My initial thought was that clicking would edit them.


I like the edit idea!


To hear them?


I thought that was how you changed the chord at that position


Cool project! I'm a jazz musician / software engineer and have been building a similar personal project in my free time, writing a deterministic algorithm to perform harmonic analysis on popular standards, with the end goal of having an interface that could suggest chord substitutions to the user. I'm also looking at indexing all the tunes so the user can fuzzy search for tunes with similar chord progressions.

I'm curious to see how well you think the GPT solution works for you (I'm having trouble trying it because I'm so far back in the queue. Congrats on all the traffic!) My suspicion is that it would struggle to capture more nuanced substitutions, because it doesn't really have the underlying context (things like harmonic tendencies of individual notes and voice leading) to draw from but I've been surprised before. Hope I can try it next week!


The output produced by GPT is mostly on point. However, it does makeup stuff sometimes. A fine-tuned or smaller model trained on music theory data is the way to go in the future. Your app sounds interesting. Please share whenever you can!


I don't know, I think procedural generation is much more powerful than an LLM when it comes to creating interesting music. I consider the inputs kind of limited too, like where's the min7b5—how can you have the minor variant of the "famous" 2-5-1 (maybe "conventional" is a better choice of words) without the 2?


This app is a hobby project and is in the initial phases. I removed the option for chords like m7b5 in the UI for now. I will re-enable it when I finish performing tests on GPT-4's response.


Selfish request here.

I tried Em D Am6 Cadd9 which is a kind of stock alternative rock / indie rock jangly guitar progression. The variations thing suggested some really jazzy chords that didn't preserve the vibe.

Can you have a slider that lets me choose between that strategy and something more like THIS: https://www.youtube.com/watch?v=mU8HQ7O4nTc

i.e. using simple major and minor chords borrowed from "nearby" keys, so it ends up sounding more like a pop or rock song and less like jazz?

Because that's what I'm really interested in!


Side request to have that slider use types of hot peppers as a unit:

https://youtu.be/lz3WR-F_pnM


Haha! love it


Thats a nice suggestion. Thank you! Initially I built the app so as the users could select the style. Later on I thought that might clutter the input and confused the users so I disabled it in the frontend and fixed the style to jazz, funk, and rnb. Will re-enable it soon.


This is a fun tool. It took me a minute to realise how to add chords as I though the chord root part was talking about the key or something.

I found a bug: for one of the generated progressions it had 4 chords but played multiple chords at the same time. Progression was G9, Am11, D13, Bm9. But it played G9 and Am11 at once, the D13 and Bm9 at once and cycled between these two states. Clicking stop and play again and it plays normally.


Its an annoying bug, isnt it? Will fix it ASAP!


Cool!

I made something similar a while ago, desktop only:

https://songmine.io/


Thanks for sharing. Will try it


"There was an error generating the chord progression." Every time I click "Generate"

Looks like a 403 - Site disabled on the call

  OPTIONS https://chord-alt-api.azurewebsites.net/api/reharmonize?progression=[G, Em, C, D]


Got hugged to death for about 4 hours yesterday. Should be back up now.


Hmm.. When working with a I vi IV V in G, it tells me that a substitution of Bm7 for Em produces a ii-V-I in C. It does nothing of the sort! Now a Bm7-5 -> F -> Am is a 2-5 in C, but that's not what it's working with.


> it tells me that a substitution of Bm7 for Em produces a ii-V-I in C.

That's because it's using GPT-4. Which means it just makes stuff up, and you can't rely on it to tell the truth. It's a fun tool to see possibly novel output, but you can never rely on it to be accurate or correct.


This is true. I have come across other instances where the explanations are incorrect. The app is not ready for prime time, but fine-tuned models can improve this.


You don't need to fine tune GPT4 for it. A tiny in comparison model trained specifically on chords would do much better for creativity and the explanations could be generated without any AI.


There are lots of ways to solve this problem. Procedural, tiny model, fine-tuned large model, expert systems, etc.


I don't see any display of the function, only absolute. Where does it show them?

Not only display, it would be nice to be able to choose chords by function instead of absolute, too.


Excellent suggestion! I will add chord input by function in the next version.


Nice project! I couldn't get the audio to play from my iPhone so I came back to try on a laptop.

Quick question; how do manage the playing of the chords audio? Is there a library that can handle that?


Hey thanks for checking out! Some browsers on iOS (eg Edge) does not play audio. Working on fixing that.

To play the audio, I take chord name, list out notes in the chord, and send the notes to a synthesizer. I used Tonejs and Tonaljs libraries.


Sorry, but surely to use AI for music you will need something with a large music model, which as far as I know GPT-4 doesn't have. Without that it would be like relying on theory books, never having actually heard any music. Or am I wrong?


I developed this tool as a practice and composition aid. Real work in creating music still needs to be done by musicians.


This is chord progressions. It's a part of some kinds of music, and probably the easiest to work with computationally.


Yep. Using AI at all here feels like overkill. You could get interesting results just choosing random chords* in the key signature.

*speaking from experience. I built a web app at tapcompose.com (desktop only for now) that uses pure randomness for both chords and melody. Initially I used randomness for testing only and planned to substitute an AI model later — but I was delightfully satisfied with the results and kept it in


I cheat a bit and use Scaler 2's library as a starting point. It has progressions for all kinds of moods and genres, and that's usually what I'm aiming for.


Ooh TIL about plug-ins like Scaler 2. I need to get more immersed in the DAW world.

It'd be cool to train text embeddings and musical chord embeddings (by analyzing song lyrics perhaps) and then build something to type in moods like "happy jaunty progression" and get a matching chord progression with a similar embedding (assuming you give it a large library of progressions). No generative AI would be needed :)


But it produces the worst, results. Just examine some music that you like an you will find it is far more complex than that. Often a single line of notes is supported by the chords rather than being shaped by them, and the chords can vary wildly in duration.

A chord is two or more different notes being played close together in time. That's all.


It's a small tool for generating variations on a chord progressions, not writing songs or coming up with melodic ideas. No need to make everything complicated.


Sounds interesting, but neither "C Am F G" nor even "C F G" are working for me...


Thank you for checking out! Looks like Redis is stuck and needs a reboot. On it! Edit: Should be working now


Not working for me either. Tried the same chord progression (naturally ha)


Your request probably timed out. Sometimes the OpenAI API takes ridiculously long to respond, so I've set a hard 90s timeout.


super fun, but i keep getting error messages :(


Thanks, a lot of traffic came in yesterday and my API server choked out of CPU usage time (it was on a free Azure account).


It's sounds like total crap.


Lmao the synthesizer needs a different soundface for sure.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: