Skip to content

Commit

Permalink
simple playmidi script
Browse files Browse the repository at this point in the history
  • Loading branch information
albertz committed May 8, 2011
1 parent 661e220 commit 735cda9
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions playmidi.py
@@ -0,0 +1,22 @@
#!/usr/bin/python

from decode import *
from soundutils import *
import sys

if len(sys.argv) > 1:
midifile = sys.argv[1]
else:
midifile = sample_mid_file

def midiEventHook(stream):
for ev in stream:
print ev
yield ev

midievents = midi_to_midievents(midifile)
midievents = midiEventHook(midievents)
rawpcm = midievents_to_rawpcm(midievents)

for data in rawpcm:
play(data)

0 comments on commit 735cda9

Please sign in to comment.