viewhack

MIDI file viewer: every note on a piano roll, and play it

Open a .mid, .midi, .kar or .rmi file without installing a music program. You see every note on a piano roll, what each track is (its channel, the General MIDI instrument it asks for, how many notes it has and its lowest and highest note), every tempo change, the time and key signatures, the length in seconds, and karaoke lyrics with their times. Press Play to hear it on a simple synth.

The file is read on your device. It is not uploaded, and no sound library is downloaded.

What it shows

How ticks become seconds: a worked example

A MIDI file stores no clock times. Each event carries a delay in ticks, and the file says how many ticks make a quarter note (the header's division, often 96, 480 or 960). The tempo events say how long a quarter note lasts, in microseconds.

Take a file with 480 ticks per quarter note that starts at 120 BPM (a tempo event of 500,000 µs per quarter note) and changes to 60 BPM (1,000,000 µs) at tick 960. The first 960 ticks are two quarter notes at half a second each: 1.0 s. A note at tick 1,920 comes 960 ticks after the change, two quarter notes at one second each, so it starts at 1.0 + 2.0 = 3.0 seconds. Without the tempo change it would start at 2.0 s. A player that ignores the tempo map gets every note after a change wrong, which is why the tempo map is listed in full.

With no tempo event at all, the MIDI standard's default is 120 BPM, and this page uses it. A file with SMPTE timing counts real time directly (for example 25 frames per second with 40 ticks per frame is 1,000 ticks a second), so its tempo events do not change the timing.

Files it opens

.mid and .midi
Standard MIDI Files, formats 0, 1 and 2. The reader was written for this page from the Standard MIDI File 1.0 specification, with no MIDI library: running status (events that leave out a repeated status byte), a note-on with velocity 0 read as a note-off, system-exclusive messages skipped by their length, and unknown chunks skipped.
.kar (karaoke)
A format 1 MIDI file that follows the Tune 1000 karaoke convention: the words are text events, a leading / starts a new line and \ a new verse, and lines starting with @ are headers (@T title, @L language, @I information). They are shown as the karaoke header and as timed lyric lines.
.rmi
A Windows RIFF file of type RMID. Its data chunk holds an ordinary MIDI file, which is taken out and read.
Text in odd encodings
MIDI does not say which character set its names and lyrics use. Text that is valid UTF-8 is read as UTF-8; anything else as Windows-1252, which is right for most Western European karaoke files. Japanese Shift_JIS lyrics show as garbled Latin letters.

Useful to know about MIDI files

Why the same file sounds different on every device
A MIDI file holds no sound, only instructions: which note, how hard, when, and which instrument number. The instrument names come from the General MIDI 1 sound set (MIDI Manufacturers Association, “General MIDI System Level 1”, 1991), 128 programs in 16 families of 8, plus the drum map on channel 10. Each synthesizer, from Windows' built-in one to a phone app, plays those numbers with its own recorded sounds.
Program numbers: 1 to 128 or 0 to 127?
The bytes in the file run from 0 to 127, and the General MIDI list numbers them 1 to 128. Program byte 0 is instrument 1, Acoustic Grand Piano; byte 40 is instrument 41, Violin. This page shows the 1-to-128 number beside the name.
Middle C: C4 or C3?
Note 60 is middle C. This page calls it C4 (scientific pitch notation, as most notation programs do); Yamaha instruments, Cubase and FL Studio call the same note C3, so their note names are an octave lower than the ones here for the same numbers.
Format 0 or format 1?
A format 0 file keeps everything in one track, so its parts can only be told apart by channel; the Tracks table then shows one track with several channels. Format 1 gives each part its own track, and the first track usually holds only the tempo and time signature (it shows 0 notes).

What this cannot do