MusicXML is a extensible markup language file format (filename extension .xml) based on XML, which is explicitly designed to store musical notation. Although the most user-friendly way to interact with MusicXML is to use a score editor software (e.g. Musescore), it is also quite possible to extract a lot of information from a MusicXML file using a conventional text editor (e.g. the Windows text editor or Atom).

The internal structure of a MusicXML file is built hierarchically and is defined by elements, tags and attributes (see XML key terminlogy, This illustrated by the following example :

The structure used within MusicXML is largely compliant with common markup language standards and uses the MusicXML W3C XML schema. A detailed overview of this is available here. The MEI format, which is also used for digital sheet music editions, is tied and compatible to the MusicXML format.

Specification of work and composer

The information on work and composer is usually stored at the beginning of a MusicXML file and is defined by the tags <work> and <creator>.

In the following example, we can see what information is contained in the MusicXML version of the first movement of the Missa „La sol fa re mi“ by Josquin Desprez (here the link to the score):

In addition to the data contained within the <work> tag, there is additional information about the work („Kyrie“) contained within, for example, <movement-title> and as a „parentTitle“ attribute in <miscellaneous> tags. Python-based MusicXML parsing tools, such as music21, can use this information for metadata searching. After metadata parsing by music21 the information contained in the example looks like this:

Thus, by using certain tags and attributes in the MusicXML file, one defines the information read, which is crucial, for example, for building a corpus for a corpus study. An overview of the tags and attributes read by music21 in the context of metadata search can be found here.

Voice and instrument information

Usually, all information about the voices contained in a MusicXML file is defined within the <part-list> tag. This contains not only the name of the instrument (<part-name>), but also information that is provided in order to play the file within a score editor (various midi tags). In the following example we see the complete description of a voice:


Then, in the main part of the xml file follow the time signature, clef and note elements, divided by voices (<part id>) measure numbers (<measure>). It is important to note that many of the data relate to the score layout and only selected tags refer to pitch and duration. In the following, you find a hierarchical overview:

Besides the already mentioned subdivision to <part id> and <measure>, especially the tags <attributes> as well as <note> contain all relevant information about the pitch and rhythm of the sheet music contained in the MusicXML file. <attributes> usually contains all information about the measure itself, such as clef (<clef>), time signature (<time> as well as <beats> and <beat-type>) and accidental (<key>). <divisions> contains the information about the smallest possible rhythmic subdivision of the beat, and is given in fractions of a quarter. This value is necessary to be able to specify the durations of the respective notes exactly, even for more complex rhythmic groupings. The exact formula for calculating the note values in quarters is then called <duration>-value : <divisions>-value. As an example, here is the first note from the Josquin's example mentioned above:

80640 : 10080 = 8 or 8 quarter notes or 2 whole notes. This corresponds exactly to the Brevis A in measure 1 of the first voice (Superius). Pitch specifications (<pitch>) are defined by tags <step>, <alter> and <octave>.

Since a score can contain many measures and countless notes, uncompressed xml files may be very large - up to tens of megabytes!

  • en/musicxml.txt
  • Zuletzt geändert: 2021/10/27 09:25
  • von andres_romero