3

I am looking for python library to find out a key and tempo of the song recorded in MP3 format. I've found the music21 lib that allows doing that. But it seems like it works only with midi files. Does somebody know how to parse MP3 files using music21 and get the required sound characteristics? If it is impossible, please suggest another library.

Kirill Liubun
  • 1,965
  • 1
  • 17
  • 35

3 Answers3

5

No, this is not possible. Music21 can only process data stored in musical notation data formats, like MIDI, MusicXML, and ABC.

Converting a MP3 audio file to notation is a complex task, and isn't something that software can reliably accomplish at this point.

3

There are ways of doing this in music21 (audioSearch module) but it's more of a proof of concept and not for production work. There are much better software packages for analyzing audio (try sonic visualizer or jMIR or a commercial package). Music21's strength is in working with scores.

1

Check out librosa. It can read mp3s and give some basic info such as tempo.