Formats · Notation

MIDI vs MusicXML: What Each Format Stores and When to Use It

Both files can hold the same notes, yet they describe different things. MIDI records what a player did; MusicXML records how the music is written. Knowing which is which saves a lot of cleanup.

MIDI and MusicXML are the two formats you meet whenever music moves between programs. Open either in notation software and you may see a similar score, so it is easy to assume they are interchangeable. They are not. A MIDI file is a list of performance events, much like a piano roll. A MusicXML file is a description of a printed score. The difference decides which file a DAW wants, which one a notation program wants, and why turning one into the other is never quite automatic.

What a MIDI file stores

MIDI (Musical Instrument Digital Interface) dates from the early 1980s, when it was designed so that keyboards and synthesizers could talk to each other. A Standard MIDI File, the .mid you download or export, is a recording of the messages that would travel down that cable:

  • Note on and note off, each with a note number from 0 to 127. Middle C is 60, and each step is a semitone.
  • Velocity, also 0 to 127: how hard the key was struck.
  • Timing in ticks, counted from the previous event. The file declares how many ticks make a quarter note, and tempo events convert ticks into real time.
  • Controllers such as the sustain pedal (controller 64), and program changes that pick an instrument sound.
  • Meta events: tempo, time signature, key signature, track names, sometimes lyrics.

What it does not store is notation. There is no clef, no stem direction, no beam, no slur and no tie as a symbol. A note is simply a number that starts at one tick and stops at another. Most importantly, there is no spelling: note 66 is the black key between F and G, and the file has no way of saying whether that key should be written as F sharp or G flat. Even the key signature event only records how many sharps or flats there are, not how each individual note is spelled.

What a MusicXML file stores

MusicXML was created in the early 2000s as an exchange format for sheet music, and it is now an open standard maintained by a W3C community group. Where MIDI describes sound, MusicXML describes the page. Every note carries its letter name, any sharp or flat, its octave and its written duration, along with the voice and staff it belongs to. Around the notes, the file stores:

  • clefs, key and time signatures, bar lines and repeats;
  • beams, ties, slurs, tuplets and articulations;
  • dynamics such as p and mf, and hairpins, as written markings;
  • lyrics, chord symbols, fingerings and text directions;
  • layout hints such as system and page breaks.

It comes in two flavours. An uncompressed .musicxml file (older ones use .xml) is plain text you can open in any editor. A compressed .mxl file is the same content zipped. Both open in the same programs.

What notation carries that MIDI cannot

The clearest way to see the gap is with notes that a MIDI file would store identically. Example 1 has a D major arpeggio and then an E flat minor arpeggio. The F sharp in the first bar and the G flat in the second are the same key on the piano and the same MIDI note number. In the score, they are different notes, and each spelling tells the reader which chord they are in.

Example 1: one key, two spellings

Rendering notation…

F sharp in a D major arpeggio, G flat in an E flat minor arpeggio. Both are MIDI note 66; only the notation can say which one is meant.

Example 2 shows a tie. The C on the fourth beat of the first bar is held across the bar line for three beats in total. A musician hears one long note, and MIDI stores exactly that: one note on, one note off. But a single note cannot cross a bar line in standard notation, so the score has to write a quarter note tied to a half note. Deciding where to split notes, and how to group them so the beat stays visible, is a notation decision MIDI never makes.

Example 2: a tie across the bar line

Rendering notation…

One sounding note of three beats, written as a quarter tied to a half. In a MIDI file this is a single note with no tie.

Voices work the same way. On a grand staff, notation decides which notes belong to the right hand and which to the left, and within one hand, which notes form a melody with stems up and which form an accompaniment with stems down. MIDI may keep the hands on separate tracks if whoever made the file put them there, but it has no notion of voices within a hand.

Performance MIDI and score MIDI

Not all MIDI files are alike, and this matters more than any difference in format.

Score MIDI is exported from notation software. Every note starts exactly on the grid, durations are exact note values, the tempo map matches the bars, and velocities follow the written dynamics in a few flat steps. It sounds mechanical, but it converts back into notation almost cleanly, because the rhythm is already quantized.

Performance MIDI comes from a person playing a keyboard, or from a transcription of a recording. Notes land a few milliseconds early or late, chords are slightly spread, durations depend on when fingers lifted, and the sustain pedal often keeps notes sounding long after the key came up. If the player did not follow a click, the ticks may not line up with bars at all. It sounds human, which is the point, but it is a long way from a readable score.

Why MIDI to notation means guessing

When a notation program imports MIDI, it has to rebuild everything the file left out. Several separate jobs are hiding in that one import:

  • Quantization. Each start and end time is snapped to the nearest rhythmic value. Snap too coarsely and real sixteenth notes disappear; too finely and a slightly late chord becomes a tangle of thirty-second rests. Triplets and swing are especially hard to tell apart from imprecise straight rhythm.
  • Beat and bar finding. For performance MIDI, the program first has to work out where the beats are and where each bar starts, before any rhythm can be written.
  • Spelling. Every black key has to be named as a sharp or a flat. Good software reasons from the key and the surrounding harmony; simple software picks one spelling and applies it everywhere.
  • Hands and voices. For piano, notes have to be divided between the two staves and then into voices, which usually means a fixed split point or a guess based on range and movement.
  • Ties and grouping. Long notes are split across bar lines and beats, and beams are grouped to show the metre.

None of these steps is impossible, but each is a judgement, and an import that gets one of them wrong produces a score that plays correctly and reads badly. Going the other way, from MusicXML to MIDI, is easy and almost lossless for the notes, because the program only has to throw information away. If you need to correct an imported score, the AI-to-Sibelius workflow goes through the usual fixes in order.

Which format to choose

Choose by what will open the file next.

  • Producing, arranging or playing back in a DAW: MIDI. Logic Pro, Ableton Live, FL Studio, Cubase, Reaper and GarageBand all treat MIDI as their native note data.
  • Editing, printing or sharing a score: MusicXML. It opens in MuseScore, Sibelius, Dorico and Finale with spelling, voices and layout intact.
  • Driving a digital piano, synth or practice app: MIDI, since that is what the hardware speaks.
  • Archiving a transcription you have corrected: MusicXML, because it keeps the decisions you made about spelling and rhythm. Keep the MIDI as well if the original timing and velocities matter to you.
Rule of thumb: if a human will read it, send MusicXML; if a machine will play it, send MIDI.

File size and compatibility

MIDI files are tiny. Each event takes a few bytes, so even a long piano piece is usually measured in kilobytes, and almost any music program, keyboard or phone app can read one. Uncompressed MusicXML is much larger for the same music, because every note is written out in nested text tags, which is why the zipped .mxl version is common for sharing. Support is broad among notation programs and patchier among DAWs: some import MusicXML, many do not.

One MIDI detail worth knowing: a Standard MIDI File comes as type 0, with every channel merged into a single track, or type 1, with separate tracks. If a notation program puts both hands of a piano piece on one staff, the file was probably type 0, or both hands were recorded to the same track, and you will need to split them yourself.

Getting both from a recording

If you start from audio rather than from a score, you need a transcription first, and the quantization, spelling and hand-splitting problems above all apply. Ivory lets you convert a piano recording to MIDI and MusicXML from the same transcription, so you can load the MIDI into a DAW and open the MusicXML in notation software. As with any automatic transcription, check the spellings and the rhythm of syncopated passages before you print. If you prefer to work by ear, our guide on how to transcribe music by ear covers the method, and the notation basics guide explains the symbols a MusicXML file stores.

Common questions

What is MusicXML?

MusicXML is an open, XML-based file format for sheet music. It stores the notation itself (notes with their spelling, rhythms, voices, beams, ties, dynamics, lyrics and chord symbols) so that a score can move between notation programs such as MuseScore, Sibelius, Dorico and Finale without being rebuilt.

What is the difference between MIDI and MusicXML?

MIDI records a performance: which key went down, when, how hard, and when it was released. MusicXML records a score: how those notes are written on the page. MIDI is the format for DAWs, synths and playback; MusicXML is the format for notation software and printed parts.

Should I export MIDI or MusicXML from MuseScore?

Export MusicXML if the score is going to another notation program or to someone who will edit the notation. Export MIDI if you want to load the notes into a DAW, drive virtual instruments or play them on a keyboard. Many people export both.

Can I convert MIDI to MusicXML?

Yes, every major notation program imports MIDI and saves MusicXML. The result depends on the MIDI: a file exported from notation software converts cleanly, while a recorded performance needs quantization, and the program has to guess spellings, voices and hand splits. Expect to tidy the score by hand afterwards.

Which is smaller, a MIDI file or a MusicXML file?

MIDI is far more compact, because it stores each note as a few bytes of binary data. Uncompressed MusicXML spells out every note in verbose text tags and is much larger for the same music. The compressed .mxl version of MusicXML closes most of that gap.