@@ -4,7 +4,6 @@ The idea here is to decode midi files into objects that are easy to extract data
44This will probably only work with type one midi files which are organized so that each track contains data for a separate instrument.
55
66(This isn't meant to create or manipulate midi files; it is just to get data from them.)
7- Current work in progress is generating note objects from the midi file, with start and stop times.
87
98At this point, this script should be able to take a format one midi file that has one channel per track,
109and create Notes with start and stop times. To do this, create a MidiData (ex midiData = MidiData("testMidiFile.mid")).
@@ -17,3 +16,24 @@ field in the range 0 - 127. trackData.name contains the name of the track, whic
1716trackData.events contains the midi events in the track, and each event has a startTime field in milliseconds. Midi events are defined in
1817MidiEvents.py.
1918TrackData, MidiData, and Note may need to imported.
19+
20+ Structure (only intended output values listed):
21+ MidiData: contains all data for a midi file (created by calling MidiData("midi_file.mid")
22+ where "midi_file.mid" is the path to the midi file)
23+ getNumTracks(): number of tracks in the midi file
24+ tracks: list of TrackData (one TrackData for each track in the file)
25+ getTrack(index): returns the TrackData with the given index (ex. data.getTrack(1) to get the data for the second track)
26+
27+ TrackData: contains all the data for a single track
28+ notes: list of Note (one Note for each note in the track)
29+ channel: channel
30+ events: list of MidiEvents that make up the track (see MidiEvents.py for definitions)
31+ name: name of the track
32+
33+ Note:
34+ pitch: note number
35+ startTime: start time in ms
36+ endTime: end time in ms
37+ velocity: velocity
38+ releaseVelocity: release velocity
39+ length(): length of the note in ms
0 commit comments