What is MIDI, and what's inside a MIDI file

A digital piano connected by a USB cable to a closed laptop resting on its top, beside a printed page of sheet music.

MIDI (Musical Instrument Digital Interface) is a standard, dating from 1983, that lets keyboards, computers and apps tell each other what to play: which key went down, how hard, and when it was let go. It carries no sound. A MIDI file (.mid) stores those same instructions as a list of timed note events, so whatever plays it chooses the sound, and a whole piece is measured in kilobytes.

The name covers three things:

  1. A set of messages, the main ones being "note on" and "note off", each with a note number from 0 to 127. Middle C is 60, and an 88-key piano runs from 21 to 108. Each note on carries a velocity from 1 to 127: how hard the key was struck. The sustain pedal is controller 64.
  2. A way of connecting. Older gear has round 5-pin DIN ports, which need a USB MIDI interface to reach a computer. A digital piano with a USB port, often labelled "USB to Host", plugs straight in, and some use Bluetooth.
  3. A file format. The Standard MIDI File usually comes as Type 0, with everything on one track, or Type 1, with several tracks, such as one per hand.

Because it's neither audio nor sheet music, a MIDI file leaves a lot to whatever plays it. One with no tempo in it plays at 120 beats per minute. General MIDI instrument number 1, Acoustic Grand Piano, only asks for a piano, so the same file can sound like a concert grand on one device and a thin keyboard tone on another.

MIDI sends instructions, and the receiver makes the sound

Press middle C firmly on a digital piano that's connected to a computer. The piano sounds through its own speakers and, at the same moment, sends note on, note 60, high velocity out of its USB port. Let go and a note off follows.

Whatever receives those messages makes its own sound from them, or none. So a controller keyboard with no speakers is silent until it's plugged into a computer or tablet running a piano sound, and a digital piano with a USB port is already a MIDI keyboard, one with sounds built in.

The cable usually runs from the square USB-B socket on the piano to the computer, and a tablet may need an adapter. The flat USB-A socket labelled "USB to Device" takes a memory stick; a computer plugged into it gets nothing.

A MIDI file is a list of timed note events

A MIDI file holds the same messages, each with a time: for every note a number, a start, an end, a velocity and one of 16 channels. Around the notes sit the tempo, the time signature, track names and, if it was recorded or written in, the sustain pedal.

Take the right hand's first nine notes of Für Elise: E, D sharp, E, D sharp, E, B, D, C, A. A MIDI file stores them as 76, 75, 76, 75, 76, 71, 74, 72, 69. With each hand on its own track, a piano app can let your student play the right hand while it plays the left. How to convert sheet music to MIDI covers making a file like that from printed music.

MIDI isn't sheet music

Notation software that opens a MIDI file gets numbers and times, a record of what sounds, and has to rebuild the written page from them. It guesses at:

  • How each note is spelled. Note 75 is the D sharp in Für Elise, but it's also E flat, and the file doesn't say which.
  • The key signature, which the file may not store.
  • Note values and rests. Played-in MIDI is rarely exactly on the beat, and a short staccato quarter note can look like an eighth note followed by an eighth rest.
  • Which staff each note goes on, when both hands share a track.
  • Beaming, fingering, slurs, dynamics as markings, words like "dolce", and the page layout.

Expect to tidy any score a notation program makes from a MIDI file. In the site's worked MIDI handoff, the fingerings and the tempo word "pas vite" in Schumann's Mélodie didn't survive the trip to MIDI, because MIDI has no place for them.

For notation, use MusicXML, which keeps the written score, spelling and all. The guide to converting PDF sheet music to MusicXML shows how to get one from a page.

Format What it holds What it's for What opens it
MIDI (.mid) Timed note events: numbers, lengths, velocity, tempo Playback, recording, piano apps, Synthesia DAWs, Synthesia, MuseScore (as notation to tidy)
MusicXML (.musicxml, .mxl) The written score: spelling, key, beaming, fingering, dynamics Editing the score in notation software MuseScore, Sibelius, Dorico, Finale
Audio (MP3, WAV) A recording of the sound Listening Any media player

Where pianists and teachers meet MIDI

When a piano app or Synthesia shows which keys your student got right, it's reading note numbers from the piano over USB or Bluetooth MIDI. Record the piano over USB into GarageBand or another DAW and you get MIDI rather than audio, so you can fix a wrong note afterwards. MIDI files also turn up beside the PDFs in public-domain score archives, and as backing tracks.

A MIDI file is numbers, so changing it is cheap. Slow a piece to half speed and it stays in tune: the notes don't change, only their timing. Transpose it and every note number moves by the same amount. An audio recording does neither cleanly.

Note 60 is always middle C, but notation software usually calls it C4, while Yamaha, Logic and Cubase call it C3. Only the label differs. The piano notes chart shows each note on the grand staff and the keyboard.

Getting MIDI out of PlayableNotes

PlayableNotes starts from the page. It reads two-staff piano music, a treble and a bass staff together, from a photo, a screenshot, a PDF or a MusicXML file; it doesn't open MIDI files or connect to your piano. Play the reading back at any tempo, a hand at a time if you like, and check it by ear against the page. Then download MIDI, MusicXML or PDF; the sheet music to MIDI page shows how.

Reading costs 1 credit per line of music, and a reading that fails costs nothing. Downloads, editing and the roughly 320 public-domain pieces in the library are free.

Try it with a page of your own piano music at your projects; new accounts start with 50 free credits.

FAQ

What does MIDI stand for?

Musical Instrument Digital Interface. It's the standard, first published in 1983 and worked out by instrument makers including Dave Smith of Sequential Circuits and Ikutaro Kakehashi of Roland, that lets electronic instruments, computers and apps send each other note messages instead of sound.

Is a MIDI file the same as sheet music?

No. A MIDI file stores note numbers and timings, so it can't tell F sharp from G flat. It may not store the key signature, and it has no place for fingering, slurs or words like "dolce". Notation programs can turn it into a score, but expect to tidy the result. For a score someone will edit, use MusicXML.

How do I open or play a MIDI file?

GarageBand on a Mac opens one, and so does any DAW. MuseScore opens it as notation that needs tidying. VLC plays MIDI too, though on some systems it needs a SoundFont first.

How do I turn a MIDI file into an MP3?

Something has to play it and record the sound. Open the file in GarageBand, MuseScore or another DAW and export audio, or use VLC's convert option. The MP3 sounds like whichever piano sound that program used, so try a couple if the first sounds thin.

Can my digital piano play a MIDI file?

Some can: check the manual for "song playback" or "SMF". Those pianos play .mid files from a memory stick in the "USB to Device" port, through the piano's own sound. Otherwise, connect the piano to a computer by USB, play the file in a DAW and send its track out to the piano.

Is MIDI still used, and what is MIDI 2.0?

Yes. Digital pianos, keyboards, DAWs and piano apps all still use it. MIDI 2.0, adopted in 2020, adds much finer steps for things like velocity and lets devices talk back and forth. It builds on MIDI 1.0 rather than replacing it, so your keyboard and your .mid files keep working.

Why does my MIDI file sound different on another device?

A MIDI file holds no sound, only notes and at most a request for an instrument, such as General MIDI number 1, Acoustic Grand Piano. Each device plays that with its own sounds. If the speed changes too, the file may have no tempo in it, so it plays at MIDI's default of 120 beats per minute.

← All posts