

A written "C" on this part will sound as a B-flat on a piano. Say we have a part written for a trumpet in B-flat. The, , and elements are optional elements. The element, representing the number of chromatic steps to add to the written pitch, is the one required element. The element represents what must be added to the written pitch to get the correct sounding pitch. If you are writing a part for a transposing instrument, the transposition must be specified in MusicXML in order for the sound output to be correct. Many variations are possible, including composite and interchangeable time signatures. The element represents the time signature numerator, and the element represents the time signature denominator. Standard time signatures are represented more directly in MusicXML than in MIDI 1.0. MusicXML uses the element to indicate major or minor key signatures. The fifths name indicates that this value represents the key signature's position on the circle of fifths. The element specifies the number of flats or sharps in the key signature - negative for flats, positive for sharps. Standard key signatures are represented like MIDI key signatures. The divisions value of 24 in this example allows for both triplet eighth notes (being divisible by 3) and regular sixteenth notes (being divisible by 4). However for the broadest app compatibility, it is best to compute just one value per part, placed at the beginning of the first measure. MusicXML allows the element value to change in the middle of a part. While each musical note could have a fraction associated with it, MusicXML instead follows MIDI by specifying the number of divisions per quarter note at the start of a musical part, and then specifying note durations in terms of these divisions. Musical durations are commonly referred to as fractions: whole notes, half notes, quarter notes, and the like.

In this example, we have the following MIDI-compatible attributes: Other elements like and are discussed later in this tutorial. We discuss the MIDI-compatible elements here. The element contains information about time signatures, key signatures, transpositions, clefs, and other musical data that is usually specified at the beginning of a piece or at the start of a measure. This is where we will start in introducing the musical elements of a MusicXML file.Īs an example, we will use the first four bars of "Après un rêve" by Gabriel Fauré: The only elements that are required, though, are the sounding elements that relate directly to creating a MIDI file from MusicXML. We encourage programs writing MusicXML to write as much accurate data as they can. The other set of elements are used to represent a sonic realization of the score, and are commonly used for MIDI playback. These elements are used for displaying sheet music on screen or in print. One set of elements is used to represent how a piece of music is notated. MusicXML consists of two main types of elements.
