I'm a physics student with a great interest in music. I'm researching (as a kind of hobby) in topics which include math applied to music, acoustics, etc. In the last days I've realized that having a computer application to make musical analysis would help me a lot in my research.
The idea is to develop a software which can make an harmonic analysis of a song. I would like to use a MIDI, or MusicXML, or something like that, as an input. And then I would like to obtain the key and chords of the song.
I've been looking into the Internet for days, but I haven't found anything useful.
I've read about some chord recognition algorithms for audio. However, it looks like I cannot adapt this approach to the MIDI input, because they use the intensity of each frequency in the spectrum.
I know the song could have modulations, or parts where a chord is not clear. Instead of applying some kind of dark magic which gives me the perfect and ideal answer of every chord and key in the song, I would prefer to state the problem as follows:
- Given a set of notes (for example, a complete measure), which we assume to be part of the same chord, get the best guess for the chord and a coefficient to indicate how good is the guess (for example, ~1.0 if the computer is very sure about that chord, ~0.0 if it isn't).
- Given a set of chords (for example, 20 chords) which we assume to be in the same key, guess which is this key and give me a coefficient.
I'm also interested to know if it's possible to determine key using the notes directly, instead of the chords.
That rules would allow me to slice the MIDI (for example, in measures) and apply the algorithm to detect chords and/or keys in the sheet music.
So, do you know any algorithm to perform this task? Any ideas? Do you know some literature about this?
Thank you in advance =)