Package echonest :: Package remix :: Package support :: Package midi :: Module MidiInFile :: Class MidiInFile
[hide private]
[frames] | no frames]

Class MidiInFile

source code

Parses a midi file, and triggers the midi events on the outStream object.

Get example data from a minimal midi file, generated with cubase. >>> test_file = 'C:/Documents and Settings/maxm/Desktop/temp/midi/src/midi/tests/midifiles/minimal-cubase-type0.mid'

Do parsing, and generate events with MidiToText, so we can see what a minimal midi file contains >>> from MidiToText import MidiToText >>> midi_in = MidiInFile(MidiToText(), test_file) >>> midi_in.read() format: 0, nTracks: 1, division: 480 ---------------------------------- <BLANKLINE> Start - track #0 sequence_name: Type 0 tempo: 500000 time_signature: 4 2 24 8 note_on - ch:00, note:48, vel:64 time:0 note_off - ch:00, note:48, vel:40 time:480 End of track <BLANKLINE> End of file

Instance Methods [hide private]
 
__init__(self, outStream, infile) source code
 
read(self)
Start parsing the file
source code
 
setData(self, data='')
Sets the data from a plain string
source code