Files and formats · 5 min read

What Is a MIDI File? How MIDI Works, in Plain English

A MIDI file stores notes, not sound: which key, when, how hard, on which instrument. How .mid files work, MIDI vs. MP3 and MusicXML, and how to open one.

By Audio2MIDI.org

On this page
  1. 01What's inside a MIDI file
  2. 02Note numbers: how MIDI names pitches
  3. 03MIDI vs. MP3, WAV and MusicXML
  4. 04Type 0 and Type 1 files
  5. 05General MIDI: why a file knows it's a piano
  6. 06How to open a MIDI file
  7. 07How to convert a MIDI file
  8. 08Where MIDI files come from
  9. 09Common problems with MIDI files
  10. 10Questions people ask

MIDI files are tiny, they open in almost any music software, and they sound different everywhere you play them. All three facts have the same cause: a MIDI file doesn't contain sound. It contains instructions, a score for machines that says which note to play, when, how hard and on which instrument.

This guide explains what's inside a .mid file, how it differs from MP3 and MusicXML, and how to open, edit or convert one.

What's inside a MIDI file

MIDI (Musical Instrument Digital Interface) started in 1983 as a way for keyboards and synthesizers to talk to each other. A MIDI file, properly a Standard MIDI File, saves that conversation with timestamps. The main messages are:

MessageWhat it saysExample
Note OnStart a note: which key, how hard (velocity 1–127)Middle C (note 60), velocity 90
Note OffStop that noteMiddle C released
Program ChangeSwitch instrumentProgram 1, Acoustic Grand Piano
Control ChangeMove a control: pedal, volume, panSustain pedal down (controller 64)
Pitch BendBend the pitch smoothlyA guitar-style bend
Tempo (meta)Set the speed500,000 µs per beat = 120 BPM
Time signature (meta)Set the meter4/4
Track name, lyrics (meta)Text"Piano right hand"

Each message carries a time, counted in ticks: small slices of a beat (often 480 or 960 per quarter note). That's why MIDI timing can follow a tempo change perfectly: the file counts beats, not seconds.

Note numbers: how MIDI names pitches

MIDI numbers every pitch from 0 to 127, one per half step. Middle C is 60, the A above it (440 Hz) is 69, and a full piano runs from 21 (A0) to 108 (C8).

C460E464G467A469C572
Note names with their MIDI note numbers. Tap a note to hear it.

One trap: programs don't agree on what to call note 60. In scientific pitch notation it's C4, which is what this site uses. Ableton Live and Yamaha label it C3, and FL Studio labels it C5. The number is always 60, so if a MIDI file seems an octave off in one program, check the naming, not the notes.

MIDI vs. MP3, WAV and MusicXML

MIDI (.mid)MP3 / WAVMusicXML
ContainsNote instructionsRecorded soundWritten notation
Sounds the same everywhereNo, it depends on the instrumentsYesNo, it's rendered like MIDI
Edit single notesYesNoYes
Size, 3-minute piano pieceUsually a few dozen KBAbout 3 MB (MP3) to 30 MB (WAV)Tens to hundreds of KB
Best forDAWs, synths, practice, arrangingListening, sharing, releaseNotation software, printing

MIDI stores what was played and when, to the tick. MusicXML stores how it's written: note spelling (F♯ or G♭), beaming, clefs, slurs, lyrics and layout. That's why turning MIDI into sheet music takes a little interpretation, and why a MIDI to Sheet Music converter has to quantize and choose spellings.

Type 0 and Type 1 files

Standard MIDI Files come in two common types:

  • Type 0: everything in one track. Simple, and common for ringtones and older hardware.
  • Type 1: several tracks side by side, for example right hand, left hand and drums. Easier to edit; most software saves this by default.

There's also a rare Type 2 for independent patterns. Most software reads Type 0 and Type 1 without you noticing the difference.

General MIDI: why a file knows it's a piano

General MIDI is the standard list of 128 instruments that most players share: program 1 is Acoustic Grand Piano, 25 is a nylon-string guitar, 41 a violin, 57 a trumpet. Channel 10 is reserved for drums, where each note number is a different drum: 36 a kick, 38 a snare, 42 a closed hi-hat.

The list fixes which instrument plays, not how good it sounds. A phone's built-in synth and a professional sample library both play "program 1", with very different results.

MIDI 2.0, adopted in 2020, adds higher resolution and two-way communication between devices. Most .mid files you'll meet are still Standard MIDI Files from MIDI 1.0, and they'll keep working everywhere.

How to open a MIDI file

You need something that can turn the instructions into sound:

  • A DAW such as GarageBand, Logic Pro, Ableton Live, FL Studio, Cubase or Reaper opens .mid files as editable tracks.
  • Notation software such as MuseScore Studio (free) opens them as sheet music.
  • A browser player plays them with no install.

How to convert a MIDI file

  • MIDI to MP3 or WAV, to share it or put it in a video: render it with an instrument. MIDI to MP3 does it in the browser.
  • MIDI to sheet music, to print or practice from: MIDI to Sheet Music engraves it as a score with MusicXML and PDF exports.
  • Edit it first: fix wrong notes, quantize timing or change velocities in the free MIDI Editor.

Where MIDI files come from

  • Playing a MIDI keyboard into a DAW records MIDI instead of sound.
  • Writing in a DAW or notation program and exporting .mid.
  • Transcribing a recording. Audio to MIDI software listens to audio and writes down the notes. Our guide to converting audio to MIDI compares the options.

Common problems with MIDI files

  • It sounds cheap. That's the player's instruments, not the file. Load it into a DAW with better instruments, or render it with a good piano.
  • Everything plays on piano. The file has no program changes, or the player ignores them. Assign instruments in your DAW.
  • The tempo is wrong. Some files lack a tempo message, and players then default to 120 BPM. Set the tempo by hand.
  • It looks messy as sheet music. Played-in MIDI has human timing. Quantize before converting to notation.
  • An octave off in one program. Check the middle C naming (C3, C4 or C5), described above.

A MIDI file is small because it describes music instead of recording it. That makes it the most flexible format you can have: change the instrument, the tempo or a single wrong note, and turn it into sound or sheet music whenever you need to.

FAQ

Questions people ask

No. A MIDI file contains no recorded sound, only instructions: which notes to play, when, how hard and with which instrument. A synthesizer, a sampler or a software instrument turns those instructions into sound when you play the file.

Because each player brings its own instruments. The file only says “piano, middle C, fairly loud”; one device plays that with a basic built-in synth, another with a sampled concert grand. To fix the sound, render the MIDI to MP3 or WAV with the instruments you like.

Yes. Converting MIDI to MP3 or WAV is called rendering: a player plays the file through an instrument and records the result. You can do it in any DAW, or in a browser with a MIDI to MP3 converter.

Yes, with audio to MIDI transcription, which listens to the recording and writes down the notes. It works best on a single instrument; full mixes are usually separated into parts first. The result needs a quick check, because no transcription is perfect.

A Type 0 file puts all channels in a single track. A Type 1 file keeps several tracks side by side, for example piano, bass and drums, which is easier to edit. Most software reads both and saves Type 1 by default.

The format is free for anyone to use, but the music in a file can be protected. A MIDI arrangement of a recent song is usually still covered by the song’s copyright, even though the file contains no recording. Public-domain music, and music you wrote, is safe to share.

Try MIDI Player on your own file

Free in your browser, no account needed.

Open MIDI Player