.mid file is a standard MIDI file. It starts with a header, then holds a track for the tempo map and a track for each other part of the chart: the song’s events, each instrument and each vocal part.
The file
- Required: MIDI format 1, in which every track has its own timeline.
- The file starts with a header chunk,
MThd. It holds the format, the number of tracks and the resolution. - Required: a header body 6 bytes long.
- Required: after the header, only
MTrkchunks, one for each track the header counts.
Resolution
The header’s division is the chart’s resolution: the number of ticks in a quarter note. Required: a number of ticks, from 1 to 32767. Unlike a.chart file’s Resolution, it is always written, and it can’t be more than 32767.
Tracks
- The other tracks follow the tempo track, in any order, except that harmonies come in order. See Vocals and harmonies.
- Required: one track at most for
EVENTS, for each instrument and for each vocal part.
.chart file has a section for each instrument and difficulty. A .mid file has one track for each instrument, which holds all of its difficulties.
Track names
Every track starts with its name, a track name event,FF 03:
- Required: exactly one name in each track, as its first event, at tick 0.
- Required: the name exactly as these pages list it, in capitals, such as
PART GUITAR.
EVENTS and the names of instrument and vocal tracks. Recommended: TEMPO TRACK.
MIDI events
A track holds three kinds of event:- Channel events, such as note-ons and note-offs. A note’s channel has no meaning, except that a note-off ends a note on its own channel. See Note pairing.
- Meta events, such as track names, text, tempos and time signatures.
- SysEx events, which some modifiers use. See Note modifiers.
- Required: each delta time at most 4 bytes long.
- Required: an end of track event,
FF 2F, as the track’s last event.
Events at one tick
A scanner reads a track’s events at one tick in the order the file holds them. The order matters for:- a note-off and a note-on of one pitch. See Note pairing;
- text events that change the notes after them, such as
ENHANCED_OPENS. See Note modifiers.
.chart file. scan-chart’s export writes them in this order.
The tempo track
The first track holds the chart’s tempos and time signatures. It’s the.mid form of a .chart file’s [SyncTrack]. A scanner reads tempos and time signatures only from this track. Recommended: only its name, tempos and time signatures.
Tempos
A tempo event,FF 51, sets the tempo from its tick to the next tempo. Its 3 bytes hold the length of a quarter note, in microseconds:
- The tempo in BPM is 60,000,000 divided by the value.
- Required: a whole number from 1 to 16,777,215.
- Required: one tempo at most at a tick.
.chart tempo is in thousandths of a beat per minute instead. See Tempo markers. Neither format can hold every tempo of the other exactly.
Time signatures
A time signature event,FF 58, sets the meter from its tick to the next time signature. Its first two bytes are the numerator and the exponent: the denominator is 2 to the power of the exponent.
- Required: a numerator from 1 to 255, and an exponent from 0 to 7, for the denominators 1 to 128.
- Required: one time signature at most at a tick.
- The event’s last two bytes, MIDI clocks per metronome click and 32nd notes per quarter note, have no effect.
.chart file, the exponent is always written. Time signatures only change the lines that appear during gameplay, as in a .chart file. See Time signatures.
The start of the chart
Recommended: a tempo and a time signature at tick 0. Edge case: until its first tempo, a chart plays at 120 BPM, and until its first time signature, it’s in 4/4.Text
Text events hold practice sections, lyrics and the other events these pages list.- Required: in
EVENTSand instrument tracks, every text is a text event,FF 01. Vocal tracks hold lyrics. See Lyrics. - Required: text is UTF-8. A
.midfile has no byte order mark.
EVENTS and instrument tracks, square brackets around the whole text are optional, as in a .chart file: [section Intro] means the same as section Intro. Recommended: no brackets. A range shift is the exception: it’s written with them. See Range shifts. In a vocal track, text that starts with [ is never a lyric. See Lyrics.
Ignored
- Tempos and time signatures in any track but the first.
- Notes and text in the first track.
BEATandVENUEtracks, from Rock Band charts. Clone Hero ignores them. YARG draws its beat lines fromBEATnotes 12, 13 and 14, and reads lighting and camera cuts fromVENUE. An exporter should keep them when rewriting a file.- A track with any other name. Instrument tracks lists the ones from other games.
Invalid forms
scan-chart saves an edited.mid song by keeping every event you didn’t edit as the file wrote it, apart from extra track names. When it exports a .mid file anew, as converting does, it writes every track in the standard form. Where the two differ, the forms below say so.
A format other than 1
A format other than 1
A header that isn't 6 bytes long
A header that isn't 6 bytes long
A track count that doesn't match the tracks
A track count that doesn't match the tracks
A chunk of another kind among the tracks
A chunk of another kind among the tracks
A delta time longer than 4 bytes
A delta time longer than 4 bytes
Running status before a track's first channel event
Running status before a track's first channel event
A system common or real-time byte inside a track
A system common or real-time byte inside a track
No end of track, or events after it
No end of track, or events after it
fixIssues can move the end of track after them, which changes the TrackHash.A damaged file
A damaged file
A resolution of 0, or in SMPTE frames
A resolution of 0, or in SMPTE frames
More than one track name at tick 0, or an event before the name
More than one track name at tick 0, or an event before the name
multipleMidiTrackNames for a track with more than one name at tick 0, and saving with scan-chart removes every name at tick 0 but the last.A name in another letter case
A name in another letter case
part guitar is lead guitar. YARG ignores the track. scan-chart’s export writes the name in capitals.A name with spaces at its ends, or no name at tick 0
A name with spaces at its ends, or no name at tick 0
A first track named EVENTS, or named as an instrument
A first track named EVENTS, or named as an instrument
EVENTS as the EVENTS track, as well as the tempo track, and reads no notes from the first track, as Clone Hero and scan-chart do. YARG doesn’t read it as the EVENTS track. YARG’s gameplay reads no notes from it either, though YARG’s song scan lists an instrument named there. scan-chart’s export writes a separate tempo track.A tempo of 0, or a numerator of 0
A tempo of 0, or a numerator of 0
Two tempos, or two time signatures, at one tick
Two tempos, or two time signatures, at one tick
An exponent of 8 or more
An exponent of 8 or more
Text of another type in EVENTS or an instrument track
Text of another type in EVENTS or an instrument track
ENHANCED_OPENS and ENABLE_CHART_DYNAMICS, only from a text event, FF 01, as Clone Hero and scan-chart do. Other text of another type Clone Hero ignores. YARG reads the types FF 04 to FF 09, and scan-chart reads FF 05, FF 06 and FF 07, so a section written as a marker event, FF 06, is a section there but not in Clone Hero. See EVENTS track. scan-chart’s export writes such text as FF 01.Text that isn't UTF-8
Text that isn't UTF-8