X-Git-Url: https://scm.cri.minesparis.psl.eu/git/minwii.git/blobdiff_plain/346a9b8e1fcfe30629f0d1ee4675e9e8f89890cf..4c4732c6ed8cb0aaa70fb2d4c6e5a958868c5349:/src/mxmMidi/MidiInFile.py?ds=sidebyside diff --git a/src/mxmMidi/MidiInFile.py b/src/mxmMidi/MidiInFile.py deleted file mode 100644 index 57f4c7e..0000000 --- a/src/mxmMidi/MidiInFile.py +++ /dev/null @@ -1,55 +0,0 @@ -# -*- coding: ISO-8859-1 -*- - -from RawInstreamFile import RawInstreamFile -from MidiFileParser import MidiFileParser - - -class MidiInFile: - - """ - - 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 - ---------------------------------- - - 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 - - End of file - - - """ - - def __init__(self, outStream, infile): - # these could also have been mixins, would that be better? Nah! - self.raw_in = RawInstreamFile(infile) - self.parser = MidiFileParser(self.raw_in, outStream) - - - def read(self): - "Start parsing the file" - p = self.parser - p.parseMThdChunk() - p.parseMTrkChunks() - - - def setData(self, data=''): - "Sets the data from a plain string" - self.raw_in.setData(data) - -