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/midi/example_print_events.py
2010-03-31 21:20:08 +02:00

28 lines
523 B
Python

from MidiToText import MidiToText
"""
This is an example that uses the MidiToText eventhandler. When an
event is triggered on it, it prints the event to the console.
"""
midi = MidiToText()
# non optional midi framework
midi.header()
midi.start_of_track()
# musical events
midi.update_time(0)
midi.note_on(channel=0, note=0x40)
midi.update_time(192)
midi.note_off(channel=0, note=0x40)
# non optional midi framework
midi.update_time(0)
midi.end_of_track() # not optional!
midi.eof()