I am currently writing a midi generator using preexisting midi files. I'm getting confused as each midi file I download seems to be saved in a slightly different format. I particularly getting confused as to what tracks are and how they effect time. In the midi files docs it states:
There are three types of MIDI files:
type 0 (single track): all messages are saved in one track
type 1 (synchronous): all tracks start at the same time
type 2 (asynchronous): each track is independent of the others
When creating a new file, you can select type by passing the type keyword argument, or by setting the type attribute:
mid = MidiFile(type=2)
mid.type = 1
Type 0 files must have exactly one track. A ValueError is raised if you attempt to save a file with no tracks or with more than one track.
My questions are
1. When it makes the distinction between synchronous and asynchronous tracks, does this mean synchronous means delta time 're-starts from 0' for each new track whereas asynchronous are consecutive in terms of timing? If not what does this mean?
2. If my above assumption is correct, in which situation would you use asynchronous files?
3. How does one split up tracks if type 2?
Essentially I am trying to regularise all the different ways of formatting midi files so that I can manipulate the data more easily between types. Any help with this would be appreciated.