Compare two MIDI files
Open an original and an edited MIDI file to see what changed: notes added, removed or moved, lengths and velocities, and differences in tempo, time and key signatures, instruments and controllers. Both files are read on your device and never uploaded.
Compare
No file yet
No file yet
Choose two MIDI files to compare.
Result
| What | File A | File B |
|---|
| Change | Channel | Note | In A | In B | Details |
|---|
| Channel | Controller | Count in A | Count in B |
|---|
How the comparison works
Both files are parsed into notes with start times and lengths. Each note in file A is then paired with the nearest note of the same channel and key in file B, within one beat (or half a second). Paired notes are compared:
- Moved: the start differs by more than the tolerance.
- Length: the note is held longer or shorter.
- Velocity: it is played louder or softer.
Notes left without a partner are removed (only in A) or added (only in B). A note moved by more than the window shows up as one removed and one added note. A note moved to another channel or key does too, because it is a different note to a synth.
Beats or seconds?
By default, positions are compared in beats. Re-saving a file at another resolution (480 vs 960 PPQ) or changing its tempo then does not mark every note as moved: the notes are still on the same beats, and the tempo change is listed once, under header and tempo differences. Choose seconds to compare what you actually hear, for example when checking a file against an audio recording. Files with SMPTE time have no beats, so they are always compared in seconds.
The tolerance absorbs tiny timing differences, such as a note nudged by a few ticks while editing. Choose Exact to report every difference, however small, or Loose to ignore anything under a 32nd note.
What else is compared
- Format, number of tracks, time division, track names and length.
- Every tempo, time signature and key signature, with its position.
- Program changes per channel, with General MIDI instrument names.
- How many messages each controller sends per channel (for example sustain pedal CC 64 or volume CC 7), pitch bend and System Exclusive.
The sample pair
compare-original.mid and compare-edited.mid differ in exactly these ways: the tempo goes from 120 to 126 BPM; E4 is played softer; F4 starts an eighth note later; A4 is removed; D5 is added at the end; the last bass note is shortened; the bass instrument changes from program 32 to 33; and a sustain pedal press is added. Use them to check this tool, or your own diff code. Both are described on the MIDI test files page.
When to use it
- Check what an export, import or conversion changed, for example after a round trip through a DAW or notation program.
- Review edits before replacing a file.
- Test your own MIDI writer against a known-good file.
- Compare two arrangements or takes of the same part.
To look inside one file, use the MIDI file analyzer; to hear either one, the MIDI player. The comparison code is the tested module compare-core.mjs.