Reading a MIDI file in Python

There is a library called mido which is good for reading these files: https://pypi.python.org/pypi/mido/1.1.11


the structure of a midi file is quite simple. if you can't find a ready-made library (i am not aware of any) and you only need events and time, i suggest you try parsing the file yourself.

(prepare for a lot of bit shifting: MIDI data are stored in strings of 7 bits blocks)

also, you say that you can't find a library which works with your MIDI file on Windows: MIDI file are supposed to be portable, and python too, so a un*x lib should work equally well on windows (or the developper missed the point of both MIDI and python).


Check out this python library on github, it seems to do exactly what you need:

https://github.com/vishnubob/python-midi

Tags:

Python

Midi