Automated way to recognize musical key given chords?
Assuming I have access to the chords of a song, I 'know' (based on my own experience and training) what key the song is likely to be in. And for pop music, the recognition rate is easily above 95%. To be fair, for certain types of pop music the key is just the final chord of the song though.
Have there been attempts at deriving musical key from a list (ordered or unordered) of chords in the song? I'm looking for either a list of rules or (preferably) a computer program.
Initial thoughts:-
If a song has lots of C, F, and G major chords, it's probably in C
The first and/or last chord would have inordinate importance
Differentiating between Am and C would be much harder than between C and D
Clarifications:-
- Let's just assume 'simple' music, pop-ish, meant for acoustic guitar/simple piano playing.
- The 'chords' that I'm thinking about here are boring old guitar chords (Cmaj7, D/F#, Gsus4) style
2 Comments
Sorted by latest first Latest Oldest Best
I think you are on the right track, because you limit your question to a simple pop context. But, I would suggest this:
Always keep in mind a song can modulate. The whole song may be in one key, but you might also need to apply some "local" key changes to sections of a song.
Caveat: when pop styles use minor harmony there is a tendency for the music to not be in a key in the standard music theory sense. It will tend to be either modal - like d dorian in "Riders on the Storm" - or minor pentatonic scale oriented - like in hard rock songs such as "Hair of the Dog." Identifying a modal tonality is more complicated so we won't try to do it here.
The straight forward way to determine key is by finding the primary tonal triads: tonic, subdominant, dominant. In major keys this is simple: C, F, G or I, IV, V. In minor keys look for cm, fm, Gmaj or i, iv, V. You could find a chart listing all keys like this.
Keep in mind other chords are likely used even in a simple song. But for the purpose of identifying key you can disregard those chords, and focus on the primary triads. For example, in this common chord progression - C a-min F G (I vi IV V) you can disregard the a minor, the C, F, G chords match the primary chords for C major.
If a given song doesn't fit neatly into the steps above, you probably aren't dealing with simple songs, and will have to use more sophisticated methods. That's ok! Use a simple method when appropriate, switch to sophisticated analysis when needed.
Additional comments:
@Patrx2 and @Tim point out some good "gotchas." But, if you find such things in a particular song, it probably isn't the simple pop music your are focusing on and you won't be able to approach it with a simple formula/method.
You may find a lot of music that seems simple is not simple in terms of key/tonality. My simple outline will work well with a lot of Buddy Holly songs or 1960's doo-wop, etc. but it won't help much with many Beatles songs, and many, many other interesting songs.
sure there is. same way ya do it manually.
relying on chords won't be as good as just using melody.
due to the chords often being dom7 and that minor7 being out of keysig. kinda.
take the melody, see where it's 7 most popular notes are, boom - there's your keysig usually.
due to pop usually being in major, vocals and bass usually staying in keysig.
I've tried this out on a bunch of pop midi files and it usually works great.
Terms of Use Privacy policy Contact About Cancellation policy © freshhoot.com2025 All Rights reserved.