Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
28 lines (22 sloc) 670 Bytes
## The goal of this module is to eventually be to MIDI players what
## 'webbrowser' is to Web browsers.
import sys
import tempfile
import subprocess
from sebastian.midi import write_midi
OPEN = "open"
TIMIDITY = "timidity"
def play(tracks, program=""):
f = tempfile.NamedTemporaryFile(suffix=".mid", delete=False)
s = write_midi.SMF(tracks)
if not program:
if sys.platform == "darwin":
program = OPEN
elif sys.platform == "linux2":
program = TIMIDITY
if program:[program,])
print "A suitable program for your platform is unknown"
Jump to Line
Something went wrong with that request. Please try again.