Comparing MNX and MusicXML | MNX specification

# Comparing MNX and MusicXML

On this page, you’ll find several examples of documents encoded both in MNX and MusicXML. The goal is to give you a sense of the differences, especially if you’re already familiar with MusicXML.

## “Hello world”

### MusicXML

<score-partwise version="3.1"> <part-list> <score-part id="P1"> <part-name>Music</part-name> </score-part> </part-list> <part id="P1"> <measure number="1"> <attributes> <divisions>1</divisions> <key> <fifths>0</fifths> </key> <time> <beats>4</beats> <beat-type>4</beat-type> </time> <clef> <sign>G</sign> <line>2</line> </clef> </attributes> <note> <pitch> <step>C</step> <octave>4</octave> </pitch> <duration>4</duration> <type>whole</type> </note> </measure> </part> </score-partwise>

### MNX

{ "mnx": { "version": 1 }, "global": { "measures": [ { "barline": { "type": "regular" }, "time": { "count": 4, "unit": 4 } } ] }, "parts": [ { "measures": [ { "clefs": [ { "clef": { "sign": "G", "staffPosition": -2 } } ], "sequences": [ { "content": [ { "duration": { "base": "whole" }, "notes": [ { "pitch": { "octave": 4, "step": "C" } } ] } ] } ] } ] } ] }

## Two-bar C major scale

### MusicXML

<score-partwise version="3.1"> <part-list> <score-part id="P1"> <part-name>Music</part-name> </score-part> </part-list> <part id="P1"> <measure number="1"> <attributes> <divisions>1</divisions> <key> <fifths>0</fifths> </key> <time> <beats>4</beats> <beat-type>4</beat-type> </time> <clef> <sign>G</sign> <line>2</line> </clef> </attributes> <note> <pitch> <step>C</step> <octave>4</octave> </pitch> <duration>1</duration> <type>quarter</type> </note> <note> <pitch> <step>D</step> <octave>4</octave> </pitch> <duration>1</duration> <type>quarter</type> </note> <note> <pitch> <step>E</step> <octave>4</octave> </pitch> <duration>1</duration> <type>quarter</type> </note> <note> <pitch> <step>F</step> <octave>4</octave> </pitch> <duration>1</duration> <type>quarter</type> </note> </measure> <measure number="2"> <note> <pitch> <step>G</step> <octave>4</octave> </pitch> <duration>1</duration> <type>quarter</type> </note> <note> <pitch> <step>A</step> <octave>4</octave> </pitch> <duration>1</duration> <type>quarter</type> </note> <note> <pitch> <step>B</step> <octave>4</octave> </pitch> <duration>1</duration> <type>quarter</type> </note> <note> <pitch> <step>C</step> <octave>5</octave> </pitch> <duration>1</duration> <type>quarter</type> </note> </measure> </part> </score-partwise>

### MNX

{ "mnx": { "version": 1 }, "global": { "measures": [ { "time": { "count": 4, "unit": 4 } }, { "barline": { "type": "regular" } } ] }, "parts": [ { "measures": [ { "clefs": [ { "clef": { "sign": "G", "staffPosition": -2 } } ], "sequences": [ { "content": [ { "duration": { "base": "quarter" }, "notes": [ { "pitch": { "octave": 4, "step": "C" } } ] }, { "duration": { "base": "quarter" }, "notes": [ { "pitch": { "octave": 4, "step": "D" } } ] }, { "duration": { "base": "quarter" }, "notes": [ { "pitch": { "octave": 4, "step": "E" } } ] }, { "duration": { "base": "quarter" }, "notes": [ { "pitch": { "octave": 4, "step": "F" } } ] } ] } ] }, { "sequences": [ { "content": [ { "duration": { "base": "quarter" }, "notes": [ { "pitch": { "octave": 4, "step": "G" } } ] }, { "duration": { "base": "quarter" }, "notes": [ { "pitch": { "octave": 4, "step": "A" } } ] }, { "duration": { "base": "quarter" }, "notes": [ { "pitch": { "octave": 4, "step": "B" } } ] }, { "duration": { "base": "quarter" }, "notes": [ { "pitch": { "octave": 5, "step": "C" } } ] } ] } ] } ] } ] }

## Three-note chord and half rest

In MusicXML, notes within chords contain `<chord/>` (except for the first note in the chord). In MNX, notes within chords are contained within a single "event".

### MusicXML

<score-partwise version="3.1"> <part-list> <score-part id="P1"> <part-name>Music</part-name> </score-part> </part-list> <part id="P1"> <measure number="1"> <attributes> <divisions>1</divisions> <key> <fifths>0</fifths> </key> <time> <beats>4</beats> <beat-type>4</beat-type> </time> <clef> <sign>G</sign> <line>2</line> </clef> </attributes>
<note> <pitch> <step>C</step> <octave>4</octave> </pitch> <duration>2</duration> <type>half</type> </note> <note> <chord></chord> <pitch> <step>E</step> <octave>4</octave> </pitch> <duration>2</duration> <type>half</type> </note> <note> <chord></chord> <pitch> <step>G</step> <octave>4</octave> </pitch> <duration>2</duration> <type>half</type> </note> <note> <rest></rest> <duration>2</duration> <type>half</type> </note>
</measure> </part> </score-partwise>

### MNX

{ "mnx": { "version": 1 }, "global": { "measures": [ { "barline": { "type": "regular" }, "time": { "count": 4, "unit": 4 } } ] }, "parts": [ { "measures": [ { "clefs": [ { "clef": { "sign": "G", "staffPosition": -2 } } ], "sequences": [ { "content": [ { "duration": { "base": "half" }, "notes": [ { "pitch": { "octave": 4, "step": "C" } }, { "pitch": { "octave": 4, "step": "E" } }, { "pitch": { "octave": 4, "step": "G" } } ] }, { "duration": { "base": "half" }, "rest": {} } ] } ] } ] } ] }

## Time signatures

In MusicXML, each part’s `<measure>` can contain an `<attributes>` element with an optional `<time>`. MNX uses a score-wide `"global"` object. In both cases, you only specify the time signature when it differs from the previous bar.

### MusicXML

<score-partwise version="3.1"> <part-list> <score-part id="P1"> <part-name>Music</part-name> </score-part> </part-list> <part id="P1"> <measure number="1">
<attributes> <divisions>256</divisions> <key> <fifths>0</fifths> </key> <time> <beats>4</beats> <beat-type>4</beat-type> </time> <clef> <sign>G</sign> <line>2</line> </clef> </attributes>
<note> <pitch> <step>C</step> <octave>5</octave> </pitch> <duration>256</duration> <type>quarter</type> </note> <note> <pitch> <step>D</step> <octave>5</octave> </pitch> <duration>256</duration> <type>quarter</type> </note> <note> <pitch> <step>E</step> <octave>5</octave> </pitch> <duration>256</duration> <type>quarter</type> </note> <note> <pitch> <step>F</step> <octave>5</octave> </pitch> <duration>256</duration> <type>quarter</type> </note> </measure> <measure number="2"> <note> <pitch> <step>C</step> <octave>5</octave> </pitch> <duration>256</duration> <type>quarter</type> </note> <note> <pitch> <step>D</step> <octave>5</octave> </pitch> <duration>256</duration> <type>quarter</type> </note> <note> <pitch> <step>E</step> <octave>5</octave> </pitch> <duration>256</duration> <type>quarter</type> </note> <note> <pitch> <step>F</step> <octave>5</octave> </pitch> <duration>256</duration> <type>quarter</type> </note> </measure> <measure number="3">
<attributes> <time> <beats>2</beats> <beat-type>4</beat-type> </time> </attributes>
<note> <pitch> <step>B</step> <octave>4</octave> </pitch> <duration>256</duration> <type>quarter</type> </note> <note> <pitch> <step>D</step> <octave>5</octave> </pitch> <duration>256</duration> <type>quarter</type> </note> </measure> </part> </score-partwise>

### MNX

{ "mnx": { "version": 1 }, "global": { "measures": [ { "time": { "count": 4, "unit": 4 } }, {}, { "time": { "count": 2, "unit": 4 } } ] }, "parts": [ { "measures": [ { "clefs": [ { "clef": { "sign": "G", "staffPosition": -2 } } ], "sequences": [ { "content": [ { "duration": { "base": "quarter" }, "notes": [ { "pitch": { "octave": 5, "step": "C" } } ] }, { "duration": { "base": "quarter" }, "notes": [ { "pitch": { "octave": 5, "step": "D" } } ] }, { "duration": { "base": "quarter" }, "notes": [ { "pitch": { "octave": 5, "step": "E" } } ] }, { "duration": { "base": "quarter" }, "notes": [ { "pitch": { "octave": 5, "step": "F" } } ] } ] } ] }, { "sequences": [ { "content": [ { "duration": { "base": "quarter" }, "notes": [ { "pitch": { "octave": 5, "step": "C" } } ] }, { "duration": { "base": "quarter" }, "notes": [ { "pitch": { "octave": 5, "step": "D" } } ] }, { "duration": { "base": "quarter" }, "notes": [ { "pitch": { "octave": 5, "step": "E" } } ] }, { "duration": { "base": "quarter" }, "notes": [ { "pitch": { "octave": 5, "step": "F" } } ] } ] } ] }, { "sequences": [ { "content": [ { "duration": { "base": "quarter" }, "notes": [ { "pitch": { "octave": 4, "step": "B" } } ] }, { "duration": { "base": "quarter" }, "notes": [ { "pitch": { "octave": 5, "step": "D" } } ] } ] } ] } ] } ] }

## Key signatures

In MusicXML, each part’s `<measure>` can contain an `<attributes>` element with an optional `<key>`. MNX uses a score-wide `"global"` object. In both cases, you only specify the key signature when it differs from the previous bar.

### MusicXML

<score-partwise version="3.1"> <part-list> <score-part id="P1"> <part-name>Music</part-name> </score-part> </part-list> <part id="P1"> <measure number="1"> <attributes> <divisions>256</divisions>
<key> <fifths>4</fifths> </key>
<time> <beats>4</beats> <beat-type>4</beat-type> </time> <clef> <sign>G</sign> <line>2</line> </clef> </attributes> <note> <pitch> <step>E</step> <octave>5</octave> </pitch> <duration>256</duration> <type>quarter</type> </note> <note> <pitch> <step>F</step> <alter>1</alter> <octave>5</octave> </pitch> <duration>256</duration> <type>quarter</type> </note> <note> <pitch> <step>G</step> <alter>1</alter> <octave>5</octave> </pitch> <duration>256</duration> <type>quarter</type> </note> <note> <pitch> <step>E</step> <octave>5</octave> </pitch> <duration>256</duration> <type>quarter</type> </note> </measure> <measure number="2"> <note> <pitch> <step>G</step> <alter>1</alter> <octave>5</octave> </pitch> <duration>1024</duration> <type>whole</type> </note> </measure> <measure number="3"> <attributes>
<key> <fifths>-4</fifths> </key>
</attributes> <note> <pitch> <step>A</step> <alter>-1</alter> <octave>4</octave> </pitch> <duration>256</duration> <type>quarter</type> </note> <note> <pitch> <step>B</step> <alter>-1</alter> <octave>4</octave> </pitch> <duration>256</duration> <type>quarter</type> </note> <note> <pitch> <step>C</step> <octave>5</octave> </pitch> <duration>256</duration> <type>quarter</type> </note> <note> <pitch> <step>A</step> <alter>-1</alter> <octave>4</octave> </pitch> <duration>256</duration> <type>quarter</type> </note> </measure> <measure number="4"> <note> <pitch> <step>C</step> <octave>5</octave> </pitch> <duration>1024</duration> <type>whole</type> </note> </measure> </part> </score-partwise>

### MNX

{ "mnx": { "version": 1 }, "global": { "measures": [ { "key": { "fifths": 4 }, "time": { "count": 4, "unit": 4 } }, {}, { "key": { "fifths": -4 } }, {} ] }, "parts": [ { "measures": [ { "clefs": [ { "clef": { "sign": "G", "staffPosition": -2 } } ], "sequences": [ { "content": [ { "duration": { "base": "quarter" }, "notes": [ { "pitch": { "octave": 5, "step": "E" } } ] }, { "duration": { "base": "quarter" }, "notes": [ { "pitch": { "alter": 1, "octave": 5, "step": "F" } } ] }, { "duration": { "base": "quarter" }, "notes": [ { "pitch": { "alter": 1, "octave": 5, "step": "G" } } ] }, { "duration": { "base": "quarter" }, "notes": [ { "pitch": { "octave": 5, "step": "E" } } ] } ] } ] }, { "sequences": [ { "content": [ { "duration": { "base": "whole" }, "notes": [ { "pitch": { "alter": 1, "octave": 5, "step": "G" } } ] } ] } ] }, { "sequences": [ { "content": [ { "duration": { "base": "quarter" }, "notes": [ { "pitch": { "alter": -1, "octave": 4, "step": "A" } } ] }, { "duration": { "base": "quarter" }, "notes": [ { "pitch": { "alter": -1, "octave": 4, "step": "B" } } ] }, { "duration": { "base": "quarter" }, "notes": [ { "pitch": { "octave": 5, "step": "C" } } ] }, { "duration": { "base": "quarter" }, "notes": [ { "pitch": { "alter": -1, "octave": 4, "step": "A" } } ] } ] } ] }, { "sequences": [ { "content": [ { "duration": { "base": "whole" }, "notes": [ { "pitch": { "octave": 5, "step": "C" } } ] } ] } ] } ] } ] }

## Accidentals

In MusicXML, use `<accidental>` within a `<note>` to indicate a rendered accidental. In MNX, give the note an `"accidentalDisplay"` attribute.

In both MusicXML and MNX, accidentals are only encoded if they are to be rendered. Notes whose accidental is implied from the key signature (such as the Bb note in bar 2 of this example), or notes repeating a currently active accidental (such as the second Db in bar 2), are not encoded as having an accidental.

Cautionary accidentals, such as the D natural in bar 3 of this example — that is, accidentals that are not technically required to be displayed and serve as a courtesy to the musician — are not treated any differently than “non-cautionary” accidentals.

### MusicXML

<score-partwise version="3.1"> <part-list> <score-part id="P1"> <part-name>Music</part-name> </score-part> </part-list> <part id="P1"> <measure number="1"> <attributes> <divisions>256</divisions> <key> <fifths>-2</fifths> <mode>major</mode> </key> <time> <beats>4</beats> <beat-type>4</beat-type> </time> <clef> <sign>G</sign> <line>2</line> </clef> </attributes> <note> <pitch> <step>F</step> <octave>4</octave> </pitch> <duration>256</duration> <type>quarter</type> </note> <note> <pitch> <step>G</step> <octave>4</octave> </pitch> <duration>256</duration> <type>quarter</type> </note> <note> <pitch> <step>G</step> <alter>1</alter> <octave>4</octave> </pitch> <duration>256</duration> <type>quarter</type>
<accidental>sharp</accidental>
</note> <note> <pitch> <step>A</step> <octave>4</octave> </pitch> <duration>256</duration> <type>quarter</type> </note> </measure> <measure number="2"> <note> <pitch> <step>B</step> <alter>-1</alter> <octave>4</octave> </pitch> <duration>512</duration> <type>half</type> </note> <note> <pitch> <step>D</step> <alter>-1</alter> <octave>5</octave> </pitch> <duration>256</duration> <type>quarter</type>
<accidental>flat</accidental>
</note> <note> <pitch> <step>D</step> <alter>-1</alter> <octave>5</octave> </pitch> <duration>256</duration> <type>quarter</type> </note> </measure> <measure number="3"> <note> <pitch> <step>D</step> <octave>5</octave> </pitch> <duration>1024</duration> <type>whole</type>
<accidental>natural</accidental>
</note> </measure> </part> </score-partwise>

### MNX

{ "mnx": { "support": { "useAccidentalDisplay": true }, "version": 1 }, "global": { "measures": [ { "key": { "fifths": -2 }, "time": { "count": 4, "unit": 4 } }, {}, {} ] }, "parts": [ { "measures": [ { "clefs": [ { "clef": { "sign": "G", "staffPosition": -2 } } ], "sequences": [ { "content": [ { "duration": { "base": "quarter" }, "notes": [ { "pitch": { "octave": 4, "step": "F" } } ] }, { "duration": { "base": "quarter" }, "notes": [ { "pitch": { "octave": 4, "step": "G" } } ] }, { "duration": { "base": "quarter" }, "notes": [ { "accidentalDisplay": { "show": true }, "pitch": { "alter": 1, "octave": 4, "step": "G" } } ] }, { "duration": { "base": "quarter" }, "notes": [ { "pitch": { "octave": 4, "step": "A" } } ] } ] } ] }, { "sequences": [ { "content": [ { "duration": { "base": "half" }, "notes": [ { "pitch": { "alter": -1, "octave": 4, "step": "B" } } ] }, { "duration": { "base": "quarter" }, "notes": [ { "accidentalDisplay": { "show": true }, "pitch": { "alter": -1, "octave": 5, "step": "D" } } ] }, { "duration": { "base": "quarter" }, "notes": [ { "_c": "This note doesn't use accidentalDisplay.", "pitch": { "alter": -1, "octave": 5, "step": "D" } } ] } ] } ] }, { "sequences": [ { "content": [ { "duration": { "base": "whole" }, "notes": [ { "accidentalDisplay": { "show": true }, "pitch": { "octave": 5, "step": "D" } } ] } ] } ] } ] } ] }

## Dotted notes (augmentation dots)

In MusicXML, dotted notes get an extra tag, `<dot>`, within the `<note>` element. Each note within a chord must have `<dot>`.

In MNX, dotted notes are represented with `"dots"` within the event's `"duration"`.

### MusicXML

<score-partwise version="3.1"> <part-list> <score-part id="P1"> <part-name>Music</part-name> </score-part> </part-list> <part id="P1"> <measure number="1"> <attributes> <divisions>256</divisions> <key> <fifths>0</fifths> </key> <time> <beats>4</beats> <beat-type>4</beat-type> </time> <clef> <sign>G</sign> <line>2</line> </clef> </attributes> <note> <pitch> <step>G</step> <octave>4</octave> </pitch> <duration>384</duration>
<type>quarter</type> <dot></dot>
</note> <note> <chord></chord> <pitch> <step>C</step> <octave>5</octave> </pitch> <duration>384</duration>
<type>quarter</type> <dot></dot>
</note> <note> <pitch> <step>E</step> <octave>5</octave> </pitch> <duration>128</duration> <type>eighth</type> </note> <note> <pitch> <step>F</step> <octave>4</octave> </pitch> <duration>384</duration>
<type>quarter</type> <dot></dot>
</note> <note> <chord></chord> <pitch> <step>D</step> <octave>5</octave> </pitch> <duration>384</duration>
<type>quarter</type> <dot></dot>
</note> <note> <pitch> <step>F</step> <octave>5</octave> </pitch> <duration>128</duration> <type>eighth</type> </note> </measure> </part> </score-partwise>

### MNX

{ "mnx": { "version": 1 }, "global": { "measures": [ { "time": { "count": 4, "unit": 4 } } ] }, "parts": [ { "measures": [ { "clefs": [ { "clef": { "sign": "G", "staffPosition": -2 } } ], "sequences": [ { "content": [ { "duration": { "base": "quarter", "dots": 1 }, "notes": [ { "pitch": { "octave": 4, "step": "G" } }, { "pitch": { "octave": 5, "step": "C" } } ] }, { "duration": { "base": "eighth" }, "notes": [ { "pitch": { "octave": 5, "step": "E" } } ] }, { "duration": { "base": "quarter", "dots": 1 }, "notes": [ { "pitch": { "octave": 4, "step": "F" } }, { "pitch": { "octave": 5, "step": "D" } } ] }, { "duration": { "base": "eighth" }, "notes": [ { "pitch": { "octave": 5, "step": "F" } } ] } ] } ] } ] } ] }

## Ties

MusicXML uses two elements: `<tie>` to describe the sound and `<tied>` to indicate a visual tie in notation. The first note gets `type="start"`, the second gets `type="stop"`.

MNX uses a single object: `"ties"`. Only the first note in a tie encodes this; its `"target"` points at the `id` of the end note.

For a series of notes tied together (e.g., the second tie in the above example), both MusicXML and MNX require you to encode each “inner tie” separately.

### MusicXML

<score-partwise version="3.1"> <part-list> <score-part id="P1"> <part-name>Music</part-name> </score-part> </part-list> <part id="P1"> <measure number="1"> <attributes> <divisions>256</divisions> <key> <fifths>0</fifths> </key> <time> <beats>4</beats> <beat-type>4</beat-type> </time> <clef> <sign>G</sign> <line>2</line> </clef> </attributes> <note> <pitch> <step>C</step> <octave>5</octave> </pitch> <duration>256</duration> <type>quarter</type> </note> <note> <pitch> <step>E</step> <octave>5</octave> </pitch> <duration>256</duration>
<tie type="start"></tie>
<type>quarter</type>
<notations> <tied type="start"></tied> </notations>
</note> <note> <pitch> <step>E</step> <octave>5</octave> </pitch> <duration>256</duration>
<tie type="stop"></tie>
<type>quarter</type>
<notations> <tied type="stop"></tied> </notations>
</note> <note> <pitch> <step>C</step> <octave>5</octave> </pitch> <duration>256</duration>
<tie type="start"></tie>
<type>quarter</type>
<notations> <tied type="start"></tied> </notations>
</note> </measure> <measure number="2"> <note> <pitch> <step>C</step> <octave>5</octave> </pitch> <duration>512</duration>
<tie type="stop"></tie> <tie type="start"></tie>
<type>half</type>
<notations> <tied type="start"></tied> <tied type="stop"></tied> </notations>
</note> <note> <pitch> <step>C</step> <octave>5</octave> </pitch> <duration>512</duration>
<tie type="stop"></tie>
<type>half</type>
<notations> <tied type="stop"></tied> </notations>
</note> </measure> </part> </score-partwise>

### MNX

{ "mnx": { "version": 1 }, "global": { "measures": [ { "time": { "count": 4, "unit": 4 } }, {} ] }, "parts": [ { "measures": [ { "clefs": [ { "clef": { "sign": "G", "staffPosition": -2 } } ], "sequences": [ { "content": [ { "duration": { "base": "quarter" }, "notes": [ { "pitch": { "octave": 5, "step": "C" } } ] }, { "duration": { "base": "quarter" }, "notes": [ { "pitch": { "octave": 5, "step": "E" }, "ties": [ { "target": "note3" } ] } ] }, { "duration": { "base": "quarter" }, "notes": [ { "id": "note3", "pitch": { "octave": 5, "step": "E" } } ] }, { "duration": { "base": "quarter" }, "notes": [ { "pitch": { "octave": 5, "step": "C" }, "ties": [ { "target": "note5" } ] } ] } ] } ] }, { "sequences": [ { "content": [ { "duration": { "base": "half" }, "notes": [ { "id": "note5", "pitch": { "octave": 5, "step": "C" }, "ties": [ { "target": "note6" } ] } ] }, { "duration": { "base": "half" }, "notes": [ { "id": "note6", "pitch": { "octave": 5, "step": "C" } } ] } ] } ] } ] } ] }

## Beams

In MusicXML, you put one or more `<beam>` elements within a `<note>` element — a separate element for each beam. The `number` attribute specifies whether it’s the outer (eighth-note) beam, versus an inner (e.g., 16th note) beam. Parsers need to keep track of currently open beams and look for the values `continue` or `end`.

In MNX, each beam is encoded within the measure's `"beams"` object, containing the IDs of the beam’s events.

### MusicXML

<score-partwise version="3.1"> <part-list> <score-part id="P1"> <part-name>Music</part-name> </score-part> </part-list> <part id="P1"> <measure number="1"> <attributes> <divisions>256</divisions> <key> <fifths>0</fifths> <mode>major</mode> </key> <time> <beats>4</beats> <beat-type>4</beat-type> </time> <clef> <sign>G</sign> <line>2</line> </clef> </attributes> <note> <pitch> <step>C</step> <octave>5</octave> </pitch> <duration>128</duration> <type>eighth</type>
<beam number="1">begin</beam>
</note> <note> <pitch> <step>D</step> <octave>5</octave> </pitch> <duration>128</duration> <type>eighth</type>
<beam number="1">continue</beam>
</note> <note> <pitch> <step>E</step> <octave>5</octave> </pitch> <duration>128</duration> <type>eighth</type>
<beam number="1">continue</beam>
</note> <note> <pitch> <step>F</step> <octave>5</octave> </pitch> <duration>128</duration> <type>eighth</type>
<beam number="1">end</beam>
</note> <note> <pitch> <step>D</step> <octave>4</octave> </pitch> <duration>128</duration> <type>eighth</type>
<beam number="1">begin</beam>
</note> <note> <pitch> <step>E</step> <octave>4</octave> </pitch> <duration>128</duration> <type>eighth</type>
<beam number="1">continue</beam>
</note> <note> <pitch> <step>F</step> <octave>4</octave> </pitch> <duration>128</duration> <type>eighth</type>
<beam number="1">continue</beam>
</note> <note> <pitch> <step>G</step> <octave>4</octave> </pitch> <duration>128</duration> <type>eighth</type>
<beam number="1">end</beam>
</note> </measure> <measure number="2"> <note> <pitch> <step>G</step> <octave>4</octave> </pitch> <duration>128</duration> <type>eighth</type>
<beam number="1">begin</beam>
</note> <note> <rest></rest> <duration>128</duration> <type>eighth</type>
<beam number="1">continue</beam>
</note> <note> <pitch> <step>D</step> <octave>4</octave> </pitch> <duration>64</duration> <type>16th</type>
<beam number="1">continue</beam> <beam number="2">begin</beam>
</note> <note> <pitch> <step>E</step> <octave>4</octave> </pitch> <duration>64</duration> <type>16th</type>
<beam number="1">continue</beam> <beam number="2">end</beam>
</note> <note> <pitch> <step>G</step> <octave>4</octave> </pitch> <duration>128</duration> <type>eighth</type>
<beam number="1">end</beam>
</note> <note> <pitch> <step>E</step> <octave>4</octave> </pitch> <duration>128</duration> <type>eighth</type>
<beam number="1">begin</beam>
</note> <note> <pitch> <step>D</step> <octave>4</octave> </pitch> <duration>128</duration> <type>eighth</type>
<beam number="1">end</beam>
</note> <note> <pitch> <step>C</step> <octave>4</octave> </pitch> <duration>256</duration> <type>quarter</type> </note> </measure> </part> </score-partwise>

### MNX

{ "mnx": { "support": { "useBeams": true }, "version": 1 }, "global": { "measures": [ { "time": { "count": 4, "unit": 4 } }, {} ] }, "parts": [ { "measures": [ { "beams": [ { "events": [ "ev1", "ev2", "ev3", "ev4" ] }, { "events": [ "ev5", "ev6", "ev7", "ev8" ] } ], "clefs": [ { "clef": { "sign": "G", "staffPosition": -2 } } ], "sequences": [ { "content": [ { "id": "ev1", "duration": { "base": "eighth" }, "notes": [ { "pitch": { "octave": 5, "step": "C" } } ] }, { "id": "ev2", "duration": { "base": "eighth" }, "notes": [ { "pitch": { "octave": 5, "step": "D" } } ] }, { "id": "ev3", "duration": { "base": "eighth" }, "notes": [ { "pitch": { "octave": 5, "step": "E" } } ] }, { "id": "ev4", "duration": { "base": "eighth" }, "notes": [ { "pitch": { "octave": 5, "step": "F" } } ] }, { "id": "ev5", "duration": { "base": "eighth" }, "notes": [ { "pitch": { "octave": 4, "step": "D" } } ] }, { "id": "ev6", "duration": { "base": "eighth" }, "notes": [ { "pitch": { "octave": 4, "step": "E" } } ] }, { "id": "ev7", "duration": { "base": "eighth" }, "notes": [ { "pitch": { "octave": 4, "step": "F" } } ] }, { "id": "ev8", "duration": { "base": "eighth" }, "notes": [ { "pitch": { "octave": 4, "step": "G" } } ] } ] } ] }, { "beams": [ { "beams": [ { "events": [ "ev11", "ev12" ] } ], "events": [ "ev9", "ev10", "ev11", "ev12", "ev13" ] }, { "events": [ "ev14", "ev15" ] } ], "sequences": [ { "content": [ { "id": "ev9", "duration": { "base": "eighth" }, "notes": [ { "pitch": { "octave": 4, "step": "G" } } ] }, { "id": "ev10", "duration": { "base": "eighth" }, "rest": {} }, { "id": "ev11", "duration": { "base": "16th" }, "notes": [ { "pitch": { "octave": 4, "step": "D" } } ] }, { "id": "ev12", "duration": { "base": "16th" }, "notes": [ { "pitch": { "octave": 4, "step": "E" } } ] }, { "id": "ev13", "duration": { "base": "eighth" }, "notes": [ { "pitch": { "octave": 4, "step": "G" } } ] }, { "id": "ev14", "duration": { "base": "eighth" }, "notes": [ { "pitch": { "octave": 4, "step": "E" } } ] }, { "id": "ev15", "duration": { "base": "eighth" }, "notes": [ { "pitch": { "octave": 4, "step": "D" } } ] }, { "duration": { "base": "quarter" }, "notes": [ { "pitch": { "octave": 4, "step": "C" } } ] } ] } ] } ] } ] }

## Beams (secondary beam breaks)

In MusicXML, secondary beams are encoded with separate `<beam>` elements within `<note>` — each with a separate `number` attribute.

In MNX, secondary beams are encoded as separate objects within `"beams"`, using the `"inner"` attribute.

### MusicXML

<score-partwise version="3.1"> <part-list> <score-part id="P1"> <part-name>Music</part-name> </score-part> </part-list> <part id="P1"> <measure number="1"> <attributes> <divisions>8</divisions> <key> <fifths>0</fifths> </key> <time> <beats>4</beats> <beat-type>4</beat-type> </time> <clef> <sign>G</sign> <line>2</line> </clef> </attributes> <note> <pitch> <step>C</step> <octave>5</octave> </pitch> <duration>1</duration> <type>32nd</type>
<beam number="1">begin</beam> <beam number="2">begin</beam> <beam number="3">begin</beam>
</note> <note> <pitch> <step>D</step> <octave>5</octave> </pitch> <duration>1</duration> <type>32nd</type>
<beam number="1">continue</beam> <beam number="2">continue</beam> <beam number="3">continue</beam>
</note> <note> <pitch> <step>E</step> <octave>5</octave> </pitch> <duration>1</duration> <type>32nd</type>
<beam number="1">continue</beam> <beam number="2">continue</beam> <beam number="3">continue</beam>
</note> <note> <pitch> <step>F</step> <octave>5</octave> </pitch> <duration>1</duration> <type>32nd</type>
<beam number="1">continue</beam> <beam number="2">end</beam> <beam number="3">end</beam>
</note> <note> <pitch> <step>C</step> <octave>5</octave> </pitch> <duration>1</duration> <type>32nd</type>
<beam number="1">continue</beam> <beam number="2">begin</beam> <beam number="3">begin</beam>
</note> <note> <pitch> <step>D</step> <octave>5</octave> </pitch> <duration>1</duration> <type>32nd</type>
<beam number="1">continue</beam> <beam number="2">continue</beam> <beam number="3">continue</beam>
</note> <note> <pitch> <step>E</step> <octave>5</octave> </pitch> <duration>1</duration> <type>32nd</type>
<beam number="1">continue</beam> <beam number="2">continue</beam> <beam number="3">continue</beam>
</note> <note> <pitch> <step>F</step> <octave>5</octave> </pitch> <duration>1</duration> <type>32nd</type>
<beam number="1">end</beam> <beam number="2">end</beam> <beam number="3">end</beam>
</note> <note> <pitch> <step>C</step> <octave>5</octave> </pitch> <duration>1</duration> <type>32nd</type>
<beam number="1">begin</beam> <beam number="2">begin</beam> <beam number="3">begin</beam>
</note> <note> <pitch> <step>D</step> <octave>5</octave> </pitch> <duration>1</duration> <type>32nd</type>
<beam number="1">continue</beam> <beam number="2">continue</beam> <beam number="3">end</beam>
</note> <note> <pitch> <step>E</step> <octave>5</octave> </pitch> <duration>1</duration> <type>32nd</type>
<beam number="1">continue</beam> <beam number="2">continue</beam> <beam number="3">begin</beam>
</note> <note> <pitch> <step>F</step> <octave>5</octave> </pitch> <duration>1</duration> <type>32nd</type>
<beam number="1">continue</beam> <beam number="2">end</beam> <beam number="3">end</beam>
</note> <note> <pitch> <step>C</step> <octave>5</octave> </pitch> <duration>1</duration> <type>32nd</type>
<beam number="1">continue</beam> <beam number="2">begin</beam> <beam number="3">begin</beam>
</note> <note> <pitch> <step>D</step> <octave>5</octave> </pitch> <duration>1</duration> <type>32nd</type>
<beam number="1">continue</beam> <beam number="2">continue</beam> <beam number="3">end</beam>
</note> <note> <pitch> <step>E</step> <octave>5</octave> </pitch> <duration>1</duration> <type>32nd</type>
<beam number="1">continue</beam> <beam number="2">continue</beam> <beam number="3">begin</beam>
</note> <note> <pitch> <step>F</step> <octave>5</octave> </pitch> <duration>1</duration> <type>32nd</type>
<beam number="1">end</beam> <beam number="2">end</beam> <beam number="3">end</beam>
</note> <note> <rest></rest> <duration>16</duration> <type>half</type> </note> <barline location="right"> <bar-style>light-heavy</bar-style> </barline> </measure> </part> </score-partwise>

### MNX

{ "mnx": { "support": { "useBeams": true }, "version": 1 }, "global": { "measures": [ { "time": { "count": 4, "unit": 4 } } ] }, "parts": [ { "measures": [ { "beams": [ { "beams": [ { "beams": [ { "events": [ "ev1", "ev2", "ev3", "ev4" ] } ], "events": [ "ev1", "ev2", "ev3", "ev4" ] }, { "beams": [ { "events": [ "ev5", "ev6", "ev7", "ev8" ] } ], "events": [ "ev5", "ev6", "ev7", "ev8" ] } ], "events": [ "ev1", "ev2", "ev3", "ev4", "ev5", "ev6", "ev7", "ev8" ] }, { "beams": [ { "beams": [ { "events": [ "ev9", "ev10" ] }, { "events": [ "ev11", "ev12" ] } ], "events": [ "ev9", "ev10", "ev11", "ev12" ] }, { "beams": [ { "events": [ "ev13", "ev14" ] }, { "events": [ "ev15", "ev16" ] } ], "events": [ "ev13", "ev14", "ev15", "ev16" ] } ], "events": [ "ev9", "ev10", "ev11", "ev12", "ev13", "ev14", "ev15", "ev16" ] } ], "clefs": [ { "clef": { "sign": "G", "staffPosition": -2 } } ], "sequences": [ { "content": [ { "id": "ev1", "duration": { "base": "32nd" }, "notes": [ { "pitch": { "octave": 5, "step": "C" } } ] }, { "id": "ev2", "duration": { "base": "32nd" }, "notes": [ { "pitch": { "octave": 5, "step": "D" } } ] }, { "id": "ev3", "duration": { "base": "32nd" }, "notes": [ { "pitch": { "octave": 5, "step": "E" } } ] }, { "id": "ev4", "duration": { "base": "32nd" }, "notes": [ { "pitch": { "octave": 5, "step": "F" } } ] }, { "id": "ev5", "duration": { "base": "32nd" }, "notes": [ { "pitch": { "octave": 5, "step": "C" } } ] }, { "id": "ev6", "duration": { "base": "32nd" }, "notes": [ { "pitch": { "octave": 5, "step": "D" } } ] }, { "id": "ev7", "duration": { "base": "32nd" }, "notes": [ { "pitch": { "octave": 5, "step": "E" } } ] }, { "id": "ev8", "duration": { "base": "32nd" }, "notes": [ { "pitch": { "octave": 5, "step": "F" } } ] }, { "id": "ev9", "duration": { "base": "32nd" }, "notes": [ { "pitch": { "octave": 5, "step": "C" } } ] }, { "id": "ev10", "duration": { "base": "32nd" }, "notes": [ { "pitch": { "octave": 5, "step": "D" } } ] }, { "id": "ev11", "duration": { "base": "32nd" }, "notes": [ { "pitch": { "octave": 5, "step": "E" } } ] }, { "id": "ev12", "duration": { "base": "32nd" }, "notes": [ { "pitch": { "octave": 5, "step": "F" } } ] }, { "id": "ev13", "duration": { "base": "32nd" }, "notes": [ { "pitch": { "octave": 5, "step": "C" } } ] }, { "id": "ev14", "duration": { "base": "32nd" }, "notes": [ { "pitch": { "octave": 5, "step": "D" } } ] }, { "id": "ev15", "duration": { "base": "32nd" }, "notes": [ { "pitch": { "octave": 5, "step": "E" } } ] }, { "id": "ev16", "duration": { "base": "32nd" }, "notes": [ { "pitch": { "octave": 5, "step": "F" } } ] }, { "duration": { "base": "half" }, "rest": {} } ] } ] } ] } ] }

## Beams (hooks)

MusicXML uses `<beam>` elements with the value `"forward hook"` or `"backward hook"`.

MNX uses an inner `"beams"` attribute on the outer beam, with an optional `"direction"` that specifies the direction of the hook.

### MusicXML

<score-partwise version="3.1"> <part-list> <score-part id="P1"> <part-name>Music</part-name> </score-part> </part-list> <part id="P1"> <measure number="1"> <attributes> <divisions>8</divisions> <key> <fifths>0</fifths> </key> <time> <beats>4</beats> <beat-type>4</beat-type> </time> <clef> <sign>G</sign> <line>2</line> </clef> </attributes> <note> <pitch> <step>C</step> <octave>5</octave> </pitch> <duration>2</duration> <type>16th</type>
<beam number="1">begin</beam> <beam number="2">forward hook</beam>
</note> <note> <pitch> <step>D</step> <octave>5</octave> </pitch> <duration>4</duration> <type>eighth</type>
<beam number="1">continue</beam>
</note> <note> <pitch> <step>C</step> <octave>5</octave> </pitch> <duration>2</duration> <type>16th</type>
<beam number="1">end</beam> <beam number="2">backward hook</beam>
</note> <note> <pitch> <step>E</step> <octave>5</octave> </pitch> <duration>2</duration> <type>16th</type>
<beam number="1">begin</beam> <beam number="2">forward hook</beam>
</note> <note> <pitch> <step>F</step> <octave>5</octave> </pitch> <duration>4</duration> <type>eighth</type>
<beam number="1">continue</beam>
</note> <note> <pitch> <step>E</step> <octave>5</octave> </pitch> <duration>2</duration> <type>16th</type>
<beam number="1">end</beam> <beam number="2">backward hook</beam>
</note> <note> <pitch> <step>G</step> <octave>5</octave> </pitch> <duration>2</duration> <type>16th</type>
<beam number="1">begin</beam> <beam number="2">forward hook</beam>
</note> <note> <pitch> <step>A</step> <octave>5</octave> </pitch> <duration>4</duration> <type>eighth</type>
<beam number="1">continue</beam>
</note> <note> <pitch> <step>G</step> <octave>5</octave> </pitch> <duration>2</duration> <type>16th</type>
<beam number="1">end</beam> <beam number="2">backward hook</beam>
</note> <note> <pitch> <step>C</step> <octave>6</octave> </pitch> <duration>8</duration> <type>quarter</type> </note> <barline location="right"> <bar-style>light-heavy</bar-style> </barline> </measure> </part> </score-partwise>

### MNX

{ "mnx": { "support": { "useBeams": true }, "version": 1 }, "global": { "measures": [ { "time": { "count": 4, "unit": 4 } } ] }, "parts": [ { "measures": [ { "beams": [ { "beams": [ { "direction": "right", "events": [ "ev1" ] }, { "direction": "left", "events": [ "ev3" ] } ], "events": [ "ev1", "ev2", "ev3" ] }, { "beams": [ { "direction": "right", "events": [ "ev4" ] }, { "direction": "left", "events": [ "ev6" ] } ], "events": [ "ev4", "ev5", "ev6" ] }, { "beams": [ { "direction": "right", "events": [ "ev7" ] }, { "direction": "left", "events": [ "ev9" ] } ], "events": [ "ev7", "ev8", "ev9" ] } ], "clefs": [ { "clef": { "sign": "G", "staffPosition": -2 } } ], "sequences": [ { "content": [ { "id": "ev1", "duration": { "base": "16th" }, "notes": [ { "pitch": { "octave": 5, "step": "C" } } ] }, { "id": "ev2", "duration": { "base": "eighth" }, "notes": [ { "pitch": { "octave": 5, "step": "D" } } ] }, { "id": "ev3", "duration": { "base": "16th" }, "notes": [ { "pitch": { "octave": 5, "step": "C" } } ] }, { "id": "ev4", "duration": { "base": "16th" }, "notes": [ { "pitch": { "octave": 5, "step": "E" } } ] }, { "id": "ev5", "duration": { "base": "eighth" }, "notes": [ { "pitch": { "octave": 5, "step": "F" } } ] }, { "id": "ev6", "duration": { "base": "16th" }, "notes": [ { "pitch": { "octave": 5, "step": "E" } } ] }, { "id": "ev7", "duration": { "base": "16th" }, "notes": [ { "pitch": { "octave": 5, "step": "G" } } ] }, { "id": "ev8", "duration": { "base": "eighth" }, "notes": [ { "pitch": { "octave": 5, "step": "A" } } ] }, { "id": "ev9", "duration": { "base": "16th" }, "notes": [ { "pitch": { "octave": 5, "step": "G" } } ] }, { "duration": { "base": "quarter" }, "notes": [ { "pitch": { "octave": 6, "step": "C" } } ] } ] } ] } ] } ] }

## Beams (with inner grace notes)

In MusicXML, to exclude a grace note from a beam, you exclude `<beam>continue</beam>` from the grace note’s `<note>` element.

In MNX, you exclude the grace note’s event from the beam object.

### MusicXML

<score-partwise version="3.1"> <part-list> <score-part id="P1"> <part-name>Music</part-name> </score-part> </part-list> <part id="P1"> <measure number="1"> <attributes> <divisions>256</divisions> <key> <fifths>0</fifths> <mode>major</mode> </key> <time> <beats>4</beats> <beat-type>4</beat-type> </time> <clef> <sign>G</sign> <line>2</line> </clef> </attributes> <note> <pitch> <step>C</step> <octave>5</octave> </pitch> <duration>128</duration> <type>eighth</type>
<beam number="1">begin</beam>
</note> <note> <grace></grace> <pitch> <step>B</step> <octave>4</octave> </pitch> <type>eighth</type> </note> <note> <pitch> <step>D</step> <octave>5</octave> </pitch> <duration>128</duration> <type>eighth</type>
<beam number="1">continue</beam>
</note> <note> <pitch> <step>E</step> <octave>5</octave> </pitch> <duration>128</duration> <type>eighth</type>
<beam number="1">continue</beam>
</note> <note> <pitch> <step>F</step> <octave>5</octave> </pitch> <duration>128</duration> <type>eighth</type>
<beam number="1">end</beam>
</note> <note> <rest></rest> <duration>512</duration> <type>half</type> </note> </measure> </part> </score-partwise>

### MNX

{ "mnx": { "support": { "useBeams": true }, "version": 1 }, "global": { "measures": [ { "time": { "count": 4, "unit": 4 } } ] }, "parts": [ { "measures": [ { "beams": [ { "_c": "Note that ev2 (the grace note) isn't included in the beam.", "events": [ "ev1", "ev3", "ev4", "ev5" ] } ], "clefs": [ { "clef": { "sign": "G", "staffPosition": -2 } } ], "sequences": [ { "content": [ { "id": "ev1", "duration": { "base": "eighth" }, "notes": [ { "pitch": { "octave": 5, "step": "C" } } ] }, { "id": "ev2", "type": "grace", "content": [ { "duration": { "base": "eighth" }, "notes": [ { "pitch": { "octave": 4, "step": "B" } } ] } ] }, { "id": "ev3", "duration": { "base": "eighth" }, "notes": [ { "pitch": { "octave": 5, "step": "D" } } ] }, { "id": "ev4", "duration": { "base": "eighth" }, "notes": [ { "pitch": { "octave": 5, "step": "E" } } ] }, { "id": "ev5", "duration": { "base": "eighth" }, "notes": [ { "pitch": { "octave": 5, "step": "F" } } ] }, { "duration": { "base": "half" }, "rest": {} } ] } ] } ] } ] }

## Beams (across barlines)

Both MusicXML and MNX support beams crossing barlines.

In MNX, the beam is encoded in the sequence in which the beam starts. The beam's `"events"` list is free to reference IDs of events in a subsequent measure.

### MusicXML

<score-partwise version="3.1"> <part-list> <score-part id="P1"> <part-name>Music</part-name> </score-part> </part-list> <part id="P1"> <measure number="1"> <attributes> <divisions>2</divisions> <key> <fifths>0</fifths> </key> <time> <beats>4</beats> <beat-type>4</beat-type> </time> <clef> <sign>G</sign> <line>2</line> </clef> </attributes> <note> <rest></rest> <duration>4</duration> <type>half</type> </note> <note> <rest></rest> <duration>2</duration> <type>quarter</type> </note> <note> <pitch> <step>C</step> <octave>5</octave> </pitch> <duration>1</duration> <type>eighth</type> <stem>down</stem>
<beam number="1">begin</beam>
</note> <note> <pitch> <step>D</step> <octave>5</octave> </pitch> <duration>1</duration> <type>eighth</type> <stem>down</stem>
<beam number="1">continue</beam>
</note> </measure> <measure number="2"> <note> <pitch> <step>E</step> <octave>5</octave> </pitch> <duration>1</duration> <type>eighth</type> <stem>down</stem>
<beam number="1">continue</beam>
</note> <note> <pitch> <step>F</step> <octave>5</octave> </pitch> <duration>1</duration> <type>eighth</type> <stem>down</stem>
<beam number="1">end</beam>
</note> <note> <rest></rest> <duration>2</duration> <type>quarter</type> </note> <note> <rest></rest> <duration>4</duration> <type>half</type> </note> <barline location="right"> <bar-style>light-heavy</bar-style> </barline> </measure> </part> </score-partwise>

### MNX

{ "mnx": { "support": { "useBeams": true }, "version": 1 }, "global": { "measures": [ { "time": { "count": 4, "unit": 4 } }, {} ] }, "parts": [ { "measures": [ { "beams": [ { "events": [ "ev3", "ev4", "ev5", "ev6" ] } ], "clefs": [ { "clef": { "sign": "G", "staffPosition": -2 } } ], "sequences": [ { "content": [ { "duration": { "base": "half" }, "rest": {} }, { "duration": { "base": "quarter" }, "rest": {} }, { "id": "ev3", "duration": { "base": "eighth" }, "notes": [ { "pitch": { "octave": 5, "step": "C" } } ] }, { "id": "ev4", "duration": { "base": "eighth" }, "notes": [ { "pitch": { "octave": 5, "step": "D" } } ] } ] } ] }, { "sequences": [ { "content": [ { "id": "ev5", "duration": { "base": "eighth" }, "notes": [ { "pitch": { "octave": 5, "step": "E" } } ] }, { "id": "ev6", "duration": { "base": "eighth" }, "notes": [ { "pitch": { "octave": 5, "step": "F" } } ] }, { "duration": { "base": "quarter" }, "rest": {} }, { "duration": { "base": "half" }, "rest": {} } ] } ] } ] } ] }

## Tuplets

MusicXML uses two separate concepts: a `<time-modification>` element to encode the tuplet’s ratio and a `<tuplet>` element to encode the engraved tuplet itself. These go inside `<note>` elements. Parsers need to keep track of currently open tuplets and look for the value `stop`.

MNX uses a single object, with type `"tuplet"`, which contains the notes or rests therein. The `"inner"` value encodes the rhythmic duration of the tuplet’s elements as if the tuplet were ignored; the `"outer"` value encodes the rhythmic duration taking the tuplet’s ratio into account.

### MusicXML

<score-partwise version="3.1"> <part-list> <score-part id="P1"> <part-name>Music</part-name> </score-part> </part-list> <part id="P1"> <measure number="1"> <attributes> <divisions>256</divisions> <key> <fifths>0</fifths> <mode>major</mode> </key> <time> <beats>4</beats> <beat-type>4</beat-type> </time> <clef> <sign>G</sign> <line>2</line> </clef> </attributes> <note> <pitch> <step>C</step> <octave>5</octave> </pitch> <duration>170</duration> <type>quarter</type>
<time-modification> <actual-notes>3</actual-notes> <normal-notes>2</normal-notes> <normal-type>eighth</normal-type> </time-modification> <notations> <tuplet number="1" type="start"></tuplet> </notations>
</note> <note> <pitch> <step>G</step> <octave>4</octave> </pitch> <duration>85</duration> <type>eighth</type>
<time-modification> <actual-notes>3</actual-notes> <normal-notes>2</normal-notes> <normal-type>eighth</normal-type> </time-modification> <notations> <tuplet number="1" type="stop"></tuplet> </notations>
</note> <note> <pitch> <step>E</step> <octave>4</octave> </pitch> <duration>85</duration> <type>eighth</type>
<time-modification> <actual-notes>3</actual-notes> <normal-notes>2</normal-notes> </time-modification> <beam number="1">begin</beam> <notations> <tuplet number="1" type="start"></tuplet> </notations>
</note> <note> <pitch> <step>F</step> <octave>4</octave> </pitch> <duration>85</duration> <type>eighth</type>
<time-modification> <actual-notes>3</actual-notes> <normal-notes>2</normal-notes> </time-modification>
<beam number="1">continue</beam> </note> <note> <pitch> <step>G</step> <octave>4</octave> </pitch> <duration>85</duration> <type>eighth</type>
<time-modification> <actual-notes>3</actual-notes> <normal-notes>2</normal-notes> </time-modification> <beam number="1">end</beam> <notations> <tuplet number="1" type="stop"></tuplet> </notations>
</note> <note> <pitch> <step>E</step> <octave>5</octave> </pitch> <duration>256</duration> <type>quarter</type> </note> <note> <pitch> <step>D</step> <octave>5</octave> </pitch> <duration>256</duration> <type>quarter</type> </note> </measure> <measure number="2"> <note> <pitch> <step>C</step> <octave>5</octave> </pitch> <duration>170</duration> <type>quarter</type>
<time-modification> <actual-notes>6</actual-notes> <normal-notes>4</normal-notes> </time-modification> <notations> <tuplet number="1" type="start"></tuplet> </notations>
</note> <note> <pitch> <step>D</step> <octave>5</octave> </pitch> <duration>170</duration> <type>quarter</type>
<time-modification> <actual-notes>6</actual-notes> <normal-notes>4</normal-notes> </time-modification>
</note> <note> <pitch> <step>C</step> <octave>5</octave> </pitch> <duration>170</duration> <type>quarter</type>
<time-modification> <actual-notes>6</actual-notes> <normal-notes>4</normal-notes> </time-modification>
</note> <note> <pitch> <step>G</step> <octave>4</octave> </pitch> <duration>170</duration> <type>quarter</type>
<time-modification> <actual-notes>6</actual-notes> <normal-notes>4</normal-notes> </time-modification>
</note> <note> <pitch> <step>E</step> <octave>5</octave> </pitch> <duration>170</duration> <type>quarter</type>
<time-modification> <actual-notes>6</actual-notes> <normal-notes>4</normal-notes> </time-modification>
</note> <note> <pitch> <step>C</step> <octave>5</octave> </pitch> <duration>170</duration> <type>quarter</type>
<time-modification> <actual-notes>6</actual-notes> <normal-notes>4</normal-notes> </time-modification> <notations> <tuplet number="1" type="stop"></tuplet> </notations>
</note> </measure> </part> </score-partwise>

### MNX

{ "mnx": { "support": { "useBeams": true }, "version": 1 }, "global": { "measures": [ { "time": { "count": 4, "unit": 4 } }, {} ] }, "parts": [ { "measures": [ { "beams": [ { "events": [ "ev3", "ev4", "ev5" ] } ], "clefs": [ { "clef": { "sign": "G", "staffPosition": -2 } } ], "sequences": [ { "content": [ { "type": "tuplet", "content": [ { "duration": { "base": "quarter" }, "notes": [ { "pitch": { "octave": 5, "step": "C" } } ] }, { "duration": { "base": "eighth" }, "notes": [ { "pitch": { "octave": 4, "step": "G" } } ] } ], "inner": { "duration": { "base": "eighth" }, "multiple": 3 }, "outer": { "duration": { "base": "eighth" }, "multiple": 2 } }, { "type": "tuplet", "content": [ { "id": "ev3", "duration": { "base": "eighth" }, "notes": [ { "pitch": { "octave": 4, "step": "E" } } ] }, { "id": "ev4", "duration": { "base": "eighth" }, "notes": [ { "pitch": { "octave": 4, "step": "F" } } ] }, { "id": "ev5", "duration": { "base": "eighth" }, "notes": [ { "pitch": { "octave": 4, "step": "G" } } ] } ], "inner": { "duration": { "base": "eighth" }, "multiple": 3 }, "outer": { "duration": { "base": "eighth" }, "multiple": 2 } }, { "duration": { "base": "quarter" }, "notes": [ { "pitch": { "octave": 5, "step": "E" } } ] }, { "duration": { "base": "quarter" }, "notes": [ { "pitch": { "octave": 5, "step": "D" } } ] } ] } ] }, { "sequences": [ { "content": [ { "type": "tuplet", "content": [ { "duration": { "base": "quarter" }, "notes": [ { "pitch": { "octave": 5, "step": "C" } } ] }, { "duration": { "base": "quarter" }, "notes": [ { "pitch": { "octave": 5, "step": "D" } } ] }, { "duration": { "base": "quarter" }, "notes": [ { "pitch": { "octave": 5, "step": "C" } } ] }, { "duration": { "base": "quarter" }, "notes": [ { "pitch": { "octave": 4, "step": "G" } } ] }, { "duration": { "base": "quarter" }, "notes": [ { "pitch": { "octave": 5, "step": "E" } } ] }, { "duration": { "base": "quarter" }, "notes": [ { "pitch": { "octave": 5, "step": "C" } } ] } ], "inner": { "duration": { "base": "quarter" }, "multiple": 6 }, "outer": { "duration": { "base": "quarter" }, "multiple": 4 } } ] } ] } ] } ] }

## Multiple voices

In MusicXML, parsers need to keep track of an internal position; this example uses `<backup>` to move the internal position back to `0` to begin the second voice. In MNX, voices are explicitly grouped within "sequences."

### MusicXML

<score-partwise version="3.1"> <part-list> <score-part id="P1"> <part-name>Music</part-name> </score-part> </part-list> <part id="P1">
<measure number="1"> <attributes> <divisions>256</divisions> <key> <fifths>0</fifths> </key> <time> <beats>4</beats> <beat-type>4</beat-type> </time> <clef> <sign>G</sign> <line>2</line> </clef> </attributes> <note> <pitch> <step>C</step> <octave>4</octave> </pitch> <duration>512</duration> <voice>1</voice> <type>half</type> </note> <note> <pitch> <step>G</step> <octave>3</octave> </pitch> <duration>512</duration> <voice>1</voice> <type>half</type> </note> <backup> <duration>1024</duration> </backup> <note> <pitch> <step>E</step> <octave>5</octave> </pitch> <duration>256</duration> <voice>2</voice> <type>quarter</type> </note> <note> <pitch> <step>F</step> <octave>5</octave> </pitch> <duration>256</duration> <voice>2</voice> <type>quarter</type> </note> <note> <pitch> <step>G</step> <octave>5</octave> </pitch> <duration>256</duration> <voice>2</voice> <type>quarter</type> </note> <note> <pitch> <step>B</step> <octave>4</octave> </pitch> <duration>256</duration> <voice>2</voice> <type>quarter</type> </note> </measure> <measure number="2"> <note> <pitch> <step>C</step> <octave>4</octave> </pitch> <duration>1024</duration> <voice>1</voice> <type>whole</type> </note> <backup> <duration>1024</duration> </backup> <note> <pitch> <step>D</step> <octave>5</octave> </pitch> <duration>256</duration> <voice>2</voice> <type>quarter</type> </note> <note> <pitch> <step>C</step> <octave>5</octave> </pitch> <duration>256</duration> <voice>2</voice> <type>quarter</type> </note> <note> <pitch> <step>C</step> <octave>6</octave> </pitch> <duration>512</duration> <voice>2</voice> <type>half</type> </note> </measure>
</part> </score-partwise>

### MNX

{ "mnx": { "version": 1 }, "global": { "measures": [ { "time": { "count": 4, "unit": 4 } }, {} ] }, "parts": [ { "measures": [ { "clefs": [ { "clef": { "sign": "G", "staffPosition": -2 } } ], "sequences": [ { "content": [ { "duration": { "base": "half" }, "notes": [ { "pitch": { "octave": 4, "step": "C" } } ] }, { "duration": { "base": "half" }, "notes": [ { "pitch": { "octave": 3, "step": "G" } } ] } ] }, { "content": [ { "duration": { "base": "quarter" }, "notes": [ { "pitch": { "octave": 5, "step": "E" } } ] }, { "duration": { "base": "quarter" }, "notes": [ { "pitch": { "octave": 5, "step": "F" } } ] }, { "duration": { "base": "quarter" }, "notes": [ { "pitch": { "octave": 5, "step": "G" } } ] }, { "duration": { "base": "quarter" }, "notes": [ { "pitch": { "octave": 4, "step": "B" } } ] } ] } ] }, { "sequences": [ { "content": [ { "duration": { "base": "whole" }, "notes": [ { "pitch": { "octave": 4, "step": "C" } } ] } ] }, { "content": [ { "duration": { "base": "quarter" }, "notes": [ { "pitch": { "octave": 5, "step": "D" } } ] }, { "duration": { "base": "quarter" }, "notes": [ { "pitch": { "octave": 5, "step": "C" } } ] }, { "duration": { "base": "half" }, "notes": [ { "pitch": { "octave": 6, "step": "C" } } ] } ] } ] } ] } ] }

## Ottavas (8va)

In MusicXML, you put `<octave-shift>` elements around the notes that are affected by the octave shift; the issue of whether the ottava affects the first note following the closing `<octave-shift>` is interpreted differently by different programs.

In MNX, each part-measure can define an `"ottavas"` array, which contains all of the ottavas that begin in that measure. The ottava's `"position"` value encodes the measure location of the first event for which the ottava applies, and `"end"` encodes the last note for which the ottava applies. In this example, the ottava’s final note, the C quarter note, is in bar 2 and metrical position one half note into the bar.

In both MusicXML and MNX, pitches for notes within an ottava are specified taking the ottava into account. In this example, the final two pitches are C7 and C6, despite the notes being rendered on the same staff line.

In MusicXML, the encoded value is the number of semitones (8 in this example). In MNX, the encoded value is the number of octaves (1 in this example).

### MusicXML

<score-partwise version="3.1"> <part-list> <score-part id="P1"> <part-name>Music</part-name> </score-part> </part-list> <part id="P1"> <measure number="1"> <attributes> <divisions>256</divisions> <key> <fifths>0</fifths> </key> <time> <beats>4</beats> <beat-type>4</beat-type> </time> <clef> <sign>G</sign> <line>2</line> </clef> </attributes> <note> <pitch> <step>C</step> <octave>5</octave> </pitch> <duration>256</duration> <type>quarter</type> </note> <note> <pitch> <step>E</step> <octave>5</octave> </pitch> <duration>256</duration> <type>quarter</type> </note>
<direction> <direction-type> <octave-shift size="8" type="down"></octave-shift> </direction-type> </direction>
<note> <pitch> <step>C</step> <octave>7</octave> </pitch> <duration>512</duration> <type>half</type> </note> </measure> <measure number="2"> <note> <pitch> <step>E</step> <octave>7</octave> </pitch> <duration>512</duration> <type>half</type> </note> <note> <pitch> <step>C</step> <octave>7</octave> </pitch> <duration>256</duration> <type>quarter</type> </note>
<direction> <direction-type> <octave-shift size="8" type="stop"></octave-shift> </direction-type> </direction>
<note> <pitch> <step>C</step> <octave>6</octave> </pitch> <duration>256</duration> <type>quarter</type> </note> </measure> </part> </score-partwise>

### MNX

{ "mnx": { "version": 1 }, "global": { "measures": [ { "id": "m1", "time": { "count": 4, "unit": 4 } }, { "id": "m2" } ] }, "parts": [ { "measures": [ { "clefs": [ { "clef": { "sign": "G", "staffPosition": -2 } } ], "ottavas": [ { "end": { "measure": "m2", "position": { "fraction": [ 1, 2 ] } }, "position": { "fraction": [ 1, 2 ] }, "value": 1 } ], "sequences": [ { "content": [ { "duration": { "base": "quarter" }, "notes": [ { "pitch": { "octave": 5, "step": "C" } } ] }, { "duration": { "base": "quarter" }, "notes": [ { "pitch": { "octave": 5, "step": "E" } } ] }, { "duration": { "base": "half" }, "notes": [ { "pitch": { "octave": 7, "step": "C" } } ] } ] } ] }, { "sequences": [ { "content": [ { "duration": { "base": "half" }, "notes": [ { "pitch": { "octave": 7, "step": "E" } } ] }, { "duration": { "base": "quarter" }, "notes": [ { "pitch": { "octave": 7, "step": "C" } } ] }, { "duration": { "base": "quarter" }, "notes": [ { "pitch": { "octave": 6, "step": "C" } } ] } ] } ] } ] } ] }

## Slurs

In MusicXML, you put `<slur>` elements within the first and last notes in the slur. The first has `type=start` and the last has `type=stop`. Use the `placement` attribute to specify whether the slur is above or below the notes.

In MNX, an event can contain a `"slurs"` object, which encodes all of the slurs that begin in that event. The slur’s `"target"` specifies the ID of the last event in the slur. Use `"side"` to specify whether the slur is above or below.

### MusicXML

<score-partwise version="3.1"> <part-list> <score-part id="P1"> <part-name>Music</part-name> </score-part> </part-list> <part id="P1"> <measure number="1"> <attributes> <divisions>256</divisions> <key> <fifths>0</fifths> </key> <time> <beats>4</beats> <beat-type>4</beat-type> </time> <clef> <sign>G</sign> <line>2</line> </clef> </attributes> <note> <pitch> <step>C</step> <octave>5</octave> </pitch> <duration>256</duration> <type>quarter</type>
<notations> <slur number="1" placement="above" type="start"></slur> </notations>
</note> <note> <pitch> <step>D</step> <octave>5</octave> </pitch> <duration>256</duration> <type>quarter</type> </note> <note> <pitch> <step>E</step> <octave>5</octave> </pitch> <duration>256</duration> <type>quarter</type> </note> <note> <pitch> <step>C</step> <octave>5</octave> </pitch> <duration>256</duration> <type>quarter</type>
<notations> <slur number="1" type="stop"></slur> </notations>
</note> </measure> <measure number="2"> <note> <pitch> <step>G</step> <octave>4</octave> </pitch> <duration>256</duration> <type>quarter</type>
<notations> <slur number="1" placement="below" type="start"></slur> </notations>
</note> <note> <pitch> <step>A</step> <octave>4</octave> </pitch> <duration>256</duration> <type>quarter</type> </note> <note> <pitch> <step>G</step> <octave>4</octave> </pitch> <duration>256</duration> <type>quarter</type> </note> <note> <pitch> <step>E</step> <octave>4</octave> </pitch> <duration>256</duration> <type>quarter</type>
<notations> <slur number="1" type="stop"></slur> </notations>
</note> </measure> </part> </score-partwise>

### MNX

{ "mnx": { "version": 1 }, "global": { "measures": [ { "time": { "count": 4, "unit": 4 } }, {} ] }, "parts": [ { "measures": [ { "clefs": [ { "clef": { "sign": "G", "staffPosition": -2 } } ], "sequences": [ { "content": [ { "id": "ev1", "duration": { "base": "quarter" }, "notes": [ { "pitch": { "octave": 5, "step": "C" } } ], "slurs": [ { "side": "up", "target": "ev4" } ] }, { "id": "ev2", "duration": { "base": "quarter" }, "notes": [ { "pitch": { "octave": 5, "step": "D" } } ] }, { "id": "ev3", "duration": { "base": "quarter" }, "notes": [ { "pitch": { "octave": 5, "step": "E" } } ] }, { "id": "ev4", "duration": { "base": "quarter" }, "notes": [ { "pitch": { "octave": 5, "step": "C" } } ] } ] } ] }, { "sequences": [ { "content": [ { "id": "ev5", "duration": { "base": "quarter" }, "notes": [ { "pitch": { "octave": 4, "step": "G" } } ], "slurs": [ { "side": "down", "target": "ev8" } ] }, { "id": "ev6", "duration": { "base": "quarter" }, "notes": [ { "pitch": { "octave": 4, "step": "A" } } ] }, { "id": "ev7", "duration": { "base": "quarter" }, "notes": [ { "pitch": { "octave": 4, "step": "G" } } ] }, { "id": "ev8", "duration": { "base": "quarter" }, "notes": [ { "pitch": { "octave": 4, "step": "E" } } ] } ] } ] } ] } ] }

## Slurs (for chords)

In MusicXML, if the start and/or end points of a slur are chords, then the slur markup goes inside the first note of the chord.

In MNX, the slur is attached to the event, not to the note.

### MusicXML

<score-partwise version="3.1"> <part-list> <score-part id="P1"> <part-name>Music</part-name> </score-part> </part-list> <part id="P1"> <measure number="1"> <attributes> <divisions>256</divisions> <key> <fifths>0</fifths> <mode>major</mode> </key> <time> <beats>4</beats> <beat-type>4</beat-type> </time> <staves>1</staves> <clef> <sign>G</sign> <line>2</line> </clef> </attributes> <note> <pitch> <step>C</step> <octave>5</octave> </pitch> <duration>256</duration> <type>quarter</type>
<notations> <slur number="1" placement="above" type="start"></slur> </notations>
</note> <note> <chord></chord> <pitch> <step>E</step> <octave>5</octave> </pitch> <duration>256</duration> <type>quarter</type> </note> <note> <pitch> <step>D</step> <octave>5</octave> </pitch> <duration>256</duration> <type>quarter</type> </note> <note> <chord></chord> <pitch> <step>F</step> <octave>5</octave> </pitch> <duration>256</duration> <type>quarter</type> </note> <note> <pitch> <step>E</step> <octave>5</octave> </pitch> <duration>256</duration> <type>quarter</type> </note> <note> <chord></chord> <pitch> <step>G</step> <octave>5</octave> </pitch> <duration>256</duration> <type>quarter</type> </note> <note> <pitch> <step>F</step> <octave>5</octave> </pitch> <duration>256</duration> <type>quarter</type>
<notations> <slur number="1" type="stop"></slur> </notations>
</note> <note> <chord></chord> <pitch> <step>A</step> <octave>5</octave> </pitch> <duration>256</duration> <type>quarter</type> </note> </measure> </part> </score-partwise>

### MNX

{ "mnx": { "version": 1 }, "global": { "measures": [ { "time": { "count": 4, "unit": 4 } } ] }, "parts": [ { "measures": [ { "clefs": [ { "clef": { "sign": "G", "staffPosition": -2 } } ], "sequences": [ { "content": [ { "id": "ev1", "duration": { "base": "quarter" }, "notes": [ { "pitch": { "octave": 5, "step": "C" } }, { "pitch": { "octave": 5, "step": "E" } } ], "slurs": [ { "side": "up", "target": "ev4" } ] }, { "id": "ev2", "duration": { "base": "quarter" }, "notes": [ { "pitch": { "octave": 5, "step": "D" } }, { "pitch": { "octave": 5, "step": "F" } } ] }, { "id": "ev3", "duration": { "base": "quarter" }, "notes": [ { "pitch": { "octave": 5, "step": "E" } }, { "pitch": { "octave": 5, "step": "G" } } ] }, { "id": "ev4", "duration": { "base": "quarter" }, "notes": [ { "pitch": { "octave": 5, "step": "F" } }, { "pitch": { "octave": 5, "step": "A" } } ] } ] } ] } ] } ] }

## Slurs (targeting specific notes)

In MusicXML, slurs are always defined within `<note>` elements.

In MNX, a slur can optionally specify which specific notes it’s attached to, using `"startNote"` and `"endNote"`. The `"startNote"` must be within the event that contains the slur, and the `"endNote"` must be within the event pointed-to by `"target"`.

### MusicXML

<score-partwise version="3.1"> <part-list> <score-part id="P1"> <part-name>Music</part-name> </score-part> </part-list> <part id="P1"> <measure number="1"> <attributes> <divisions>256</divisions> <key> <fifths>0</fifths> <mode>major</mode> </key> <time> <beats>4</beats> <beat-type>4</beat-type> </time> <staves>1</staves> <clef> <sign>G</sign> <line>2</line> </clef> </attributes> <note> <pitch> <step>C</step> <octave>5</octave> </pitch> <duration>512</duration> <type>half</type>
<notations> <slur number="1" placement="below" type="start"></slur> </notations>
</note> <note> <chord></chord> <pitch> <step>E</step> <octave>5</octave> </pitch> <duration>512</duration> <type>half</type>
<notations> <slur number="2" placement="above" type="start"></slur> </notations>
</note> <note> <chord></chord> <pitch> <step>G</step> <octave>5</octave> </pitch> <duration>512</duration> <type>half</type>
<notations> <slur number="3" placement="above" type="start"></slur> </notations>
</note> <note> <pitch> <step>B</step> <octave>4</octave> </pitch> <duration>512</duration> <type>half</type>
<notations> <slur number="1" type="stop"></slur> </notations>
</note> <note> <chord></chord> <pitch> <step>D</step> <octave>5</octave> </pitch> <duration>512</duration> <type>half</type>
<notations> <slur number="2" type="stop"></slur> </notations>
</note> <note> <chord></chord> <pitch> <step>F</step> <octave>5</octave> </pitch> <duration>512</duration> <type>half</type>
<notations> <slur number="3" type="stop"></slur> </notations>
</note> </measure> </part> </score-partwise>

### MNX

{ "mnx": { "version": 1 }, "global": { "measures": [ { "time": { "count": 4, "unit": 4 } } ] }, "parts": [ { "measures": [ { "clefs": [ { "clef": { "sign": "G", "staffPosition": -2 } } ], "sequences": [ { "content": [ { "id": "ev1", "duration": { "base": "half" }, "notes": [ { "id": "note1", "pitch": { "octave": 5, "step": "C" } }, { "id": "note2", "pitch": { "octave": 5, "step": "E" } }, { "id": "note3", "pitch": { "octave": 5, "step": "G" } } ], "slurs": [ { "endNote": "note4", "side": "down", "startNote": "note1", "target": "ev2" }, { "endNote": "note5", "side": "up", "startNote": "note2", "target": "ev2" }, { "endNote": "note6", "side": "up", "startNote": "note3", "target": "ev2" } ] }, { "id": "ev2", "duration": { "base": "half" }, "notes": [ { "id": "note4", "pitch": { "octave": 4, "step": "B" } }, { "id": "note5", "pitch": { "octave": 5, "step": "D" } }, { "id": "note6", "pitch": { "octave": 5, "step": "F" } } ] } ] } ] } ] } ] }

## Parts

MusicXML supports two ways of organizing parts:

1. If the top-level element is `<score-partwise>`, then the markup must contain `<part>` elements that contain `<measure>` elements.

2. If the top-level element is `<score-timewise>`, then the markup must contain `<measure>` elements that contain `<part>` elements.

MNX has only one way, similar to MusicXML’s `<score-partwise>`. Each object in the global `"parts"` array contains the measure data within `"measures"`.

In MusicXML, part metadata such as the title lives within a `<part-list>` element. In MNX, part metadata goes in the individual part object.

### MusicXML

<score-partwise version="3.1"> <part-list> <score-part id="P1"> <part-name>Melody</part-name> </score-part> <score-part id="P2"> <part-name>Harmony</part-name> </score-part> </part-list> <part id="P1"> <measure number="1"> <attributes> <divisions>256</divisions> <key> <fifths>0</fifths> <mode>major</mode> </key> <time> <beats>4</beats> <beat-type>4</beat-type> </time> <staves>1</staves> <clef> <sign>G</sign> <line>2</line> </clef> </attributes> <note> <pitch> <step>C</step> <octave>5</octave> </pitch> <duration>256</duration> <type>quarter</type> </note> <note> <pitch> <step>D</step> <octave>5</octave> </pitch> <duration>256</duration> <type>quarter</type> </note> <note> <pitch> <step>E</step> <octave>5</octave> </pitch> <duration>256</duration> <type>quarter</type> </note> <note> <pitch> <step>G</step> <octave>5</octave> </pitch> <duration>256</duration> <type>quarter</type> </note> </measure> <measure number="2"> <note> <pitch> <step>C</step> <octave>5</octave> </pitch> <duration>256</duration> <type>quarter</type> </note> <note> <pitch> <step>D</step> <octave>5</octave> </pitch> <duration>256</duration> <type>quarter</type> </note> <note> <pitch> <step>E</step> <octave>5</octave> </pitch> <duration>256</duration> <type>quarter</type> </note> <note> <pitch> <step>C</step> <octave>5</octave> </pitch> <duration>256</duration> <type>quarter</type> </note> </measure> </part> <part id="P2"> <measure number="1"> <attributes> <divisions>256</divisions> <key> <fifths>0</fifths> <mode>major</mode> </key> <time> <beats>4</beats> <beat-type>4</beat-type> </time> <staves>1</staves> <clef> <sign>G</sign> <line>2</line> </clef> </attributes> <note> <rest></rest> <duration>512</duration> <type>half</type> </note> <note> <pitch> <step>C</step> <octave>5</octave> </pitch> <duration>128</duration> <type>eighth</type> <beam number="1">begin</beam> </note> <note> <pitch> <step>D</step> <octave>5</octave> </pitch> <duration>128</duration> <type>eighth</type> <beam number="1">continue</beam> </note> <note> <pitch> <step>E</step> <octave>5</octave> </pitch> <duration>128</duration> <type>eighth</type> <beam number="1">continue</beam> </note> <note> <pitch> <step>D</step> <octave>5</octave> </pitch> <duration>128</duration> <type>eighth</type> <beam number="1">end</beam> </note> </measure> <measure number="2"> <note> <rest></rest> <duration>512</duration> <type>half</type> </note> <note> <pitch> <step>G</step> <octave>5</octave> </pitch> <duration>256</duration> <type>quarter</type> </note> <note> <pitch> <step>E</step> <octave>5</octave> </pitch> <duration>256</duration> <type>quarter</type> </note> </measure> </part> </score-partwise>

### MNX

{ "mnx": { "support": { "useBeams": true }, "version": 1 }, "global": { "measures": [ { "time": { "count": 4, "unit": 4 } }, {} ] }, "parts": [ { "measures": [ { "clefs": [ { "clef": { "sign": "G", "staffPosition": -2 } } ], "sequences": [ { "content": [ { "duration": { "base": "quarter" }, "notes": [ { "pitch": { "octave": 5, "step": "C" } } ] }, { "duration": { "base": "quarter" }, "notes": [ { "pitch": { "octave": 5, "step": "D" } } ] }, { "duration": { "base": "quarter" }, "notes": [ { "pitch": { "octave": 5, "step": "E" } } ] }, { "duration": { "base": "quarter" }, "notes": [ { "pitch": { "octave": 5, "step": "G" } } ] } ] } ] }, { "sequences": [ { "content": [ { "duration": { "base": "quarter" }, "notes": [ { "pitch": { "octave": 5, "step": "C" } } ] }, { "duration": { "base": "quarter" }, "notes": [ { "pitch": { "octave": 5, "step": "D" } } ] }, { "duration": { "base": "quarter" }, "notes": [ { "pitch": { "octave": 5, "step": "E" } } ] }, { "duration": { "base": "quarter" }, "notes": [ { "pitch": { "octave": 5, "step": "C" } } ] } ] } ] } ], "name": "Melody" }, { "measures": [ { "beams": [ { "events": [ "ev6", "ev7", "ev8", "ev9" ] } ], "clefs": [ { "clef": { "sign": "G", "staffPosition": -2 } } ], "sequences": [ { "content": [ { "duration": { "base": "half" }, "rest": {} }, { "id": "ev6", "duration": { "base": "eighth" }, "notes": [ { "pitch": { "octave": 5, "step": "C" } } ] }, { "id": "ev7", "duration": { "base": "eighth" }, "notes": [ { "pitch": { "octave": 5, "step": "D" } } ] }, { "id": "ev8", "duration": { "base": "eighth" }, "notes": [ { "pitch": { "octave": 5, "step": "E" } } ] }, { "id": "ev9", "duration": { "base": "eighth" }, "notes": [ { "pitch": { "octave": 5, "step": "D" } } ] } ] } ] }, { "sequences": [ { "content": [ { "duration": { "base": "half" }, "rest": {} }, { "duration": { "base": "quarter" }, "notes": [ { "pitch": { "octave": 5, "step": "G" } } ] }, { "duration": { "base": "quarter" }, "notes": [ { "pitch": { "octave": 5, "step": "E" } } ] } ] } ] } ], "name": "Harmony" } ] }

## Repeats

MusicXML uses `<bar-style>` to represent the visual repeat barline and `<repeat>` to represent the repeated playback.

MNX uses `"repeatStart"` and `"repeatEnd"` in the global section of the document.

### MusicXML

<score-partwise version="3.1"> <part-list> <score-part id="P1"> <part-name>Music</part-name> </score-part> </part-list> <part id="P1"> <measure number="1">
<barline location="left"> <bar-style>heavy-light</bar-style> <repeat direction="forward"></repeat> </barline>
<attributes> <divisions>256</divisions> <key> <fifths>0</fifths> <mode>major</mode> </key> <time> <beats>4</beats> <beat-type>4</beat-type> </time> <clef> <sign>G</sign> <line>2</line> </clef> </attributes> <note> <pitch> <step>C</step> <octave>5</octave> </pitch> <duration>1024</duration> <type>whole</type> </note>
<barline location="right"> <bar-style>light-heavy</bar-style> <repeat direction="backward"></repeat> </barline>
</measure> </part> </score-partwise>

### MNX

{ "mnx": { "version": 1 }, "global": { "measures": [ { "repeatEnd": {}, "repeatStart": {}, "time": { "count": 4, "unit": 4 } } ] }, "parts": [ { "measures": [ { "clefs": [ { "clef": { "sign": "G", "staffPosition": -2 } } ], "sequences": [ { "content": [ { "duration": { "base": "whole" }, "notes": [ { "pitch": { "octave": 5, "step": "C" } } ] } ] } ] } ] } ] }

## Repeats (with implied start repeat)

In both MusicXML and MNX, you can simply leave out the start repeat if it’s at the start of the music.

### MusicXML

<score-partwise version="3.1"> <part-list> <score-part id="P1"> <part-name>Music</part-name> </score-part> </part-list> <part id="P1"> <measure number="1"> <attributes> <divisions>256</divisions> <key> <fifths>0</fifths> <mode>major</mode> </key> <time> <beats>4</beats> <beat-type>4</beat-type> </time> <clef> <sign>G</sign> <line>2</line> </clef> </attributes> <note> <pitch> <step>C</step> <octave>5</octave> </pitch> <duration>1024</duration> <type>whole</type> </note>
<barline location="right"> <bar-style>light-heavy</bar-style> <repeat direction="backward"></repeat> </barline>
</measure> </part> </score-partwise>

### MNX

{ "mnx": { "version": 1 }, "global": { "measures": [ { "repeatEnd": {}, "time": { "count": 4, "unit": 4 } } ] }, "parts": [ { "measures": [ { "clefs": [ { "clef": { "sign": "G", "staffPosition": -2 } } ], "sequences": [ { "content": [ { "duration": { "base": "whole" }, "notes": [ { "pitch": { "octave": 5, "step": "C" } } ] } ] } ] } ] } ] }

## Repeats (more than once repeated)

Both MusicXML and MNX use an optional `times` attribute for specifying the number of times the music within a repeat should be performed.

### MusicXML

<score-partwise version="3.1"> <part-list> <score-part id="P1"> <part-name>Music</part-name> </score-part> </part-list> <part id="P1"> <measure number="1"> <attributes> <divisions>256</divisions> <key> <fifths>0</fifths> <mode>major</mode> </key> <time> <beats>4</beats> <beat-type>4</beat-type> </time> <clef> <sign>G</sign> <line>2</line> </clef> </attributes> <note> <pitch> <step>C</step> <octave>5</octave> </pitch> <duration>1024</duration> <type>whole</type> </note>
<barline location="right"> <bar-style>light-heavy</bar-style> <repeat direction="backward" times="4"></repeat> </barline>
</measure> </part> </score-partwise>

### MNX

{ "mnx": { "version": 1 }, "global": { "measures": [ { "repeatEnd": { "times": 4 }, "time": { "count": 4, "unit": 4 } } ] }, "parts": [ { "measures": [ { "clefs": [ { "clef": { "sign": "G", "staffPosition": -2 } } ], "sequences": [ { "content": [ { "duration": { "base": "whole" }, "notes": [ { "pitch": { "octave": 5, "step": "C" } } ] } ] } ] } ] } ] }

## Repeats (with alternate endings, simple)

In MusicXML, each alternate ending is encoded with two `<ending>` elements: one to start and the other to stop.

In MNX, each alternate ending is encoded once, via `"ending"` in the `"global"` measures section. The `"duration"` specifies how many bars the ending lasts.

### MusicXML

<score-partwise version="3.1"> <part-list> <score-part id="P1"> <part-name>Music</part-name> </score-part> </part-list> <part id="P1"> <measure number="1">
<barline location="left"> <bar-style>heavy-light</bar-style> <repeat direction="forward"></repeat> </barline>
<attributes> <divisions>256</divisions> <key> <fifths>0</fifths> <mode>major</mode> </key> <time> <beats>4</beats> <beat-type>4</beat-type> </time> <clef> <sign>G</sign> <line>2</line> </clef> </attributes> <note> <pitch> <step>C</step> <octave>5</octave> </pitch> <duration>1024</duration> <type>whole</type> </note> </measure> <measure number="2">
<barline location="left"> <ending number="1" type="start"></ending> </barline>
<note> <pitch> <step>E</step> <octave>5</octave> </pitch> <duration>1024</duration> <type>whole</type> </note>
<barline location="right"> <bar-style>light-heavy</bar-style> <ending number="1" type="stop"></ending> <repeat direction="backward"></repeat> </barline>
</measure> <measure number="3">
<barline location="left"> <ending number="2" type="start"></ending> </barline>
<note> <pitch> <step>G</step> <octave>4</octave> </pitch> <duration>1024</duration> <type>whole</type> </note>
<barline location="right"> <bar-style>light-heavy</bar-style> <ending number="2" type="stop"></ending> <repeat direction="backward"></repeat> </barline>
</measure> <measure number="4">
<barline location="left"> <ending number="3" type="start"></ending> </barline>
<note> <pitch> <step>C</step> <octave>5</octave> </pitch> <duration>1024</duration> <type>whole</type> </note>
<barline location="right"> <bar-style>light-heavy</bar-style> <ending number="3" type="discontinue"></ending> </barline>
</measure> </part> </score-partwise>

### MNX

{ "mnx": { "version": 1 }, "global": { "measures": [ { "repeatStart": {}, "time": { "count": 4, "unit": 4 } }, { "ending": { "duration": 1, "numbers": [ 1 ] }, "repeatEnd": {} }, { "ending": { "duration": 1, "numbers": [ 2 ] }, "repeatEnd": {} }, { "ending": { "duration": 1, "numbers": [ 3 ], "open": true } } ] }, "parts": [ { "measures": [ { "clefs": [ { "clef": { "sign": "G", "staffPosition": -2 } } ], "sequences": [ { "content": [ { "duration": { "base": "whole" }, "notes": [ { "pitch": { "octave": 5, "step": "C" } } ] } ] } ] }, { "sequences": [ { "content": [ { "duration": { "base": "whole" }, "notes": [ { "pitch": { "octave": 5, "step": "E" } } ] } ] } ] }, { "sequences": [ { "content": [ { "duration": { "base": "whole" }, "notes": [ { "pitch": { "octave": 4, "step": "G" } } ] } ] } ] }, { "sequences": [ { "content": [ { "duration": { "base": "whole" }, "notes": [ { "pitch": { "octave": 5, "step": "C" } } ] } ] } ] } ] } ] }

## Repeats (with alternate endings, advanced)

In MusicXML, if a bar has multiple endings, the `<ending>` element’s `number` attribute is a comma-separated list of the ending numbers (using one-based, not zero-based numbers).

In MNX, the `"ending"` contains a `"numbers"` array, which is a list of numbers (again using one-based, not zero-based numbers).

### MusicXML

<score-partwise version="3.1"> <part-list> <score-part id="P1"> <part-name>Music</part-name> </score-part> </part-list> <part id="P1"> <measure number="1"> <barline location="left"> <bar-style>heavy-light</bar-style> <repeat direction="forward"></repeat> </barline> <attributes> <divisions>256</divisions> <key> <fifths>0</fifths> <mode>major</mode> </key> <time> <beats>3</beats> <beat-type>4</beat-type> </time> <clef> <sign>G</sign> <line>2</line> </clef> </attributes> <note> <pitch> <step>C</step> <octave>5</octave> </pitch> <duration>768</duration> <type>half</type> <dot></dot> </note> </measure> <measure number="2"> <barline location="left">
<ending number="1,2" type="start"></ending>
</barline> <note> <pitch> <step>E</step> <octave>5</octave> </pitch> <duration>768</duration> <type>half</type> <dot></dot> </note> </measure> <measure number="3"> <note> <pitch> <step>E</step> <octave>5</octave> </pitch> <duration>512</duration> <type>half</type> </note> <note> <pitch> <step>D</step> <octave>5</octave> </pitch> <duration>256</duration> <type>quarter</type> </note> <barline location="right"> <bar-style>light-heavy</bar-style>
<ending number="1,2" type="stop"></ending>
<repeat direction="backward"></repeat> </barline> </measure> <measure number="4"> <barline location="left">
<ending number="3" type="start"></ending>
</barline> <note> <pitch> <step>G</step> <octave>5</octave> </pitch> <duration>768</duration> <type>half</type> <dot></dot> </note> </measure> <measure number="5"> <note> <pitch> <step>G</step> <octave>5</octave> </pitch> <duration>512</duration> <type>half</type> </note> <note> <pitch> <step>F</step> <octave>5</octave> </pitch> <duration>256</duration> <type>quarter</type> </note> <barline location="right">
<ending number="3" type="discontinue"></ending>
</barline> </measure> <measure number="6"> <note> <pitch> <step>E</step> <octave>5</octave> </pitch> <duration>768</duration> <type>half</type> <dot></dot> </note> </measure> </part> </score-partwise>

### MNX

{ "mnx": { "version": 1 }, "global": { "measures": [ { "repeatStart": {}, "time": { "count": 3, "unit": 4 } }, { "ending": { "duration": 2, "numbers": [ 1, 2 ] } }, { "repeatEnd": {} }, { "ending": { "duration": 2, "numbers": [ 3 ], "open": true } }, {}, {} ] }, "parts": [ { "measures": [ { "clefs": [ { "clef": { "sign": "G", "staffPosition": -2 } } ], "sequences": [ { "content": [ { "duration": { "base": "half", "dots": 1 }, "notes": [ { "pitch": { "octave": 5, "step": "C" } } ] } ] } ] }, { "sequences": [ { "content": [ { "duration": { "base": "half", "dots": 1 }, "notes": [ { "pitch": { "octave": 5, "step": "E" } } ] } ] } ] }, { "sequences": [ { "content": [ { "duration": { "base": "half" }, "notes": [ { "pitch": { "octave": 5, "step": "E" } } ] }, { "duration": { "base": "quarter" }, "notes": [ { "pitch": { "octave": 5, "step": "D" } } ] } ] } ] }, { "sequences": [ { "content": [ { "duration": { "base": "half", "dots": 1 }, "notes": [ { "pitch": { "octave": 5, "step": "G" } } ] } ] } ] }, { "sequences": [ { "content": [ { "duration": { "base": "half" }, "notes": [ { "pitch": { "octave": 5, "step": "G" } } ] }, { "duration": { "base": "quarter" }, "notes": [ { "pitch": { "octave": 5, "step": "F" } } ] } ] } ] }, { "sequences": [ { "content": [ { "duration": { "base": "half", "dots": 1 }, "notes": [ { "pitch": { "octave": 5, "step": "E" } } ] } ] } ] } ] } ] }

## Jumps (Dal Segno)

MusicXML uses `<segno>` to specify the visual segno symbol and `<sound>` elements with `segno` or `dalsegno` attributes to specify the playback instructions.

MNX uses `"jump"` within the `"global"` section of the document. The `"type"` specifies what kind of jump it is, and `"location"` specifies the target of the jump. This data together represents both the visual notation and the playback instructions.

### MusicXML

<score-partwise version="3.1"> <part-list> <score-part id="P1"> <part-name>Music</part-name> </score-part> </part-list> <part id="P1"> <measure number="1"> <attributes> <divisions>256</divisions> <key> <fifths>0</fifths> <mode>major</mode> </key> <time> <beats>4</beats> <beat-type>4</beat-type> </time> <clef> <sign>G</sign> <line>2</line> </clef> </attributes> <note> <pitch> <step>C</step> <octave>5</octave> </pitch> <duration>1024</duration> <type>whole</type> </note> </measure> <measure number="2">
<direction> <direction-type> <segno></segno> </direction-type> <sound segno="2"></sound> </direction>
<note> <pitch> <step>E</step> <octave>5</octave> </pitch> <duration>1024</duration> <type>whole</type> </note> </measure> <measure number="3"> <note> <pitch> <step>C</step> <octave>5</octave> </pitch> <duration>1024</duration> <type>whole</type> </note> </measure> <measure number="4"> <note> <pitch> <step>F</step> <octave>5</octave> </pitch> <duration>1024</duration> <type>whole</type> </note> </measure> <measure number="5"> <note> <pitch> <step>C</step> <octave>5</octave> </pitch> <duration>1024</duration> <type>whole</type> </note>
<direction> <direction-type> <words>D.S.</words> </direction-type> <sound dalsegno="2"></sound> </direction>
</measure> </part> </score-partwise>

### MNX

{ "mnx": { "version": 1 }, "global": { "measures": [ { "time": { "count": 4, "unit": 4 } }, { "segno": { "location": { "fraction": [ 0, 1 ] } } }, {}, {}, { "jump": { "type": "segno", "location": { "fraction": [ 1, 1 ] } } } ] }, "parts": [ { "measures": [ { "clefs": [ { "clef": { "sign": "G", "staffPosition": -2 } } ], "sequences": [ { "content": [ { "duration": { "base": "whole" }, "notes": [ { "pitch": { "octave": 5, "step": "C" } } ] } ] } ] }, { "sequences": [ { "content": [ { "duration": { "base": "whole" }, "notes": [ { "pitch": { "octave": 5, "step": "E" } } ] } ] } ] }, { "sequences": [ { "content": [ { "duration": { "base": "whole" }, "notes": [ { "pitch": { "octave": 5, "step": "C" } } ] } ] } ] }, { "sequences": [ { "content": [ { "duration": { "base": "whole" }, "notes": [ { "pitch": { "octave": 5, "step": "F" } } ] } ] } ] }, { "sequences": [ { "content": [ { "duration": { "base": "whole" }, "notes": [ { "pitch": { "octave": 5, "step": "C" } } ] } ] } ] } ] } ] }

## Jumps (D.S. al Fine)

MusicXML uses `<segno>` to specify the visual segno symbol and `<words>` for the textual instructions. (Parsers need to interpret the text to extract semantic meaning.) For the playback instructions, MusicXML uses the `<sound>` element.

MNX uses `"jump"` within the `"global"` section of the document. The `"type"` specifies what kind of jump it is, and `"location"` specifies the target of the jump. This data together represents both the visual notation and the playback instructions.

### MusicXML

<score-partwise version="3.1"> <part-list> <score-part id="P1"> <part-name>Music</part-name> </score-part> </part-list> <part id="P1"> <measure number="1"> <attributes> <divisions>256</divisions> <key> <fifths>0</fifths> <mode>major</mode> </key> <time> <beats>4</beats> <beat-type>4</beat-type> </time> <clef> <sign>G</sign> <line>2</line> </clef> </attributes> <note> <pitch> <step>C</step> <octave>5</octave> </pitch> <duration>1024</duration> <type>whole</type> </note> </measure> <measure number="2">
<direction> <direction-type> <segno></segno> </direction-type> <sound segno="m2"></sound> </direction>
<note> <pitch> <step>E</step> <octave>5</octave> </pitch> <duration>1024</duration> <type>whole</type> </note> </measure> <measure number="3"> <note> <pitch> <step>C</step> <octave>5</octave> </pitch> <duration>1024</duration> <type>whole</type> </note>
<direction> <direction-type> <words>fine</words> </direction-type> <sound fine="yes"></sound> </direction>
</measure> <measure number="4"> <note> <pitch> <step>F</step> <octave>5</octave> </pitch> <duration>1024</duration> <type>whole</type> </note> </measure> <measure number="5"> <note> <pitch> <step>C</step> <octave>5</octave> </pitch> <duration>1024</duration> <type>whole</type> </note>
<direction> <direction-type> <words>D.S. al Fine</words> </direction-type> <sound dalsegno="m2"></sound> </direction>
</measure> </part> </score-partwise>

### MNX

{ "mnx": { "version": 1 }, "global": { "measures": [ { "time": { "count": 4, "unit": 4 } }, { "segno": { "location": { "fraction": [ 0, 1 ] } } }, { "fine": { "location": { "fraction": [ 1, 1 ] } } }, {}, { "jump": { "type": "dsalfine", "location": { "fraction": [ 1, 1 ] } } } ] }, "parts": [ { "measures": [ { "clefs": [ { "clef": { "sign": "G", "staffPosition": -2 } } ], "sequences": [ { "content": [ { "duration": { "base": "whole" }, "notes": [ { "pitch": { "octave": 5, "step": "C" } } ] } ] } ] }, { "sequences": [ { "content": [ { "duration": { "base": "whole" }, "notes": [ { "pitch": { "octave": 5, "step": "E" } } ] } ] } ] }, { "sequences": [ { "content": [ { "duration": { "base": "whole" }, "notes": [ { "pitch": { "octave": 5, "step": "C" } } ] } ] } ] }, { "sequences": [ { "content": [ { "duration": { "base": "whole" }, "notes": [ { "pitch": { "octave": 5, "step": "F" } } ] } ] } ] }, { "sequences": [ { "content": [ { "duration": { "base": "whole" }, "notes": [ { "pitch": { "octave": 5, "step": "C" } } ] } ] } ] } ] } ] }