Created
September 1, 2012 11:08
-
-
Save danielpclark/3569940 to your computer and use it in GitHub Desktop.
Play all midi files in the directory.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
################################################## | |
# Progran: ALL MIDIS # | |
# Version: 0.1 # | |
# Company: 6ft Dan(TM) # | |
# Author : Daniel P. Clark # | |
# E-mail : # | |
# Date : <= 2005 # | |
# ABOUT : Plays all midi's in current # | |
# directory # | |
################################################## | |
import sys, os, string | |
Timidity = "/usr/bin/timidity" # creates variable for timidity program | |
mylist = [] | |
def menu(): | |
global mylist | |
directory="." # for now, the current directory | |
mylist = os.listdir(directory) # get list of files in current directory | |
for x in range(len(mylist)): | |
if string.lower(mylist[x][-3:]) != "mid": | |
continue | |
else: | |
midFile = os.path.join(directory, mylist[x]) | |
os.system(Timidity + " \"" + midFile + "\"") | |
sys.exit() | |
if __name__ == '__main__': | |
while 1: | |
menu() # Run the program! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment