MIDIFile management


Functions are provided to read on write MIDIfiles and convert them to the MidiShare sequence format. When loading a multi-tracks MIDIfile, the different tracks of the MIDIfile will correspond to different tracks of the MidiShare sequence. This means that all events of track 0 have a reference number of 0, all events on track 1 have a reference number of 1 and so on. When saving a format 1 MIDIfile, the function uses the events reference number to create different tracks in the MIDIfile. The function always write tracks in ascending order starting from track 0 (which is the TempoMap). Notes events are written as a KeyOn/KeyOff pair and EndTrack events are written automatically. If the sequence does not contain a Tempo Map, the function writes a default Tempo of 120 bpm and a Time Signature of 4/4. There are several C files for MIDIFile management :