For the longest time, I’ve always wondered what makes one chord sound good after another - or in other words, how do song-writers create a chord progression?

For many songwriters, they just choose chords that sound good, but what does that mean? Using functional harmony and chord grammars, one can create a vocabulary for songs that give a sense of explanation for what is happening in the song.

The grammar of a music style describes which chords are favored and how they move between each other. In most pop music, the chords tend to stay within a sub-set of the chords that would be found in classical music. For example, the most common chords in Rock music are the I, IV and V, with ii and vi occuring slightly less frequently.

To that end, I spent time building chordbot - a program that can read a series of chords and guess their labeling in functional harmony and whether any key changes happened. Based on the functional harmony labels and chord grammars, chordbot can recommend new chords to play that might sound interesting.

After building chordbot, I refactored the chord labeling and suggestion code out of chordbot into a standalone node module, so that you can just hand it a series of chords and it will tell you what their labels are.

I had fun building the project and it really helped solidify my understanding of functional harmony. From what I understand, composers already know and think about music this way, so this tool would be more useful to people who are looking to expand their music theory knowledge.