Software to extract frequency spectrum data from an audio file
An important thing to consider is that the pitch of musical notes does not directly correspond to frequency peaks in a spectrogram.  This is because the energy of typical musical sounds are partially to mostly in the overtones and harmonics, at frequencies well above the note pitch (depending on the source of the music).  So it would help to investigate algorithms for pitch detection/estimation, and the difference between those and the frequency spectrum of music.