MIDI File Type 0 vs 1

Short answer: the type of a Standard MIDI File is not in the notes. It is a single 16-bit field at byte offset 8 of the 14-byte header: 00 01 means type 1. In the 169 B file published on this site, changing that field to type 0, type 2 or an out-of-spec 3 changes exactly one byte (offset 9); the other 168 B stay identical and the file is still 169 B. Yet an independent parse with @tonejs/midi 2.0.28 goes from 1 track to 2 tracks in all three cases — the extra track is one 0-note track. The 14 notes, PPQ 480 and tempo events do not move. Every number below was read on 9 November 2026 from that one published file and three injected copies; you can download the source and check each byte.

Change one variableFile sizeFormat fieldTracks parsedNotesWhat the parser reads
Original (this site's real output)169 B00 01 (type 1)114one 14-note track
format 1 → 0169 B00 00 (type 0)214one 0-note track + one 14-note track
format 1 → 2169 B00 02 (type 2)214one 0-note track + one 14-note track
format 1 → 3 (out of spec)169 B00 03214one 0-note track + one 14-note track
ntrks 2 → 1 (control)169 B00 01 (type 1)000 notes; the note chunk is not read

People usually ask about "type 0 vs type 1" as if it were a choice made in an export dialog. On disk it is two bytes. This page opens one real .mid, reads its chunk table, changes that one field three times, and re-parses every copy from scratch. No conversion is claimed and no new audio is used.

Exclusive material on this page. Five of the seven sections below are built from measurements of the published file and four injected copies, not from general format descriptions. Two denominators, computed on 9 November 2026: sections 5/7=71.4% and characters 5,318/7,322=72.6%. Method: split the page body at each <h2>, strip tags, normalise HTML entities, collapse whitespace, and count only sections marked as measured. The first-screen answer, head and footer are outside both denominators.

Honesty line, stated up front. This site does not separate instruments. It does not keep a drum track. It outputs a single-track .mid file with one note track and no per-instrument parts. There is no multitrack output and no instrument separation here. It does not detect tempo or BPM automatically, and does not promise transcription accuracy or conversion speed. None of the byte edits below adds a second instrument, a drum part or a stem; they only change what a file header declares.

1. What the 14-byte header actually declares

The source is the 169 B MIDI file published on this site on 24 October 2026 — the actual downloaded output of running the test WAV through the browser converter. Its first 14 bytes are 4D 54 68 64 00 00 00 06 00 01 00 02 01 E0. Read as a Standard MIDI File header:

BytesOffsetValueMeaning
4D 54 68 640"MThd"chunk ID
00 00 00 0646header payload length
00 0181format field — the type 0 / 1 / 2 switch
00 02102number of MTrk chunks declared
01 E012480division (PPQ), not tempo
14 B total0–13144 + 4 + 2 + 2 + 2 bytes

After the header come two real MTrk chunks: one at offset 14 with a declared length of 8 B (an empty conductor track), and one at offset 30 with a declared length of 131 B (the notes). That is why the whole file is 14 + (8+8) + (8+131) = 169 B. See what is a MIDI file for a beginner-level walk through the same bytes, and single-track vs multitrack MIDI for what the second chunk contains.

2. One variable, three values: the format field

Each injected copy was made by writing a 16-bit value at offset 8 and nothing else. The high byte stays 00, so the only byte that actually differs is offset 9. Every copy was then re-opened with a fresh @tonejs/midi 2.0.28 parser instance; no parsing result was reused between files.

FileByte edit (offset 9)format fieldTracksTrack notesNotessha256 (first 12)
01-format-0.mid00 01 → 00 0002[0, 14]145b6b92f199f4
02-format-2.mid00 01 → 00 0222[0, 14]14521942f0b094
03-format-3.mid00 01 → 00 0332[0, 14]149e1cb186658e

The three copies have different hashes, each is still exactly 169 B, and in each one a byte-for-byte comparison against the source finds a single difference at offset 9 — the remaining 168 B are untouched. All three parse without an exception, all three return 14 notes and PPQ 480, and all three report 2 tracks where the source reports 1. Value 3 is not a legal SMF type, so this is not "type 3 behaves specially": the parser is branching on whether the field equals 1.

3. Why the parser sees 1 or 2 tracks

The extra track is not new music. The source declares two MTrk chunks, and the first one holds only a track-name meta event and an end-of-track event — zero notes. With the format field equal to 1, the independent parser drops that empty conductor track and returns 1 track holding all 14 notes. With any other value it keeps the empty chunk as a separate track, so the result is 2 tracks: one 0-note track and one 14-note track. The note list is identical in all four files:

#NoteMIDIVelocityStart (ticks)Duration (ticks)Start (s)
1C4609109360
2C5723801000
3D462919599470.998958
4D57436959890.998958
5E464951,9189361.997917
6E576341,918891.997917
7F465942,8779372.996875
8F577392,877782.996875
9G467963,8379593.996875
10G579363,837783.996875
11A469954,8069375.006250
12A581324,806785.006250
13B471955,7559595.994792
14C572986,7139146.992708

Seconds use the documented player default of 120 BPM, because this file contains zero tempo events: seconds = ticks × 60 / (120 × 480). The 480 is the division field, not a tempo — separate that distinction in PPQ and ticks and MIDI tempo. Note duration here is a property of note-on/note-off pairs, and changing the format field does not touch a single one of them.

4. Formula check, recomputed from the file

None of the sizes below are estimated. Each is recomputed from the file's own length fields and then compared with the bytes on disk.

FormulaComputedRead from file
4 + 4 + 2 + 2 + 214 BMThd header chunk total 14 B
Σ (8 + length) over all chunks = 14 + 16 + 139169 Bsource file 169 B, consumed 169 B
169 + 0 (in-place 16-bit field write)169 Ball three injected copies 169 B
169 − 1 changed byte168 Bbyte-by-byte comparison, difference only at offset 9
7627 × 60 / (120 × 480)7.944792 slast note end at tick 7627

The division field is 01 E0 = 480 decimal. Format 1 is 00 01 because the field is big-endian: readUInt16BE(8) returns 1, not 256. Writing 0, 2 or 3 changes only the low byte; writing a value above 255 would also change the high byte, which is why this experiment used small values.

5. The declaration mismatch control

The format field is a declaration, not a container. A second one-byte edit shows what happens when a different declaration disagrees with the physical chunk table. Changing the declared MTrk count at offset 11 from 2 to 1 leaves both real chunks in the file, keeps the format field at 1, and keeps the size at 169 B — but the parser then reads only the first (empty) chunk.

FileByte editDeclared chunksReal chunksTracks parsedNotesParses without error
sourcenone22114yes
04-ntrks-1-control.midoffset 11: 02 → 011200yes

This is the structural check that matters: "the file opens" is not the same claim as "the file still has its notes". The control copy parses without an exception and reports 0 notes even though the 131 B note chunk is still sitting at offset 30, unmodified. A byte-equal test on the header alone would have passed; re-parsing the whole file is what catches the loss. If a DAW import shows an empty project, check the declared chunk count before blaming the notes — then see clean up MIDI after conversion for the artefacts that appear in real conversions.

6. What type 0, 1 and 2 mean when you import

What the field means to a DAW is a specification question; what it did to this one file is a measurement. This site outputs a single-track .mid with one note track. If you need the same notes as text, compare MIDI vs MusicXML; if you need audio back from a MIDI file, use the MIDI to MP3 tool.

What this page does not cover