1
0
Fork 0
This repository has been archived on 2019-12-23. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
arduinisten/projekte/soundz/midifnord/example_print_channel_0.py
2010-03-31 21:20:08 +02:00

25 lines
543 B
Python

import sys
sys.path.append("midi")
from MidiOutStream import MidiOutStream
from MidiInFile import MidiInFile
"""
This prints all note on events on midi channel 0
"""
class Transposer(MidiOutStream):
"Transposes all notes by 1 octave"
def note_on(self, channel=0, note=0x40, velocity=0x40):
if channel == 0:
print channel, note, velocity, self.rel_time()
event_handler = Transposer()
in_file = 'nevergoingtoU.mid'
midi_in = MidiInFile(event_handler, in_file)
midi_in.read()