MusicXML measure duration checker
When a MusicXML file imports with extra rests, notes pushed into the next bar or measures marked as too long, the cause is usually a measure whose durations do not add up to its time signature. Open the file here to find every such measure. The checker reports the part, the measure and the voice, what length the time signature expects, what the file contains, and how far over or under it is. It only reads the file: nothing is changed and nothing is uploaded.
Checker
Or drag a file onto this box, or try a sample:
Result
| Status | Part | Measure | Voice | Expected | Found | Difference | Details |
|---|
How the checker measures a bar
MusicXML gives each note a <duration> in divisions, the number of units per quarter note set in <attributes>. The checker reads each measure the way notation programs do, with a cursor that starts at the barline:
- Each note or rest moves the cursor forward by its duration. A note with
<chord/>starts with the previous note and does not move it. - Grace notes take no time.
<backup>moves the cursor back, so a second voice or a second staff can start again from the barline;<forward>moves it ahead without a rest.- The measure’s length is the furthest point the cursor reaches. It is compared with the current time signature: 4/4 is 4 quarter notes, 6/8 is 3, and compound signatures such as 3+2/8 are added up.
All arithmetic uses exact fractions, so triplets and unusual divisions never cause rounding errors. Lengths are reported in quarter notes, and differences also as note values, such as “an eighth note too long”.
Reading the results
- Error: too long. The notes in the measure add up to more than the time signature allows. Notation programs either stretch the bar or move the extra notes into the next one, which shifts everything after it. Look at the last note listed for the measure; a wrong
<duration>or a missing<chord/>is the usual cause. - Check: too short. The measure holds less than its time signature. Programs fill the gap with rests. That is wrong in the middle of a piece, but normal for a pickup (anacrusis) and for the last bar that completes it.
- Check: a voice stops early. One voice ends before the others. Many programs show the gap as an extra or invisible rest; if the voice should continue, a note or rest is missing.
- OK: pickup measure. A short first measure marked
implicit="yes"is a correctly written pickup. If your pickup is not marked, the checker suggests adding it.
Measure numbers are the ones written in the file. When a file numbers measures unusually (for example two measures called 1), the table also gives the measure’s position in the part.
Sample files
- measure-check-pickup.musicxml: A 3/4 melody that starts with a one-beat pickup marked implicit="yes", followed by two full measures. The checker reports the pickup as allowed and finds no problems.
- measure-check-two-voices.musicxml: A piano measure with two voices on the upper staff and one on the lower staff, joined by <backup>, with a chord, a grace note and a <forward>. Every voice fills 4/4, so the checker finds no problems.
- measure-check-wrong-length.musicxml: Flute measure 2 has an extra eighth note (4½ beats in 4/4) and cello measure 3 is a quarter note short (a dotted half in 4/4). The checker reports both, with the part, the measure and the exact difference.
- measure-check-malformed.musicxml: A <note> element is opened but never closed, so the file is not well-formed XML. The checker stops and gives the line where the problem shows up.
What it does not check
This is a timing check, not a full validation. It does not compare the file with the MusicXML schema, check pitches, beams or ties, or follow repeats. It reads uncompressed partwise files; a compressed .mxl file has to be exported uncompressed first. Measures in unmetered (senza-misura) time are listed but not measured. To learn the elements involved, see divisions and duration math and voices with backup and forward in MusicXML basics. To hear a file, convert it with the MusicXML to MIDI converter. The checking code is the tested module measure-check-core.mjs.