Musical directions are used for the expression marks in a musical score that are not clearly tied to a particular note. The beginning of the voice part in measure 2, for instance, looks like this:
<direction placement="above"> <direction-type> <words default-x="15" default-y="15" font-size="9" font-style="italic">dolce</words> </direction-type> </direction> <note default-x="27"> <pitch> <step>G</step> <octave>4</octave> </pitch> <duration>24</duration> <voice>1</voice> <type>quarter</type> <stem default-y="6">down</stem> <lyric default-y="-80" number="1"> <syllabic>single</syllabic> <text>Dans</text> </lyric> </note> <direction placement="above"> <direction-type> <wedge default-y="20" type="crescendo"/> </direction-type> <offset>-8</offset> </direction>
This indicates that the “dolce” mark starts a little more than one space before the first note in a 9 point italic font, while the crescendo wedge starts two-thirds of the way between the first and second notes in the measure. The placement attribute is used to indicate whether the directions go above or below the staff. The default-x and default-y attributes provide more precise positioning, and use units of tenths of interline space. For these elements, the default-x attribute is measured from the start of the current measure (for other elements, it is measured from the left-hand side of the note or the musical position within the bar.) The default-y attribute is measured from the top barline of the staff. The offset element measures horizontal distance in terms of divisions, just like the duration element.
If two directions go together, they can be linked by having multiple direction-type elements within a single direction. A MusicXML direction-type can contain many different elements, including words, dynamics, wedge, segno, coda, rehearsal, dashes, pedal, metronome, and octave-shift (for 8va and related marks).
Elements that continue over time have a type attribute to indicate the start and end points, as well as positioning when continued over system breaks. For a wedge, the type may be crescendo, diminuendo, stop, or continue. For octave-shift, the choices are up, down, stop, or continue. The shift indicates whether the note appears up or down from the sounding pitch, so the start of an 8va has a type of down. For dashes, the choices are start or stop. For pedal, the choices are start, stop, sostenuto, continue, or change. The continue value is used with pedal lines to indicate a pedal lift and retake.