I want to be able to read events from a MIDI file in Python. I have looked for libraries, but can\'t find one that works with my MIDI file in windows. I do not need to do anythi
I once wrote a simple library in pure C to read/write Midifiles. If you want to have a look here it is: http://code.google.com/p/middl/
It is a low level library that ease the task of dealing with midifiles but you should be familiar with the Midi file formaat to use it.
There is a library called mido which is good for reading these files: https://pypi.python.org/pypi/mido/1.1.11
Check out this python library on github, it seems to do exactly what you need:
https://github.com/vishnubob/python-midi
Your best bet might be to get a c or c++ library, and interact with it using the Python Extensions for c.
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).
Just pip install mido
then:
import mido
m = mido.MidiFile('tuba.mid')