1 from MidiOutStream
import MidiOutStream
2 from MidiInFile
import MidiInFile
5 This prints all note on events on midi channel 0
9 class Transposer(MidiOutStream
):
11 "Transposes all notes by 1 octave"
13 def note_on(self
, channel
=0, note
=0x40, velocity
=0x40):
15 print channel
, note
, velocity
, self
.rel_time()
18 event_handler
= Transposer()
20 in_file
= 'midiout/minimal_type0.mid'
21 midi_in
= MidiInFile(event_handler
, in_file
)