The attributes 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. We discuss the MIDI-compatible elements here; the rest are discussed in the following sections.
In this example, our Finale translator produces the following MIDI-compatible attributes:
<attributes> <divisions>24</divisions> <key> <fifths>-3</fifths> <mode>minor</mode> </key> <time> <beats>3</beats> <beat-type>4</beat-type> </time> </attributes>
Musical durations are commonly referred to as fractions: whole notes, half notes, quarter notes, and the like. 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.
MusicXML allows divisions to change in the middle of a part, but most software will probably find it easiest to compute one divisions value per part and put that at the beginning of the first measure. The divisions value of 24 in this example allows for both triplet eighth notes (duration of 8) and regular sixteenth notes (duration of 6).
Standard key signatures are represented very much like MIDI key signatures. The fifths element specifies the number of flats or sharps in the key signature – negative for flats, positive for sharps. The fifths name indicates that this value represents the key signature’s position on the circle of fifths. MusicXML uses the mode element to indicate major or minor key signatures.
Standard time signatures are represented more simply in MusicXML than in MIDI. The beats element represents the time signature numerator, and the beat-type element represents the time signature denominator (vs. a log denominator in MIDI).
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. The transpose element represents what must be added to the written pitch to get the correct sounding pitch.
The chromatic element, representing the number of chromatic steps to add to the written pitch, is the one required element. The diatonic, octave-change, and double elements are optional elements.
Say we have a part written for a trumpet in B-flat. A written “C” on this part will sound as a B-flat on a piano. This transposition is one diatonic step down (C to B) and two chromatic half steps down (C to B to B-flat). In MusicXML it would be represented as:
<transpose> <diatonic>-1</diatonic> <chromatic>-2</chromatic> </transpose>
The diatonic element is not needed for correct MIDI output, but it helps get transposition notation correct and programs are encouraged to use it wherever possible.
The octave-change element is used when transpositions exceed an octave in either direction. The double element is used when the part should be doubled an octave lower, as when a single part is used for both cello and string bass.