8. Common Music Notation Ornaments

This module includes elements and attributes for the encoding of ornaments typical of ‘Common Music Notation’ (CMN). Ornaments are formulae of embellishment that can be realized by adding supplementary notes to one or more notes of the melody. In written form, these are usually expressed as symbols written above or below a note, though some have a more complex written expression, such as those that involve multiple notes and/or include grace notes.

These symbols may have different resolutions depending on a large number of factors, such as historical context, national boundaries, composer, scribe, etc. The elements described here, therefore, are not bound to a specific symbol; they are, instead, meant to encode the encoder’s interpretation of a symbol and its position on the staff.

Nonetheless, in order to establish common ground, the guidelines suggest commonly accepted symbols and realizations for the ornaments supported by MEI.

The following sections will introduce each element in detail for all types of ornaments supported.

8.1. Encoding Common To All Ornaments

When encoding CMN, ornaments should be encoded within a measure, following the staff elements, and connected to events on the staff via attributes. The @startid attribute is used to refer to the @xml:id of the starting note. Additionally, if the ornament involves more than one events on the staff, the @endid attribute can be used to anchor the ornament to a concluding event.

The following example demonstrates the encoding of an inverted mordent over a middle C:

<measure n="1">
   <staff n="1">
      <layer n="1">
         <note dur="4" oct="4" pname="c" xml:id="cmnOrnaments.co_1_n1"></note>
      </layer>
   </staff>
   <mordent form="inv" place="above" staff="1" startid="co_1_n1"></mordent>
</measure>

Alternatively, the relationship of an ornament to a note can be expressed in terms of beats with the attribute @tstamp. If the ornament involves more than one event on the staff, the @tstamp2 attribute can be used to indicate the ending time stamp, as is explained in section Timestamps and Durations. These methods may also be utilized simultaneously.

The following example shows the use of @tstamp for an ornament. Assuming that the following measure is in 2/2, the ornament (in this case, a mordent) is related to the note on the second beat.

<measure n="1">
   <staff n="1">
      <layer n="1">
         <note dur="2" oct="4" pname="c"></note>
         <note dur="2" oct="4" pname="c"></note>
      </layer>
   </staff>
   <mordent form="inv" place="below" staff="1" tstamp="2"></mordent>
</measure>

The relationship between an ornament and the notes on staff must always be encoded. It is, in fact, a semantic error not to specify a starting event or time stamp for an ornament.

In their resolution, ornaments will involve auxiliary notes, which typically follow the key signature or the scale of the current key. When the ornament involves other chromatic auxiliaries, an accidental is expressed next to or above the ornament sign. The attributes @accidlower and @accidupper, available on all ornaments described in this chapter, can be used to record this accidental. The attribute values ‘upper’ and ‘lower’ indicate whether the accidental is associated with an upper or lower auxiliary note, not the position of the accidental sign.

8.1.1. Overriding Default Resolutions

The symbols and sounded resolutions suggested for each ornament in this chapter are to be considered defaults. Nevertheless, because of the great historical and geographical variance in the notation of ornaments, the encoder is given methods to override the default resolutions.

It is possible, for example, to specify in the meiHead a new default sounded resolution for an ornament. As discussed in the section Encoding Description, the element encodingDesc holds a description (optional, but recommended) of the methods and editorial principles which govern the transcription or encoding of the source material. Let us take a trill as an example. The section regarding Trills does not set a specific number of alternations between the principal and secondary notes; the encoder, however, may specify an exact number in the encoding description.

<encodingDesc>
   <editorialDecl>
      <p>All trills should be resolved by playing three alternations.</p>
   </editorialDecl>
</encodingDesc>

Alternatively, resolutions can be defined on a case-by-case basis by encoding a specific resolution using the choice element. See the section Special Cases below for an example of a specific resolution of a trill.

8.2. Mordents

A mordent is an ornament that involves an auxiliary note a step above or below the principal note. The presence of a mordent is encoded with the mordent element and its attributes:

An ornament indicating rapid alternation of the main note with a secondary note, usually a step below, but sometimes a step above.
Traditionally, the 'normal' mordent is written as a short wavy line with a vertical line through it and the inverted mordent is written without the vertical line. However, the meaning of these signs is sometimes reversed. See Read, p. 245-246. Another attribute in the visual domain would be necessary in order to be completely explicit about which visual symbol is actually to be rendered.
When the long attribute is set to 'yes', a double or long mordent, consisting of 5 notes, is indicated.
Records the written accidental associated with a lower neighboring note.
Records the written accidental associated with an upper neighboring note.

It is recommended, but not required, to use the attribute @form to encode the typology of mordents. Two common types are supported: those mordents that involve a note lower than the principal note, and those that involve a note higher than the principal note.

The attribute @form accepts the following values:

norm: usually corresponding to the symbol: . This mordent is commonly performed as the principal note, followed by its lower neighbor, with a return to the principal note.

inv: usually corresponding to the symbol: . This mordent is commonly performed as the principal note, followed by its upper neighbor, with a return to the principal note.

The following example demonstrates the encoding of simple mordents:

musical example
Example of simple mordent
<measure n="1">
   <staff n="1">
      <layer n="1">
         <note dur="4" oct="5" pname="c" stem.dir="down"></note>
         <note dur="4" oct="4" pname="g" stem.dir="up"></note>
         <note dur="4" oct="4" pname="b" stem.dir="down"></note>
         <note dur="4" oct="5" pname="c" stem.dir="down"></note>
      </layer>
   </staff>
   <mordent form="inv" staff="1" tstamp="1"></mordent>
</measure>

Occasionally, mordents can be longer, employing five notes instead of three. The @long attribute can be used to identify mordents of this type. The following example shows the encoding of a long mordent:

musical example
Example of a long mordent
<measure n="1">
   <staff n="1">
      <layer n="1">
         <note dur="4" oct="5" pname="c" stem.dir="down"></note>
         <note dur="4" oct="4" pname="g" stem.dir="up"></note>
         <note dur="4" oct="4" pname="b" stem.dir="down"></note>
         <note dur="4" oct="5" pname="c" stem.dir="down"></note>
      </layer>
   </staff>
   <mordent form="inv" long="true" staff="1" tstamp="1"></mordent>
</measure>

8.3. Trills

Trills are a type of ornament that consists of a rapid alternation of a note with one a semitone or tone above. A trill is encoded with the trill element and its attributes:

Rapid alternation of a note with another (usually at the interval of a second above).
Records the written accidental associated with a lower neighboring note.
Records the written accidental associated with an upper neighboring note.

Trills in modern notation are usually expressed with the abbreviation “tr” above a note on the staff. Often the abbreviation is followed by a wavy line that indicates the length of the trill.

The following example demonstrates the encoding of simple trills:

musical example
Example of simple trills.
<measure n="1">
   <staff n="1">
      <layer n="1">
         <note dur="4" oct="4" pname="f" stem.dir="up"></note>
         <note dur="4" oct="4" pname="a" stem.dir="up"></note>
         <rest dur="8"></rest>
         <note dur="8" oct="5" pname="c" stem.dir="down"></note>
         <note dur="4" oct="5" pname="e" stem.dir="down"></note>
      </layer>
   </staff>
   <trill place="above" staff="1" tstamp="1"></trill>
   <trill accidupper="f" place="above" staff="1" tstamp="2"></trill>
   <trill place="above" staff="1" tstamp="3.5"></trill>
   <trill accidupper="s" place="above" staff="1" tstamp="4"></trill>
</measure>

It has been specified earlier that it is a semantic error not to encode a starting event or time stamp for an ornament. This starting point of a trill can be expressed with the @startid attribute and/or with the @tstamp attribute. Specifying the end point is not required, although the @tstamp2 attribute can be used to indicate the use of a wavy line extender as shown in this example:

musical example
Example of trills followed by wavy lines.
<scoreDef>
   <staffGrp>
      <staffDef clef.line="2" clef.shape="G" key.sig="2f" lines="5" n="1"></staffDef>
   </staffGrp>
</scoreDef>
<section>
   <measure n="1">
      <staff n="1">
         <layer n="1">
            <note dur="4" oct="4" pname="f" stem.dir="up"></note>
            <note dur="4" oct="5" pname="d" stem.dir="up"></note>
            <note dur="4" oct="5" pname="d" stem.dir="down"></note>
            <note dur="4" oct="5" pname="g" stem.dir="down"></note>
         </layer>
      </staff>
      <trill place="above" staff="1" tstamp="1" tstamp2="2"></trill>
      <trill place="above" staff="1" tstamp="2" tstamp2="3"></trill>
      <trill accidupper="n" place="above" staff="1" tstamp="3" tstamp2="4"></trill>
      <trill accidupper="f" place="above" staff="1" tstamp="4" tstamp2="5"></trill>
   </measure>
</section>

Chromatic alterations of auxiliary notes are occasionally expressed on the staff using small notes enclosed in parentheses, as shown in the example below. However, the attribute @accidupper is still to be used to encode the alteration. Display of the auxiliary note in this ‘cautionary’ manner is left to down-stream rendering processes.

musical example
Example alterations expressed on the staff.
<measure n="1">
   <staff n="1">
      <layer n="1">
         <note dur="2" oct="4" pname="g" stem.dir="up"></note>
      </layer>
   </staff>
   <trill accidupper="f" place="above" staff="1" tstamp="1"></trill>
</measure>

Some trills may be introduced by a turn or followed by an inverted turn leading to the next note (see Le garzantine, Musica 2003, p. 911). In such cases, the trill is encoded as in previous examples and associated with the principal note. Starting or concluding turns are notated on the staff (in layer) as Grace Notes.

The following example, from a keyboard sonata by Joseph Haydn, shows a trill with concluding grace notes:

musical example
Haydn, Sonata in D major, Hoboken XVI:33 (Wiener Urtex no. 34), mvmt. 1.
<measure n="2" xml:id="cmnOrnaments.d1e412">
   <staff n="1">
      <layer n="1">
         <note accid.ges="s" dur="32" grace="unacc" oct="6" pname="c" stem.dir="up" xml:id="cmnOrnaments.d1e414"></note>
         <note dur="2" oct="5" pname="b" stem.dir="down" xml:id="cmnOrnaments.d1e432"></note>
         <beam>
            <note dur="32" grace="unacc" oct="5" pname="a" stem.dir="up"></note>
            <note dur="32" grace="unacc" oct="5" pname="b" stem.dir="up"></note>
         </beam>
      </layer>
   </staff>
   <trill ho="+1" place="above" staff="1" tstamp="1" tstamp2="2.5" vo="6.5"></trill>
</measure>

8.3.1. Special Cases

Symbols and abbreviations for trills have changed and evolved considerably throughout history. Strategies to clarify the encoding and interpretation of ornaments have been discussed in section Overriding Default Resolutions above. However, in order to aid the encoder in making educated choices in the encoding of non-standard trills, this section shows two examples diverging from modern standard use.

The abbreviation “tr” followed by a wavy line spanning multiple notes is sometimes used to indicate multiple trills:

musical example
Example of multiple trills.

The encoding of this kind of trill may vary depending on the purpose of the encoding. For representation of the source, a single trill is sufficient:

<measure n="1">
   <staff n="1">
      <layer n="1">
         <note dur="4" oct="4" pname="f" stem.dir="up"></note>
         <note dur="4" oct="4" pname="a" stem.dir="up"></note>
         <rest dur="8"></rest>
         <note dur="8" oct="5" pname="c" stem.dir="down"></note>
         <note dur="4" oct="5" pname="e" stem.dir="down"></note>
      </layer>
   </staff>
   <trill place="above" staff="1" tstamp="1" tstamp2="0m+4"></trill>
</measure>

To support analytical and aural rendering applications, however, each trill may be explicitly encoded, as the following example demonstrates:

<measure n="1">
   <staff n="1">
      <layer n="1">
         <note dur="4" oct="4" pname="f" stem.dir="up"></note>
         <note dur="4" oct="4" pname="a" stem.dir="up"></note>
         <rest dur="8"></rest>
         <note dur="8" oct="5" pname="c" stem.dir="down"></note>
         <note dur="4" oct="5" pname="e" stem.dir="down"></note>
      </layer>
   </staff>
   <trill place="above" staff="1" tstamp="1"></trill>
   <trill accidupper="f" place="above" staff="1" tstamp="2"></trill>
   <trill place="above" staff="1" tstamp="3.5"></trill>
   <trill accidupper="s" place="above" staff="1" tstamp="4"></trill>
</measure>

However, when it is necessary to support multiple outputs, use of the choice element and appropriate sub-elements is recommended. In this case, the orig and reg elements can be used to represent the original source and a regularization provided by the editor, respectively:

<choice>
   <orig>
      <trill place="above" staff="1" tstamp="1" tstamp2="0m+4"></trill>
   </orig>
   <reg>
      <trill place="above" staff="1" tstamp="1"></trill>
      <trill accidupper="f" place="above" staff="1" tstamp="2"></trill>
      <trill place="above" staff="1" tstamp="3.5"></trill>
      <trill accidupper="s" place="above" staff="1" tstamp="4"></trill>
   </reg>
</choice>

Another situation that requires disambiguation of an ornament’s name and its potential rendition is due to the fact that the symbols for trills and mordents have been often used interchangeably in the past. The following example, taken from Klavierbüchlein für Wilhelm Friedemann Bach (1720), shows a trill (Trillo) identified by the symbol associated with a mordent in modern practice. Nonetheless, J.S. Bach’s suggested resolution should be encoded with a variant of the procedure presented above.

In the example below, the child elements of choice; that is, orig and reg, represent non-exclusive options; that is, both may be processed by applications that aim to support both visual and aural renditions.

musical example
Trill transcribed from J.S. Bach's "Klavierbüchlein für Wilhelm Friedemann Bach" (1720)
<measure n="1">
   <staff n="1">
      <layer n="1">
         <note dur="4" oct="5" pname="c" stem.dir="down"></note>
      </layer>
   </staff>
   <choice>
      <orig>
         <trill place="above" staff="1" tstamp="1"></trill>
      </orig>
      <reg>
         <note dur="32" oct="5" pname="d"></note>
         <note dur="32" oct="5" pname="c"></note>
         <note dur="32" oct="5" pname="d"></note>
         <note dur="32" oct="5" pname="c"></note>
         <note dur="32" oct="5" pname="d"></note>
         <note dots="1" dur="16" oct="5" pname="c"></note>
      </reg>
   </choice>
</measure>

Depending on the purpose of the encoding, it may be more convenient to encode the regularized text within the stream of events, along with a corresponding choice with regard to the existence of the trill marking, as in the following example:

<measure>
   <staff>
      <layer>
         <choice>
            <orig>
               <note dur="4" oct="5" pname="c" stem.dir="down"></note>
            </orig>
            <reg>
               <note dur="32" oct="5" pname="d"></note>
               <note dur="32" oct="5" pname="c"></note>
               <note dur="32" oct="5" pname="d"></note>
               <note dur="32" oct="5" pname="c"></note>
               <note dur="32" oct="5" pname="d"></note>
               <note dots="1" dur="16" oct="5" pname="c"></note>
            </reg>
         </choice>
      </layer>
   </staff>
   <choice>
      <orig>
         <trill place="above" staff="1" tstamp="1"></trill>
      </orig>
      <reg></reg>
   </choice>
</measure>

The orig element contains the single-note-with-trill transcription of the original text, while the reg element represents the realization-without-trill version.

This approach facilitates substitution of the realization of the trill for the original written note (as well as the opposite procedure) and is therefore the recommended markup for applications where exchange of this kind is desirable.

8.4. Turns

A turn is an ornament that typically consists of four notes: the upper neighbor of the principal note, the principal note, the lower neighbor, and the principal note again.

The presence of a turn is encoded with the turn element and its attributes:

Indicates the style of the turn.
When the delayed attribute is set to 'true', the turn begins on the second half of the beat. See Read, p. 246.
Records the written accidental associated with a lower neighboring note.
Records the written accidental associated with an upper neighboring note.

It is recommended, but not required, to use the attribute @form to encode the typology of the turn.

The attribute @form accepts the following values:

norm: usually corresponding to the symbol: . This turn is commonly performed beginning on a note higher than the principal note.

inv: usually corresponding to the symbol: . This turn is commonly performed beginning on a note lower than the principal note.

The following example shows the encoding of a simple turn:

musical example
Example of a simple turn.
<measure n="1">
   <staff n="1">
      <layer n="1">
         <note dur="4" oct="5" pname="g" stem.dir="down"></note>
         <note dur="4" oct="5" pname="d" stem.dir="down"></note>
         <note dur="4" oct="5" pname="e" stem.dir="down"></note>
         <note dur="4" oct="5" pname="c" stem.dir="down"></note>
      </layer>
   </staff>
   <turn form="norm" staff="1" tstamp="1"></turn>
</measure>

Turns can sometimes be performed after the principal note (usually on the second half of the beat, see Read 1979, p. 246) and leading to the following event. To indicate this, the turn symbol is typically written in between the principal note and the next. These kind of turns are encoded with the attribute @delayed.

The following example from Beethoven’s piano sonata no. 1 in F minor, op. 2, no. 1, mvmt. 2 demonstrates the encoding of turns with the @delayed attribute. Note that the @tstamp attribute indicates the actual starting point in time, while @startid points to the principal note.

musical example
Delayed turn.
<measure>
   <staff n="1">
      <layer n="1">
         <note dots="1" dur="4" oct="5" pname="g" stem.dir="down" tie="i"></note>
         <beam>
            <note dots="1" dur="16" oct="5" pname="g" stem.dir="down" tie="t"></note>
            <note dur="32" oct="5" pname="a" stem.dir="down"></note>
         </beam>
      </layer>
   </staff>
   <turn accidlower="s" place="above" staff="1" tstamp="2.75"></turn>
</measure>

8.5. Other Ornaments

CMN ornaments that are not mordents, trills, or turns can be encoded with a generic ornam.

This element allows the encoder to represent ornaments as textual strings (e.g. with a Unicode symbol) or with a user defined symbol. Chromatic auxiliaries can be represented with @accidlower and @accidupper. The ornam element can also be a control element. That is, it can be linked via its attributes to other events. The starting point of the directive may be indicated by either a tstamp, tstamp.ges, tstamp.real or startid attribute, while the ending point may be recorded by either a tstamp2, dur, dur.ges or endid attribute. It is a semantic error not to specify a starting point attribute.

For example, Johann Sebastian Bach used non-standard ornaments in the Klavierbüchlein für Wilhelm Friedemann Bach:

musical example
Table of ornaments used by Johann Sebastian Bach in the Klavierbüchlein für Wilhelm Friedemann Bach

The ornament for (5) doppelt-cadence could be encoded in the following way, by adopting the Unicode code-points defined by the SMuFL standard:

<ornament tstamp="1">&amp;#xe5c0;</ornament>

A resolution, or expansion of the ornament can be provided as discussed in Special Cases below.

8.6. Ornaments in Combinations

Particularly in baroque keyboard music, but also in the early classical period, various combinations of ornaments can be found. Despite being written vertically above the same note, they are to be performed in sequence.

The following example from C.P.E. Bach’s sonata W.62/1 shows a turn followed by a inverted mordent:

musical example
Example of multiple ornaments. From C.P.E. Bach's sonata W.62/1.

When encoding the example above, both ornaments will be positioned above the same note. The encoded order of the elements, moreover, should correspond to the performed sequence, which in this example is top to bottom: first the turn, then the mordent.

<measure n="3">
   <staff n="1">
      <layer n="1">
         <note dur="8" grace="unknown" oct="5" pname="f" stem.dir="up"></note>
         <note dur="4" oct="5" pname="e" stem.dir="down" xml:id="cmnOrnaments.co_m_1_n1"></note>
         <beam>
            <note dur="16" oct="5" pname="d" stem.dir="up"></note>
            <note accid="s" dur="16" oct="4" pname="f" stem.dir="up"></note>
            <note dur="16" oct="4" pname="g" stem.dir="up"></note>
            <note dur="16" oct="5" pname="e" stem.dir="up"></note>
         </beam>
         <note dur="8" grace="unknown" oct="5" pname="d" stem.dir="up"></note>
         <note dur="4" oct="5" pname="c" stem.dir="up" xml:id="cmnOrnaments.co_m_1_n2"></note>
      </layer>
   </staff>
   <turn form="norm" staff="1" startid="#co_m_1_n1"></turn>
   <mordent form="inv" staff="1" startid="#co_1_m_n1"></mordent>
   <turn form="norm" staff="1" startid="#co_m_1_n2"></turn>
   <mordent form="inv" staff="1" startid="#co_m_1_n2"></mordent>
</measure>