Essentially, what I want to do is get rid of MIDI files, when creating a sequencer. So, say I have a text file (that would be my pseudo-MIDI):
A |----------------|
Bb |----------------|
C |----------------|
Db |----------------|
D |----------------|
Eb |----------------|
E |----------------|
F |----------------|
Gb |----------------|
G |----------------|
As that sixteen -
's would be a bar. I want to create a user interface that has the contents of said text file (which I can do easily in Tkinter). But also, I want to have it so when the user loads the file, and presses "Play", it plays OGG or WAV files in accordance to where certain data is in the file. ie:
A |:---------------|
Bb |-[]-------------|
C |----------------|
Db |---:------------|
D |----[--]--------|
Eb |--------::------|
E |----------::----|
F |------------::--|
Gb |----------------|
G |----------------|
Where the :
's are, there would play a certain file, and where certan lengths of [--]
's would play longer files.
So, I need help. So far I have a way to list the lines in the file, but how would I go from there?
fileHandle = open (file)
fileList = fileHandle.readlines()
for fileLine in fileList:
print '>>', fileLine
fileHandle.close()
print fileList
(Note that the variable file
is defined as file = raw_input("File: ")
.