Found a simpler way to implement MidiFile.__iter__(). :)