MIDI

What is a MIDI file?

Not audio but instructions — which note, how hard, how long. Needs rendering to become sound.

What MIDI is

MIDI is a binary format, meaningful only to a program that knows it. It is used for editing.

The extension is .mid, and the full name is MIDI Sequence. Both matter less than what the file can hold, which is what the rest of this page is about.

Where MIDI came from

MIDI Manufacturers Association published it in 1988. The specification is Standard MIDI File.

A format that has been readable for that long is a format worth trusting with something you want back in ten years.

The specification is public

It is published in full, so anyone can implement it from the document rather than by inspection, which is why it turns up in so many programs and why files written twenty years ago still open. A published specification is not the same thing as a royalty-free one: where a format wraps a codec, the patent licensing is a separate question the standard does not settle.

What else it can carry

MIDI can hold several audio tracks.

That matters mostly when converting: whatever the target cannot hold is dropped, usually without a warning.

What opens MIDI

MuseScore, Logic Pro and Ableton Live read it, and so do most programs of the same kind.

If a file will not open, the format is rarely the problem — it is more often that the program predates it. Converting to something older is the reliable way past that, and it is what the rest of this site is for.

Opening it in a browser

No browser reads it.

That is the single most common reason to convert it: not that the format is bad, but that the place you want to show the file cannot read it.

It is a working format

MIDI is meant to be opened and changed. Keep the file in this format for as long as the work is going on, and export from it whenever a finished copy is needed.

There is no sound in a MIDI file

A MIDI file contains no audio whatsoever. It contains instructions: at this moment, start note number 60 with this much force on channel 3; a beat later, stop it. There is no recording, no waveform and nothing to hear until something turns the instructions into sound.

That is why a five-minute orchestral arrangement is thirty kilobytes where the recording of it is fifty megabytes. It is also why the same file is a full band on one computer and a thin electric piano on another — the notes are in the file, and the instruments are not.

Why it sounds different on every machine

The file says "instrument 41", and the standard says 41 is a violin. What that violin actually sounds like is decided by whatever is doing the playing: a sound bank built into the operating system, a soundfont loaded by a player, or a room full of sampled instruments inside music software.

So a file that sounds professional in a studio can sound like a 1990s ringtone in a media player, and neither is wrong. If a MIDI file disappoints, the sound source is nearly always the thing to change rather than the file — the same notes played through a good sample library are a different piece of music.

What the instructions actually record

More than pitch and length. Each note carries a velocity, which is how hard it was struck and usually maps to volume and tone. Alongside the notes run controller messages — sustain pedal, modulation, pitch bend, volume changes over time — and tempo and time-signature information that lets the whole thing be re-read at a different speed without altering anything else.

This is what makes MIDI a working format rather than a delivery one. Change the tempo and nothing degrades. Transpose the key and nothing degrades. Replace the piano with a harp, move one wrong note, delete the drums — all of it is editing a list, not editing a recording.

Tracks, channels and the sixteen-channel limit

A standard MIDI file is usually type 1: several tracks, each holding its own stream of events, played simultaneously. Tracks are an organisational convenience — one per instrument, typically — while channels are the hardware inheritance, and there are sixteen of them.

Channel 10 is the one to know about. By convention it is percussion, so note numbers on it select a drum rather than a pitch. A file whose drums have been moved to another channel plays them as a melody, and a file whose melody has landed on channel 10 plays as an enthusiastic drum solo. It is the most common way a MIDI file arrives sounding wrong in a way nobody can explain.

Turning MIDI into audio

Rendering means giving the instructions to something that makes sound and recording the result. Any digital audio workstation will do it, as will several standalone players with a soundfont loaded — the quality of the output depends entirely on the quality of the instruments you point it at.

The reverse direction barely exists. Extracting MIDI from a recording is transcription, not conversion: software has to work out which notes are being played from the waveform, and it is genuinely difficult. Single instruments playing cleanly give usable results; a full mix gives an approximation that needs more correcting than playing it in by hand would have taken.

Where MIDI files still come from

Keyboards and controllers, which is the format’s original job and one it does perfectly well forty years later. Notation software, which exports MIDI so an arrangement can be heard or moved into a recording program. Backing-track libraries for musicians who need to change the key or the tempo, which is exactly what a recording will not allow.

And an enormous archive from the era when a whole song had to fit in a few kilobytes: website background music, game soundtracks, karaoke files. Much of that material exists nowhere else, which is a reasonable argument for the format outliving the hardware it was built for.

Editing one without a studio

A MIDI file is binary, so a text editor shows nothing useful. What you want is a piano-roll editor — a grid with time along one axis and pitch up the other, notes as rectangles you drag. Every music program has one, and several free ones do nothing else.

It is worth knowing how forgiving this is. Nothing in a MIDI file degrades through editing and re-saving, because there is no encoded audio to degrade. A file can be transposed, re-timed, re-instrumented and saved a hundred times and the hundredth copy is as exact as the first.

The facts, in one place

Identifiers and provenance for the MIDI format.
Extension.mid, .midi
Media typeaudio/midi
Published byMIDI Manufacturers Association
First published1988
SpecificationStandard MIDI File

MIDI files: common questions

Why is there no sound when I play a MIDI file?

Because the file contains instructions rather than audio, and something has to turn them into sound. Most media players either have no sound bank or no MIDI support at all. Use a player with a soundfont loaded, or open it in music software.

Why does the same MIDI file sound different on another computer?

The file names instruments by number and leaves the actual sounds to whatever is playing it. A built-in system sound bank and a professional sample library produce completely different results from identical notes.

Can I convert MIDI to MP3?

Yes — it means rendering the instructions through a set of instruments and recording the result. The output is only as good as the instruments used, which is why the same file can produce anything from a convincing arrangement to something that sounds like a ringtone.

Can I convert an MP3 back to MIDI?

Only approximately. That is transcription rather than conversion: software has to deduce the notes from the waveform. A single clean instrument gives usable results; a full mix gives an approximation that usually needs more correcting than playing the part in by hand.

Why do the drums play as a melody?

Channel 10 is percussion by convention, so note numbers on it select drums rather than pitches. A file whose drum part has been moved off channel 10, or whose melody has landed on it, plays exactly the wrong way round.

Does editing a MIDI file lose quality?

No. There is no encoded audio to degrade — the file is a list of events. Transposing, re-timing and re-saving a hundred times leaves the hundredth copy as exact as the first.