Page tree
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 23 Next »


Enumerator to identify the different MIDI file formats.

  • Format 0: The data is stored in one single multi-channel track.
  • Format 1: The data is stored in separate tracks to be played simultaneously.

MidiFileFormat.singleMultiChannelTrack refers to format 0 and MidiFileFormat.simultaneousTracks to format 1.

Format 2 is seldomly used and not supported.

Available in: Controller.

MIDI File Format Types



To explore the following script:

  1. Download Format 0.mid and Format 1.mid using the links below.
  2. Create an empty program and add a script module.
  3. Paste the script into the text editor of the script module and adjust the file path of readMidiFile to the location of the files on your system.
  4. Execute the script.


-- detect the format of the MIDI files
midiseq = {}
midiseq[1] = readMidiFile("c:/temp/Format 0.mid")
midiseq[2] = readMidiFile("c:/temp/Format 1.mid") --[[ please set the file path to the location
                                                       of the files on your system before you run
                                                       the script ]]

for i, seq in ipairs(midiseq) do
    if seq.format == MidiFileFormat.singleMultiChannelTrack then
        print(seq.songname..".mid has MIDI file format 0.")
    elseif seq.format == MidiFileFormat.simultaneousTracks then
        print(seq.songname..".mid has MIDI file format 1.")
        print("Midi file format of "..seq.songname.." not supported!")
  • No labels