Description of MIDI Standard File Format
To get your copy of the 1.0 spec, send a $2 check to:
International Midi Association
5316 West 57th Street
Los Angeles, CA 90056
(415) 321-MIDI
Make your checks payable to the IMA. BYW, the 1.0 spec is technically
identical to the .06 spec, but the description has been re-written.
Since the spec has been offically approved, there shouldn't be any
problem with posting this summary of the .06 spec:
[This document is Dave Oppenheim's current version of the MIDI file
specification, as sent to those who have participated in its
development. The consensus seems to be to submit this to the MIDI
Manufacturers' Association as version 1.0. I apologize for any loss of
clarity that might have occurred in the conversion from a Microsoft Word
document to this pure text file. I have removed some of the discussion
about recent changes to the specification in order to keep the file size
reasonable.--Doug Wyatt]
Standard MIDI Files 0.06 March 1, 1988
0 Introduction
This describes a proposed standard MIDI file format. MIDI files contain
one or more MIDI streams, with time information for each event. Song,
sequence, and track structures, tempo and time signature information,
are all supported. Track names and other descriptive information may be
stored with the MIDI data. This format supports multiple tracks and
multiple sequences so that if the user of a program which supports
multiple tracks intends to move a file to another one, this format can
allow that to happen.
This spec defines the 8-bit binary data stream used in the file. The
data can be stored in a binary file, nibbleized, 7-bit-ized for
efficient MIDI transmission, converted to Hex ASCII, or translated
symbolically to a printable text file. This spec addresses what's in
the 8-bit stream.
1 Sequences, Tracks, Chunks: File Block Structure
Sequence files are made up of chunks. Each chunk has a 4-character type
and a 32-bit length, which is the number of bytes in the chunk. On the
Macintosh, data is passed either in the data fork of a file, or on the
Clipboard. (The file type on the Macintosh for a file in this format
will be "Midi".) On any other computer, the data is simply the contents
of the file. This structure allows future chunk types to be designed
which may easily be ignored if encountered by a program written before
the chunk type is introduced. Your programs should expect alien chunks
and treat them as if they weren't there.
This proposal defines two types of chunks: a header chunk and a track
chunk. A header chunk provides a minimal amount of information
pertaining to the entire MIDI file. A track chunk contains a sequential
stream of MIDI data which may contain information for up to 16 MIDI
channels. The concepts of multiple tracks, multiple MIDI outputs,
patterns, sequences, and songs may all be implemented using several
track chunks.
A MIDI file always starts with a header chunk, and is followed by one or
more track chunks.
MThd
MTrk