4. Common Music Notation

The module described in this chapter offers the means to describe music in so-called ‘Common Music Notation’ (CMN, sometimes referred to as ‘Common Western Music Notation’). For this purpose, it provides a number of special elements and adds several attribute classes to elements from the Shared Elements, Models, and Attributes module.

4.1. Basic Elements of CMN

This section describes the use of basic features of MEI important for encoding CMN material. Most of the elements discussed here are defined in chapter Shared Elements, Models, and Attributes of these Guidelines, but are used in music from the CMN repertoire in specialized ways.

4.1.1. The Role of the Measure Element

Arguably, the most important element of the CMN module is the measure element. It is used as a structural unit inside section elements and acts as a container for ‘events’ from the model.eventLike class, such as notes, chords and rests as well as ‘control events’ from the model.controleventLike class, such as slurs and indications of dynamics.

The following example demonstrates the use of the measure element:

<section>
   <measure n="1">
      <staff n="1">
         <layer>
            <chord dur="1">
               <note oct="5" pname="c"></note>
               <note oct="4" pname="g"></note>
               <note oct="4" pname="e"></note>
            </chord>
         </layer>
      </staff>
      <staff n="2">
         <layer>
            <note dur="1" oct="3" pname="c"></note>
         </layer>
      </staff>
   </measure>
</section>

A measure slices the flow of a score or part into chunks that normally comply with a duration determined by the meter defined within a preceding scoreDef or staffDef element. Each staff in the source material is represented by a staff element. As the order of the staff elements in the file does not have to reflect their order in the original document, to eliminate confusion they should always refer to a staffDef element, using either an @n or @def attribute. Whereas the @def attribute uses the xs:anyURI datatype, the @n value refers to the closest preceding staffDef or layerDef with the same value in its @n attribute.

<staffDef n="3" xml:id="cmn_staffDef1"></staffDef>
<!-- later in the file: -->
<staff def="#cmn_staffDef1">
   <!-- @def refers to staffDef with this identifier -->
   <!-- staff content -->
</staff>
<!-- or: -->
<staff n="3">
   <!-- @n refers to staffDef with this numeric label -->
   <!-- staff content -->
</staff>

Each staff may hold a number of layer elements to reflect multiple ‘voices’. Just as with staff, the order of the layer elements in the file does not have to reflect their original order in the document, so they also possess @n and @def attributes for association with the appropriate layer definition.

<staffDef n="3" xml:id="cmn_staffDef1">
   <layerDef n="1" xml:id="cmn_layerDef1"></layerDef>
</staffDef>
<!-- later in the file: -->
<staff def="#cmn_staffDef1">
   <layer def="#cmn_layerDef1">
      <!-- layer content -->
   </layer>
</staff>
<!-- OR: -->
<staff n="3">
   <layer n="1">
      <!-- layer content -->
   </layer>
</staff>

4.1.2. Defining Score Parameters for CMN

When encoding a score in CMN, MEI relies on the following elements from the Shared Elements, Models, and Attributes module:

(score definition) – Container for score meta-information.
(staff group) – A group of bracketed or braced staves.
(staff definition) – Container for staff meta-information.
(layer definition) – Container for layer meta-information.

A scoreDef element is used to specify the common parameters of a score, e.g., key and meter. The most important attributes for this purpose are:

Captures the number of beats in a measure, that is, the top number of the meter signature. It must contain a decimal number or an additive expression that evaluates to a decimal number, such as 2+3.
Contains the number indicating the beat unit, that is, the bottom number of the meter signature.
Indicates the use of a meter symbol instead of a numeric meter signature, that is, 'C' for common time or 'C' with a slash for cut time.
Holds the pitch name of the tonic key, e.g. 'c' for the key of C.
Contains an accidental for the tonic key, if one is required, e.g., if key.pname equals 'c' and key.accid equals 's', then a tonic of C# is indicated.
Indicates major, minor, or other tonality.
Indicates where the key lies in the circle of fifths.

The following example describes a score in common time with 3 flats:

<scoreDef key.sig="3f" meter.count="4" meter.sym="common" meter.unit="4"></scoreDef>

Other attributes allow the description of default page and system margins and fonts for text and music:

Describes the width of the page; may be expressed in real-world units or staff steps.
Specifies the height of the page; may be expressed in real-world units or staff steps.
Indicates the amount of whitespace at the left side of a page.
Indicates the amount of whitespace at the top of a page.
Indicates the amount of whitespace at the right side of a page.
Indicates the amount of whitespace at the bottom of a page.
Describes the amount of whitespace at the left system margin relative to page.leftmar.
Describes the distance from page's top edge to the first system; used for first page only.
Describes the amount of whitespace at the right system margin relative to page.rightmar.
Provides a default value for the font name of text (other than lyrics) when this information is not provided on the individual elements.
Provides a default value for the font family name of text (other than lyrics) when this information is not provided on the individual elements.
Provides a default value for the font size of text (other than lyrics) when this information is not provided on the individual elements.
Sets the default music font name.
Sets the default music font size.
Sets the font name default value for lyrics.
Sets the font family default value for lyrics.
Sets the default font size value for lyrics.

There are other attributes that allow the specification of many further details of a score. These are available from the element definitions accessible at scoreDef, staffDef, staffGrp and layerDef.

When content is provided for scoreDef, it must contain a staffGrp element. This element is used to gather individual staves and other staff groups. This is useful for collecting instrumental or vocal groups in a large score, such as woodwinds, brasses, etc., and for assigning a shared label to the group, using the @label and @label.abbr attributes. The staffGrp element is also used for the two staves of a grand staff. The @barthru attribute on staffGrp allows one to specify whether barlines are drawn across the space between staves of that group or only on the staves themselves.

A staffDef element is used to describe an individual staff of a score or performer part. It bears most of the attributes described above, including @label and @label.abbr for providing staff labels for the first and subsequent pages.

Every staffDef must have an @n attribute with an integer as its value. The first occurence of a staffDef with a given number must also indicate the number of staff lines via the @lines attribute.

The order of staffDef elements within scoreDef follows the order of staves in the source document or planned rendering. The individual staff elements within a measure refer to these staffDef declarations using their own @n attribute values. Therefore, the encoding order of staves within a measure does not have to mimic the order of the staffDef elements with scoreDef.

In addition to the parameters inherited from scoreDef, the following attributes are important for staffDef elements:

Contains a default value for the position of the clef. The value must be in the range between 1 and the number of lines on the staff. The numbering of lines starts with the lowest line of the staff.
Encodes a value for the clef symbol.
Records the amount of octave displacement to be applied to the clef.
Records the direction of octave displacement to be applied to the clef.

A staff with a tenor clef is encoded as in the following example:

<staffDef clef.dis="8" clef.dis.place="below" clef.line="2" clef.shape="G"></staffDef>

In the case of transposing instruments, the key-related attributes described above may be used to override the written key expressed in the scoreDef element. As a basic principle, MEI always captures written pitches, so the @trans.diat and @trans.semi attributes may be used to indicate the number of diatonic steps and semitones to calculate sounded pitch from written pitch. The piccolo and E♭ clarinet staves in the example below utilize these attributes:

<scoreDef meter.count="6" meter.unit="8">
   <staffGrp>
      <!-- Piccolo sounds 12 semitones higher than written (and encoded in MEI). -->
      <staffDef clef.line="2" clef.shape="G" key.mode="major" key.sig="4f" label="Piccolo" label.abbr="Picc." lines="5" n="1" trans.diat="0" trans.semi="12" xml:id="cmn.P1"></staffDef>
      <staffDef clef.line="2" clef.shape="G" key.mode="major" key.sig="4f" label="Flute" label.abbr="Fl." lines="5" n="2" xml:id="cmn.P2"></staffDef>
      <staffDef clef.line="2" clef.shape="G" key.mode="major" key.sig="4f" label="Oboe" label.abbr="Ob." lines="5" n="3" xml:id="cmn.P3"></staffDef>
      <staffDef clef.line="4" clef.shape="F" key.mode="major" key.sig="4f" label="Bassoon" label.abbr="Bsn." lines="5" n="4" xml:id="cmn.P4"></staffDef>
      <!-- Clarinet sounds a minor third (two diatonic steps or three semitones) higher than written.  -->
      <staffDef clef.line="2" clef.shape="G" key.mode="major" key.sig="1f" label="Clarinet in E♭" label.abbr="E♭ Cl." lines="5" n="5" trans.diat="2" trans.semi="3" xml:id="cmn.P5"></staffDef>
   </staffGrp>
</scoreDef>

There are a number of additional elements that can be used as children of staffDef in order to describe additional features of the staff, such as the color of a clef or a key signature added in a different hand. These elements include:

Indication of the exact location of a particular note on the staff and, therefore, the other notes as well.
(clef group) – A set of simultaneously-occurring clefs.
(key signature) – Written key signature.
(key accidental) – Accidental in a key signature.
A container for text that identifies the feature to which it is attached.
(meter signature) – Written meter signature.
(meter signature group) – Used to capture alternating, interchanging, and mixed meter signatures.

With the exception of label, these elements may also occur within the flow of musical events captured in a layer, since they are members of model.eventLike. In the layer context they function as milestones and affect all following content assigned to the layer (even in subsequent measures) until their information is again overridden either by the same element bearing different information or a staffDef or scoreDef. In this context, it is also possible to combine them with the elements described in chapters Critical Apparatus and Editorial Markup of these Guidelines.

Such flexibility as this may require close inspection of an encoding to retrieve the correct definitions for a given staff. As a general rule, the closest preceding and most specific element provides this information: For example, a keySig in the preceding measure is more relevant than a staffDef at the beginning of the section, which is more relevant than a scoreDef at the beginning of the score. However, a section-specific scoreDef that provides only information about the meter does not override the more specific information about key signature gathered from a staffDef for a transposing instrument.

Every staffDef may contain a number of layerDef elements, which may be used to establish default values for the distinct layers sharing one staff. MEI does not use the term ‘voice’ to describe these ‘musical threads’ because that term implies continuity across measure boundaries. Given the sometimes arbitrary relationships between these threads from measure to measure as well as across staves, MEI uses the more neutral term ‘layer’.

4.1.3. Redefinition of Score Parameters

Sometimes it is necessary to provide the parameters of a score or a staff with new values. For example. a score may change keys, gain or lose staves, use different layout settings at any point, etc. Likewise, a staff may change its clef, gain or lose layers, or become invisible, and so on. To accommodate these circumstances, in CMN staffDef is allowed to occur in the following locations:

  • within the description of staff groups; that is, in staffGrp,
  • within the content of a measure,
  • between measures; that is, directly within section and ending elements, and
  • between sections and endings; that is, directly within a score or part element.

In addition, scoreDef is allowed to occur:

  • within sections and endings; that is, inside section and ending elements; and
  • between sections and endings; that is, directly within a score or part.

The possibility also exists to include scoreDef and staffDef in staves and layers when the mei-all schema is in use; however, this practice is not recommended for the CMN repertoire.

4.1.4. Notes, Chords and Rests in CMN

4.1.4.1. Notes

Undoubtedly, the most important element for any music notation representation is the note element, which is defined in section Basic Music Events. This section describes the usage of note in the CMN repertoire as well as CMN-specific additions to the basic definition in the shared module.

4.1.4.1.1. Basic Usage of Notes in CMN

In CMN, notes are determined by three basic parameters:

  • pitch name (using @pname)
  • octave (using @oct)
  • duration (using @dur)

A typical note, in this case a quarter note C4, is therefore encoded like so:

<note dur="4" oct="4" pname="c"></note>

Because these attributes may not be required in all situations (such as @dur for the notes of a chord), processing software should anticipate retrieving the information that would have been provided by missing attributes from a preceding note or chord parent in the same layer. Only information from @pname, @oct and @dur attributes can be gathered in this fashion. No other attributes can be treated this way.

The usual CMN-specific values for @dur are:

1: whole note

2: half note

4: quarter note

8: eighth note

16: sixteenth note

:

2048: 2048th note

Additionally, the following two values borrowed from mensural notation are allowed, as they sometimes also appear in CMN:

breve: double whole

long: quadruple whole

Please note that their mensural counterparts bear different names in order to clearly distinguish between repertoires.

Dotted durational values are accommodated by the @dots attribute, which records the number of written augmentation dots. Thus, a dotted quarter note may is represented:

<note dots="1" dur="4" oct="4" pname="c"></note>
4.1.4.1.2. Grace Notes

The CMN module adds two optional attributes, @grace and @grace.time, to note and chord. The presence of the @grace attribute indicates a grace note.

musical example
Grace notes

The encoding of the left-most example would look like this:

<beam>
   <note dur="8" oct="5" pname="d" stem.dir="down"></note>
   <note dur="8" grace="acc" oct="5" pname="e" stem.dir="up"></note>
   <note dur="8" oct="5" pname="d" stem.dir="down"></note>
   <note accid="s" dur="8" grace="acc" oct="5" pname="c" stem.dir="up"></note>
   <note dur="8" oct="5" pname="d" stem.dir="down"></note>
   <note dur="8" oct="4" pname="b" stem.dir="down"></note>
</beam>

Grace notes are not counted when determining the measure’s conformance to the current time signature. Therefore, the @dur attribute records only the written rhythmic value of the grace note. The time necessary for the performance of grace notes can be unspecified, calculated based on taking time from other non-grace notes, or specified precisely using the @dur.ges attribute.

The values of @grace indicate from which note time is ‘borrowed’ to perform the grace note: The preceding note, in which case the value ‘unacc’ (unaccented) is used, or the following note, when the value ‘acc’ (accented) is appropriate. Technically, this value determines if the note following the grace will keep its original onset time or will be slightly delayed to allow the grace note itself to be accented. Sometimes it is not clear how to perform a grace; in these situations the value ‘unknown’ allows one to indicate a grace note while unambiguously stating that its performed duration remains unknown.

The @grace.time attribute is only to be used in combination with the @grace attribute. It records the amount of time (as a percentage of the written duration) that the grace note should ‘steal’ from the preceding note (when @grace=’unacc’) or the following note (when @grace=’acc’).

More information about grace notes in the context of other CMN ornaments is available in chapter Common Music Notation Ornaments.

4.1.4.1.3. Stem Modifications

The @stem.mod attribute accommodates various stem modifiers found in the CMN repertoire. These symbols are placed on a note or chord’s stem and generally indicate different types of tremolo and Sprechstimme. The following values are allowed:

1slash: 1 slash through stem

2slash: 2 slashes through stem

3slash: 3 slashes through stem

4slash: 4 slashes through stem

5slash: 5 slashes through stem

6slash: 6 slashes through stem

sprech: X placed on stem

z: Z placed on stem

The @stem.mod attibute is normally used in accordance with practices described in section Tremolandi.

The CMN module makes the att.stems.cmn attribute class available, which adds the optional @stem.with attribute to note and chord. The attribute @stem.with allows for the indication of a stem that joins notes on adjacent staves.

musical example
Cross-staff chord

The following code demonstrates one method of encoding the first chord in the last measure in the image above. The @stem.with attribute must occur on all the notes or chords attached to the cross-staff stem.

<staff n="1">
   <layer n="1">
      <note dur="2" oct="4" pname="d" stem.with="below"></note>
   </layer>
</staff>
<staff n="2">
   <layer n="1">
      <chord dur="2" stem.with="above">
         <note accid="n" oct="3" pname="b"></note>
         <note oct="3" pname="f"></note>
      </chord>
   </layer>
</staff>

Alternatively, the encoder may choose to treat the notes in the lower staff as logically belonging to the top staff and to ‘displace’ them using the @staff attribute on note. Some use cases, however, may require filling the time that those notes would normally occupy using the space element described in section Event Spacing. Using this mechanism, the example above could also be encoded like so:

<staff n="1">
   <layer n="1">
      <chord dur="2">
         <note oct="4" pname="d"></note>
         <note accid="n" oct="3" pname="b" staff="2"></note>
         <note oct="3" pname="f" staff="2"></note>
      </chord>
      <!-- following content -->
   </layer>
</staff>
<staff n="2">
   <layer n="1">
      <!-- the time used by the notes on staff 2 filled with non-sounding "space" -->
      <space dur="2"></space>
      <!-- following content -->
   </layer>
</staff>

The choice between these two methods of representing material that crosses staves is often software-dependent.

4.1.4.2. Rests

The @dur attribute on rest captures the written duration of the rest and allows the same values as on note and chord. The CMN module also makes three more elements available for special forms of rest:

(measure rest) – Complete measure rest in any meter.
(multiple rest) – Multiple measures of rest compressed into a single symbol, frequently found in performer parts.
(measure space) – A measure containing only empty space in any meter.
4.1.4.2.1. Measure Rests

The mRest (measure rest) element is used to indicate a complete measure rest, independent from the meter of the current measure.

The @cutout attribute provides for the description of the rendition of the mRest. If @cutout is set to ‘cutout’ (the only value allowed), then the complete staff including the staff lines will not be rendered for this measure.

<staff>
   <layer>
      <mRest cutout="cutout"></mRest>
   </layer>
</staff>

It is a semantic error to mix an mRest with other events in the same layer. However, other ‘control events’, such as fermata, may be used at the same time as mRest.

4.1.4.2.2. Multiple-Measure Rests

The multiRest (multiple measure rest) element is used to encode multiple measures of rest. It is commonly used in performer parts, but due to the problem of synchronicity with other staves, it is never found in scores. A numeric value, stored in the @num attribute, indicates the number of resting measures. The various visual forms displayed below are not captured by multiRest, but may be created by rendering software.

musical example
Forms of multiple measure rests
<staff>
   <layer>
      <multiRest num="9"></multiRest>
   </layer>
</staff>
4.1.4.2.3. Empty Measures

The mSpace (measure space) element is closely related to the space and mRest elements. It is used to explicitly indicate that a layer has no content but that no information is missing from the encoding.

musical example
Empty measure
<measure n="2">
   <staff>
      <layer>
         <mSpace></mSpace>
      </layer>
   </staff>
</measure>

4.1.5. Timestamps and Durations

MEI offers multiple ways of defining onsets and offsets of timed musical events such as notes and slurs. The most common and most musician-friendly approach to this is through the use of a combination of the attributes @tstamp and @dur, which are made available by the attribute classes att.timestamp.musical (inherited by att.controlevent) and att.duration.musical, both from the shared module.

The timestamp (@tstamp) of a musical event is calculated in relation to the meter of the current measure and resembles the so-called ‘beat’. In a common time measure with four quarter notes, the timestamp of each quarter equals its beat position in the measure: The first quarter has a timestamp of 1, the second has a timestamp of 2, and so on. MEI defines the value of @tstamp as a real number; the second eighth note position in a measure would thus be represented by the value of “1.5”. The range of possible values is defined as starting with zero and ending with the number of metrical units in a measure (the ‘numerator’ in a time signature) + 1. This allows the capture of all graphical positions starting from the left barline (‘0’) and ending with the right barline of the measure (‘5’, in the case of 4/4 time).

For expressing durations, MEI offers the @dur attribute. This attribute is described in section Basic Usage of Notes in CMN.

For ‘spanning’ elements like slurs, which are members of the model.controleventLike class, it is often more intuitive to record two timestamps – one for the onset of the event and one for its termination. Because the termination of the event may be in a succeeding measure, the second timestamp (@tstamp2) has a slightly different datatype than the one marking the initiation of the event. Its datatype is constrained to values following the formula “xm+y”, where x is the number of full measures that this particular feature lasts (or the number of bar lines crossed) and y is the timestamp in the target measure where the feature ends. The timestamp is expressed using the same logic as described above. For example, a value of “0m+3” in 4/4 time indicates that the element bearing this attribute, a slur for example, ends on beat 3 of the same measure where it started. A value of “1m+1.5” would indicate an end on the second eighth note of the following measure. In 6/8 time, the value “2m+3” means that the feature ends two measures later on the third eighth note.

4.2. Advanced CMN Features

Over time, in addition to the basic features of note, chord, and rest, many other symbols have been added to CMN. The following section describes some of these symbols and introduces their handling in MEI.

4.2.1. Beams

A very common feature of music from the CMN repertoire is the beaming of eighth or shorter notes. MEI provides two elements for the explicit encoding of features joined by beams.

A container for a series of explicitly beamed events that begins and ends entirely within a measure.
(beam span) – Alternative element for explicitly encoding beams, particularly those which extend across bar lines.

Use of the beam element is straightforward. The beamed notes, rests, or chords are simply enclosed by the beam element:

<layer>
   <beam>
      <note dur="8"></note>
      <note dur="8"></note>
   </beam>
</layer>

Whereas in music notation every note value shorter than an eighth adds another beam (sometimes referred to as ‘secondary beams’), in MEI only one beam element is used, no matter the durations of the contained notes. The visual rendition of a set of beamed notes is presumed to be handled by rendering processes.

<layer>
   <!--...-->
   <beam>
      <note dur="16"></note>
      <note dur="32"></note>
      <note dur="32"></note>
      <note dots="1" dur="16"></note>
      <note dur="32"></note>
   </beam>
   <!-- ...-->
</layer>

From the 19th century onwards, it became quite common to break secondary beams to increase readability of longer beamed passages. The optional @breaksec attribute on notes and chords under the beam may be used to encode the breaking of secondary beams after the note or chord bearing the attribute. The value of @breaksec indicates the number of continuous beams. For example:

musical example
Primary and secondary beams
<layer>
   <beam>
      <note dots="1" dur="8"></note>
      <note dur="16"></note>
   </beam>
   <beam>
      <note dur="32"></note>
      <note dur="32"></note>
      <note breaksec="1" dur="16"></note>
      <note dur="32"></note>
      <note dur="32"></note>
      <note dur="32"></note>
      <note dur="32"></note>
   </beam>
</layer>

In the music of the second half of the 20th century, it is quite common to indicate acceleration or deceleration using converging beams as in the image below:

The encoding of such a beam is accomplished using the @rend attribute of the beam, which allows the following values:

acc: The secondary beams start in their usual position and gradually converge until they meet with the primary beam on the last note (or, the first eighth note under the beam).

rit: The secondary beams gradually diverge until they reach their regular distance.

mixed: The secondary beams diverge and converge arbitrarily.

norm: The beam is rendered as usual (default).

<layer>
   <!-- … -->
   <beam rend="acc">
      <note dur="8"></note>
      <note></note>
      <note></note>
      <note></note>
      <note></note>
      <note dur="32"></note>
   </beam>
   <!-- … -->
</layer>

The duration of notes, rests, or chords under a beam which carries the @rend attribute with a value of ‘acc’, ‘rit’, or ‘mixed’ must be treated specially. The first and last contained elements must specify a duration which matches the number of beams displayed at the point of these events. In the case of a ‘mixed’ beam, each event at the point of change in the number of secondary beams must carry a @dur attribute. Beams like this may be encoded thusly:

musical example
Accelerando beams
<layer>
   <!-- … -->
   <beam rend="mixed">
      <note dur="8"></note>
      <note dur="8"></note>
      <note></note>
      <note></note>
      <note></note>
      <note dur="32"></note>
   </beam>
   <beam rend="mixed">
      <note dur="32"></note>
      <note></note>
      <note></note>
      <note></note>
      <note></note>
      <note dur="8"></note>
      <note dur="8"></note>
   </beam>
   <!-- … -->
</layer>
musical example
Cross-staff beam

Beams that connect events on different staves may be encoded in two different ways. First, a single-layer approach may be taken that treats the events lying under the beam as logically belonging to the same layer as the initial event but visually ‘displaced’ to an adjacent staff. In the example below, the last two notes under the beam carry a @staff attribute value that contradicts the ‘normal’ staff placement indicated by the @n attribute on their ancestor staff.

<staff n="2">
   <layer>
      <beam>
         <note dur="16" oct="3" pname="g"></note>
         <note pname="b"></note>
         <note oct="4" pname="d" staff="1"></note>
         <note pname="f" staff="1"></note>
      </beam>
   </layer>
</staff>

Alternatively, a staff-by-staff methodology may be employed in which the notes are encoded according to the staff on which they appear. This encoding style requires that each beam element account for the total time encompassed by the beam; that is, each beam must use one or more space elements to account for the time occupied by notes on the opposing staff. For example, the time used by the first two notes of the beam must be represented on staff number 1 and the time taken by the last two notes of the beam must be filled on staff number 2.

<measure>
   <staff n="1">
      <layer>
         <beam beam.with="below">
            <space dur="8"></space>
            <note oct="4" pname="d"></note>
            <note pname="f"></note>
         </beam>
      </layer>
   </staff>
   <staff n="2">
      <layer>
         <beam beam.with="above">
            <note dur="16" oct="3" pname="g"></note>
            <note pname="b"></note>
            <space dur="8"></space>
         </beam>
      </layer>
   </staff>
</measure>

Downstream processing needs are the determining factor in the choice between the two alternative encoding methods.

Due to the potential problem of overlapping hierarchies, the beam element only allows the encoding of beams that do not cross barlines. When beams cross barlines, the use of the beamSpan element is required. Unlike beam, the beamSpanelement does not contain the beamed notes as its children. Instead, it references the @xml:id values of all affected notes in its @plist attribute and denotes the initial and terminal notes of the beam using @startid and @endid attributes. This configuration allows beams to cross measure boundaries. The following example demonstrates a typical example of such hierarchy-crossing beams:

<beamSpan endid="#note4" plist="#note1 #note2 #note3 #note4" startid="#note1"></beamSpan>

In addition to the explicit encoding of beams accommodated by the beam and beamSpan elements and the @beam attribute, MEI allows for specification of default beaming behavior using the following attributes on scoreDef, staffDef, and layerDef:

beam.group: Provides an example of how automated beaming (including secondary beams) is to be performed.

beam.rests: Indicates whether automatically-drawn beams should include rests shorter than a quarter note duration.

The @beam.group attribute can be used to set a default beaming pattern to be used when no beaming is indicated at the layer level. It must contain a comma-separated list of time values that add up to a measure in the current meter, e.g., ‘4,4,4,4’ in 4/4 time indicates that each quarter note worth of shorter notes should be beamed together. Parentheses can be used to indicate sub-groupings of secondary beams. For example, ‘(4.,4.,4.)’ in 9/8 meter indicates one primary beam per measure with secondary beams broken at each dotted quarter duration, while ‘(4,4),(4,4)’ in 4/4 will result in a measure of 16th notes being rendered with a primary beam covering all the notes and secondary beams for each group of four 16th notes.

The @beam.group attribute is available on scoreDef, staffDef, and layerDef elements, making it possible to set different beaming patterns for each of these. Also, the beaming pattern can be changed anywhere score parameters may be changed, for example, at the start of sections. This beaming “directive” can be overridden by using beam, beamSpan, or @beam attributes as described above. If none of these beaming specifications is used, then no beaming is implied. Default beaming can be explicitly ‘turned off’ by setting @beam.group to an empty string.

4.2.2. Ties, Slurs and Phrase Marks

One of the most specific features of CMN is the use of ‘curved lines’ which connect notes. These lines are used to indicate various musical features, depending on their context.

A tie is a curved line connecting two notes of the same pitch. The purpose of a tie is to join the durations of both notes, so that the first note sounds for the combined duration. In other words, there is only one onset for both notes.

In MEI, ties can be encoded in different ways, depending on the level of detail that the encoder wants to preserve. The simplest solution is to use the @tie attribute found on note and chord.

<note dur="2" oct="4" pname="f" tie="i"></note>
<note dots="1" dur="4" oct="4" pname="f" tie="t"></note>

This attribute allows three values:

i (initial): Marks the start of a tie

m (medial): Marks a participant in a tie other than the first or last

t (terminal): Marks the end of a tie

The scope of the @tie attribute is the musical layer; that is, a tie started in one layer may only be ended by a subsequent musical event with a @tie attribute with an m or t value in the same layer. The tie-terminating event may lie in the following measure.

musical example
Ties across barlines
<measure n="1">
   <!-- staff 1 omitted -->
   <staff n="2">
      <layer n="1">
         <chord dur="16"></chord>
         <beam>
            <note pname="f" tie="i"></note>
            <note pname="a" tie="i"></note>
            <note pname="c" tie="i"></note>
         </beam>
         <chord dur="4">
            <note pname="f" tie="i"></note>
            <note pname="c" tie="m"></note>
            <note pname="a" tie="m"></note>
            <note pname="f" tie="m"></note>
         </chord>
      </layer>
   </staff>
</measure>
<measure n="2">
   <!-- staff 1 omitted -->
   <staff n="2">
      <layer n="1">
         <chord dur="16">
            <note pname="f" tie="t"></note>
            <note pname="c" tie="t"></note>
            <note pname="a" tie="t"></note>
            <note pname="f" tie="t"></note>
         </chord>
         <!-- ... -->
      </layer>
   </staff>
</measure>
<!-- measures 3 and 4 omitted -->

When @tie is used on chords, it functions as a shorthand indication for multiple tie markings; that is, a separate tie is drawn for every pitch in the chord that remains unchanged in the succeeding chord.

<staff>
   <layer>
      <chord dur="4" tie="i">
         <note pname="f"></note>
         <note pname="c"></note>
         <note pname="a"></note>
      </chord>
      <chord dur="4" tie="t">
         <note pname="f"></note>
         <note pname="c"></note>
         <note pname="a"></note>
      </chord>
   </layer>
</staff>

This is equivalent to the following, more verbose version:

<staff>
   <layer>
      <chord dur="4">
         <note pname="f" tie="i"></note>
         <note pname="c" tie="i"></note>
         <note pname="a" tie="i"></note>
      </chord>
      <chord dur="4">
         <note pname="f" tie="t"></note>
         <note pname="c" tie="t"></note>
         <note pname="a" tie="t"></note>
      </chord>
   </layer>
</staff>

A slur is a curved line that connects a group of notes of different pitch. It normally indicates that an instrument-specific performance technique should be applied to the affected notes. For example, in notation for winds, the notes should be played in one breath, while a single bow is indicated for string instruments.

musical example
Slurs

In MEI, slurs may be encoded in a similar way to ties: note and chord bear a @slur attribute that allows the commencement or ending of a slur at this element. The allowed values, however, are slightly different: The i, m or t are followed by a single digit in the range 1 to 6, as in the following example:

<layer>
   <note accid="s" dur="4" oct="4" pname="f" slur="i1"></note>
   <note dur="4" oct="4" pname="g" slur="m1"></note>
   <note dur="4" oct="4" pname="a" slur="t1"></note>
</layer>

The reason for this difference is that slurs, unlike ties, may overlap, so that a second slur may start while the first slur is still ongoing. The digit indicates the level of nesting of slurs on the note; ‘1’ indicates no nesting, while ‘2’ indicates the existence of 2 slurs in which this note participates, and so on. In the example below, the second and third quarter notes lie under 2 slurs. The second note is covered by the slur that begins on the preceding note and by the one that it starts. The third note is affected by the slur that begins on note one and by the one that starts on note two.

<staff>
   <layer>
      <note dur="2" oct="4" pname="g" slur="i1"></note>
      <note dur="8" oct="4" pname="a" slur="i2"></note>
      <note dur="8" oct="4" pname="g" slur="t2"></note>
      <note accid="s" dur="4" oct="4" pname="f" slur="t1"></note>
   </layer>
   <layer>
      <note dots="1" dur="2" oct="3" pname="b" slur="i1"></note>
      <note dur="4" oct="4" pname="d" slur="t1"></note>
   </layer>
</staff>

To support analytical operations, @slur may take on more than one value. For example, the example above may be more explicitly encoded as:

<staff>
   <layer>
      <note dur="2" oct="4" pname="g" slur="i1"></note>
      <note dur="8" oct="4" pname="a" slur="m1 i2"></note>
      <note dur="8" oct="4" pname="g" slur="m1 t2"></note>
      <note accid="s" dur="4" oct="4" pname="f" slur="t1"></note>
   </layer>
   <layer>
      <note dots="1" dur="2" oct="3" pname="b" slur="i1"></note>
      <note dur="4" oct="4" pname="d" slur="t1"></note>
   </layer>
</staff>

In this encoding, the notes in the beamed group are marked as participating in two slurs – one connecting just the beamed notes and one connecting the first and last notes of the layer. In ‘nested’ slurs like this, the function of the slurs is usually different. Here, the slur connecting the 8th notes indicates legato performance, while the longer slur functions as a phrase mark.

While ties are not normally allowed to cross layers or staves, slurs may. The following example demonstrates how cross-staff slurs may be encoded using the @slur attribute:

<measure>
   <staff>
      <layer>
         <note dur="4" oct="4" pname="g" slur="i1"></note>
         <note dur="8" oct="4" pname="a" slur="m1"></note>
         <note dur="8" oct="4" pname="g" slur="m1"></note>
         <note accid="s" dur="4" oct="4" pname="f" slur="m1"></note>
      </layer>
   </staff>
   <staff>
      <layer>
         <note dots="1" dur="2" oct="3" pname="b"></note>
         <note dur="4" oct="4" pname="d" slur="t1"></note>
      </layer>
   </staff>
</measure>

Slurs and ties that cross system or page breaks are often split into two separate symbols for rendering. One slur or tie ends at the last barline, another one starts at the beginning of the new system. MEI expects this to be the default rendering behaviour, so that in situations like these, the regular @tie or @slur attributes are sufficient to describe both curved lines resulting from the split.

Sometimes, however, one of these two symbols is missing in the document, or the encoder wants to provide additional (often visual) information about the slur or tie. In these cases, using an attribute is not an adequate solution. Therefore, MEI offers dedicated tie and slur elements. A third element, phrase, is used to identify a unified melodic idea (in German: Phrasierungsbogen), whereas the slur element is used as a generic element for all curved lines (in German: Bogensetzung) except ties. All three elements have nearly identical models.

Another reason for using elements instead of attributes for ties, slurs, and phrase marks is that only elements may be combined with the functionality provided in chapters Editorial Markup and Critical Apparatus of these Guidelines.

Although these elements are allowed within a layer to accommodate unmeasured notation, by convention in CMN they are normally placed inside measure, after the encoding of staves, alongside other so-called ‘control events’.

<measure>
   <staff n="1">
      <layer>
         <note dur="4" oct="5" pname="c"></note>
         <note dur="4" oct="4" pname="f"></note>
         <note dur="4" oct="4" pname="g"></note>
         <note dur="4" oct="4" pname="c"></note>
      </layer>
   </staff>
   <slur></slur>
   <tempo></tempo>
   <dynam></dynam>
</measure>

Obviously, to be complete the slur in the above example needs to be ‘attached’ to the notes somehow. The ‘vertical assignment’ can be indicated for the example above using the @staff and @layer attributes like so:

<slur layer="1" staff="1"></slur>

For the ‘horizontal assignment’, the encoder may choose between two different mechanisms. The first uses two timestamp attributes as described in section Timestamps and Durations. The start and end points of the slur may be indicated thusly:

<slur layer="1" staff="1" tstamp="1" tstamp2="0m+4"></slur>

By using @tstamp and @tstamp2 attributes, the encoder denotes a rather loose connection – the slur (or tie) is attached to a certain position in the measure, not to a specific note or chord. If the encoder wants to specify a close connection to a particular event, the @startid and @endid attributes may be used instead. Here, the @xml:ids of the first and last note of the slur are referenced. This mechanism also allows the crossing of layers and staves.

For human readability, it is recommended to encode slur, tie and phrase features in the measure where they begin; that is, in the measure that holds the element referenced by @startid. On the other hand, for machine processability, it may be desirable to place slur, tie, and phrase elements in the measure where they end or even in the last measure regardless of their beginning and ending points in the music. This last option makes all references contained within these elements ‘back references’. Back references are necessary when using processing software that treats the encoded file as a stream; that is, programs that process the file without creating an in-memory representation of its contents.

When using the tie, slur or phrase elements, the curvature of the line may be described using the @curvedir, @bulge and @bezier attributes. Whereas the first attribute allows only specification of the slur’s vertical placement, the others give increasingly more precise control of the curve.

If the encoder wishes to draw attention to the appearance of a slur or tie in a given source, the @facs attribute may be used instead of (or in addition to) the curve description attributes to point to a graphic image or a zone within an image (see Facsimiles).

4.2.3. Dynamics in CMN

Common Music Notation provides two different methodologies for expressing the volume of a note, phrase, section, etc. The first is a verbal instruction providing such information in human language, possibly in an abbreviated form. An example is the word piano, indicating a quiet volume, often abbreviated as p. In MEI, verbal instructions like this are encoded using the dynam element from the Shared module (see chapter Shared Elements, Models, and Attributes):

<dynam>p</dynam>

By convention, dynam elements, like slur and other elements belonging to the model.controleventLike class, are encoded at the end of the measure to which they belong. This requires dynam to be assigned to a certain staff using the @staff attribute, whose value refers to the target element’s @n attribute. In the absence of other information, all layers within the staff are assumed to have the same dynamic marking.

<dynam staff="1">p</dynam>

However, when the layers of a staff have different dynamic indications, the @layer attribute may be used to associate a dynamic marking with a particular layer:

<dynam layer="1" staff="1">p</dynam>
<dynam layer="2" staff="1">mf</dynam>

A value in the range 0-127 may be assigned to a dynamic marking using the @val attribute:

<dynam layer="1" place="above" staff="2" tstamp="1" val="84">f</dynam>

The location of a dynamic marking in relation to a staff may be specified using the @place attribute, which may be given as above, within, or below the staff:

<dynam place="above" staff="1">p</dynam>

Dynamics must also be associated with a particular time point in a measure, using the @tstamp, or with a particular event, using the @startid attribute. Linking a control event with measures and events is discussed in section Timestamps and Durations:

<measure>
   <staff n="1">
      <!-- content omitted -->
   </staff>
   <staff n="2">
      <layer n="1">
         <note dur="2" oct="4" pname="c" stem.mod="2slash"></note>
         <note dur="2" oct="4" pname="e" stem.mod="2slash"></note>
      </layer>
      <layer n="2">
         <!-- content omitted -->
      </layer>
   </staff>
   <dynam layer="1" place="above" staff="2" tstamp="1">p</dynam>
   <dynam layer="1" place="above" staff="2" tstamp="2.5">cresc. poco a poco</dynam>
</measure>

Dynamics which do not have an explicit endpoint are often referred to as ‘instantaneous’. On the other hand, some dynamic directions indicate a continuous change that must have a defined end point. It is possible to specify the logical scope of continuous dynamic marks using the attributes @tstamp2, @dur or @endid. In order to capture the fact that they continue until the first beat of the next measure, the crescendi in the example above may be marked:

<!-- using the tstamp2 attribute --><dynam place="above" staff="2" tstamp="2.5" tstamp2="1m+1">cresc. poco a poco</dynam>
<!-- using the endid attribute -->
<dynam endid="ID_of_ending_note" place="above" staff="2" tstamp="2.5">cresc. poco a poco</dynam>

Any combination of @tstamp, @startid, @tstamp2, and @endid attributes may be used to define the scope of a dynamic, although the @tstamp and @tstamp2 or the @startid and @endid combinations are the most likely combinations. For example, the following alternatives are all possibilities for encoding up a crescendo. The choice of attributes is often task or processor dependent.

<!-- tstamp attribute indicates starting point, dur attribute marks the end --><dynam place="above" staff="2" tstamp="2.5" tstamp2="1m+1">cresc. poco a poco</dynam>
<!-- tstamp attribute indicates starting point, endid attribute marks the end -->
<dynam endid="ID of last note" place="above" staff="2" tstamp="2.5">cresc. poco a poco</dynam>
<!-- startid attribute indicates starting point, tstamp2 attribute marks the end -->
<dynam place="above" staff="2" startid="ID_of_starting_note" tstamp2="1m+1">cresc. poco a poco</dynam>
<!-- startid attribute indicates starting point, endid attribute marks the end -->
<dynam endid="ID_of_ending_note" place="above" staff="2" startid="ID_of_starting_note">cresc. poco a poco</dynam>

All musical elements affected by the dynam may be explicitly specified using the @plist attribute, which contains @xml:id attribute value references:

<dynam endid="#note4" place="above" plist="#note1 #note2   #note3 #note4" staff="2" startid="#note1">cresc. poco a poco</dynam>

It is recommended that the list of references in @plist include all participants in the dynamic marking, including the first and last notes as in the preceding example, even though they are duplicated by @startid and @endid attributes.

In addition to verbal instructions, Common Music Notation uses graphical symbols to indicate ‘continuous’ dynamics. These crescendo and decrescendo (or diminuendo) symbols are encoded in MEI using the hairpin element. It also is a member of the model.controleventLike class, which means it too is used just before the close of a measure element, following the encoding of all staves. The required attribute @form specifies the direction of the symbol by taking one of two possible values: cres (growing louder) or dim (getting softer).

<hairpin form="cres"></hairpin>

Marking the logical extent of hairpins is possible using the same attributes as for dynam. The following example shows a hairpin that begins on the second half of beat 2 (in the current measure) and ends on beat 1 (of the following measure).

<hairpin form="cres" layer="1" place="above" staff="2" tstamp="2.5" tstamp2="1m+1"></hairpin>

4.2.4. Tuplets

Tuplets indicate a localized change of meter; that is, a given duration in the regular meter is divided between a group of notes with irregular (according to the current meter) rhythmic values. The most common tuplet is a so-called ‘triplet’, in which three notes take the time normally occupied by two.

The relation of the tuplet to the underlying meter is specified using the @num and @numbase attributes, where @num specifies the number of replacing notes and @numbase specifies the number of notes of the same duration to be replaced. For example, when three eighth notes replace one quarter note in common time, @num takes a value of “3”, whereas @numbase reads “2”, because a quarter note in common time is normally divided into two eighths. When three quarters replace two in the same meter, @numbase also reads “2”. The combination of these attributes may be read as “3 in the time of 2” in either case.

The duration of the entire tuplet may be encoded using the usual ‘power of 2’ values, e.g., 1, 2, 4, etc., in the @dur attribute, and the @dots attribute, if necessary.

<layer>
   <tuplet dur="2" num="3" numbase="2">
      <note dur="4" oct="4" pname="g"></note>
      <note accid="s" dur="4" oct="4" pname="f"></note>
      <note dur="4" oct="4" pname="g"></note>
   </tuplet>
   <note dur="2" oct="4" pname="d"></note>
</layer>

Tuplets are often highlighted using brackets above or below the affected notes. The presence and position of these brackets can be encoded using the @bracket.place (above / below) and @bracket.visible (true / false) attributes.

Usually, however, tuplets are rendered with a bracket (@bracket.visible=”true”) and a single number (@num.format=”count” and @num.visible=”true”). However, the number-to-numbase ratio may be provided in addition to, or in some cases as a replacement for, the bracket. The @num.format attribute indicates whether a plain number (the value of @num) or a ratio (comprised of @num and @numbase, e.g., “3:2”) should be displayed and @num.visible indicates the general presence of such a number.

In addition to note elements, tuplet may contain other elements, such as rest or space, to match the content of a source document or an intended rendering. In particular, the beam element is allowed so that custom beaming may be indicated, e.g., a septuplet may be divided into a group of three plus a group of four notes.

The tuplet element may also be used for repetition of the same pitch; that is, a single note or chord may be the only content of the tuplet. In some cases, optical music recognition software may treat these instances as bowed tremolandi due to the knowledge of the complete semantics of the notation at the time of recognition. However, marking these as tuplets is the recommended practice.

In some situations, a tuplet is made up of events in different measures. As this raises the issue of non-concurrent hierarchies, it is not possible to encode such situations with the tuplet element described above. Therefore, MEI offers the tupletSpan element, which is member of the model.controleventLike class. It is nested inside of measure, following all the measure’s staff children. It uses the same attributes as tuplet to describe tuplets, but instead of nesting all affected notes inside itself, it references the @xml:id values of all affected notes in its @plist attribute and the initial and terminal notes of the tuplet using @startid and @endid attributes. This configuration allows tuplets to cross measure boundaries. The following example demonstrates a typical example of such hierarchy-crossing tuplets:

<tupletSpan endid="#note4" plist="#note1 #note2 #note3 #note4" startid="#note1"></tupletSpan>

4.2.5. Articulation and Performance Instructions in CMN

This section introduces elements and attributes which may hold CMN-specific performance instructions. The functionality described herein is related to the @artic attribute and artic element introduced in Shared Elements, Models, and Attributes. The following elements are relevant in this context:

A variation in pitch (often micro-tonal) upwards or downwards during the course of a note.
(bowed tremolo) – A rapid alternation on a single pitch or chord.
(fingered tremolo) – A rapid alternation between a pair of notes (or chords or perhaps between a note and a chord) that are (usually) farther apart than a major second.
(glissando) – A continuous or sliding movement from one pitch to another, usually indicated by a straight or wavy line.
(arpeggiation) – Indicates that the notes of a chord are to be performed successively rather than simultaneously, usually from lowest to highest. Sometimes called a "roll".
An indication that a passage should be performed one or more octaves above or below its written pitch.
An indication placed over a note or rest to indicate that it should be held longer than its written value. May also occur over a bar line to indicate the end of a phrase or section. Sometimes called a 'hold' or 'pause'.
4.2.5.1. Arpeggio and Glissando

In CMN, the notes of a chord are sometimes performed successively rather than simultaneously. This behavior, called arpeggiation, is normally indicated using a wavy line preceding the chord. MEI offers the arpeg element to describe arpeggios. This element is a member of the model.controleventLike class and, like other members of this class, uses the @staff, @layer and @tstamp or the @startid and @endid attributes to connect it to the affected chord.

<measure>
   <staff n="1">
      <!-- content omitted -->
   </staff>
   <staff n="2">
      <layer>
         <note dur="4"></note>
         <note dur="4"></note>
         <chord dur="4">
            <!-- notes omitted -->
         </chord>
         <note></note>
      </layer>
   </staff>
   <arpeg staff="2" tstamp="3"></arpeg>
</measure>

The usual direction for the performance of an arpeggio is from lowest note to highest, but this is not always the case. The customary signal of an downward arpeggio is an arrowhead added to the bottom of the wavy line. The indication of the presence of an arrowhead and the direction of the arpeggio are handled separately, however. The @arrow attribute indicates the presence of an arrowhead in the arpeggiation sign, while the @order attribute records the preferred sequence of notes.

The following example illustrates various ways in which the arrow and order attributes may be employed. The default visual rendition and performance are assumed in the absence of both attributes, while the typical downward arpeggio is indicated by the presence of both attributes. The last two possibilities occur less frequently, but are sometimes appropriate: The presence of the arrow attribute without the order attribute may be used in those cases where the arrowhead is redundant but is added to the symbol for the sake of consistency or when the direction of successive arpeggios changes frequently. The last possibility, an order attribute without an arrow attribute, is ambiguous; however, it can be used as an encoding shortcut since a downward arpeggio must have a visual indication of its direction to distinguish it from the upward arpeggio; therefore, the presence of the arrowhead can be implied.

<!-- default visualization and performance --><arpeg staff="2" tstamp="3"></arpeg>
<!-- downward arpeggio with arrow added to visual symbol -->
<arpeg arrow="true" order="down" staff="2" tstamp="3"></arpeg>
<!-- default rendition with (redundant) arrow added to the top of the visual symbol -->
<arpeg arrow="true" staff="2" tstamp="3"></arpeg>
<!-- downward arpeggio with no visual indication of order -->
<arpeg order="down" staff="2" tstamp="3"></arpeg>

A third, and somewhat counter-intuitive, value for @order, “nonarp”, indicates that no arpeggio shall be performed. Normally rendered as a bracket instead of a wavy line, this form of arpeggio is used to indicate a non-arpeggiated chord intervening in a sequence of arpeggiated ones. This is common in music for the harp, where arpeggiation is the usual method of performing chords and deviation from the norm must be explicitly indicated.

For arpeggios that involve chords spanning multiple staves as a continuous arpeggio (instead of two separate arpeggios), the @plist attribute may be used to point to all affected chord elements’ @xml:id attributes.

Whereas an arpeggio ‘staggers’ the onset times of the notes of a chord, a glissando denotes a situation where the pitch ‘slides’ from one note to another. It makes no difference whether this slide produces distinct intermediate pitches (as on the piano) or not (as on the trombone), though the latter is sometimes referred to as portamento. The visual appearance of a glissando, which MEI encodes as gliss, is normally a line connecting the two most distant notes in the glissando.

The gliss element is a member of the model.controleventLike class and therefore, like other control events, it occurs inside a measure after the staves and uses its @staff, @layer, @tstamp, @tstamp2, @startid and @endid attributes to connect it to the affected notes or chords. It is a semantic error not to specify a starting point attribute. The visual appearance of the indicating line may be recorded in the @rend attribute. Any text accompanying the line, such as “gliss.”, may be provided in the @text attribute.

4.2.5.2. Bend

A bend is a variation in pitch (often microtonal) upwards or downwards during the course of a note. Typically, the performer attacks the note at ‘true’ pitch, changes the intonation, then returns to true pitch. The bend element can also be used for so-called scoop, plop, falloff, and doit performance effects. It should not be used for laissez vibrer (l.v.) indications. As with other control events, the starting point of the bend may be indicated by either a tstamp, tstamp.ges, tstamp.real or startid attribute. It is a semantic error not to specify a starting attribute.

4.2.5.3. Tremolandi

CMN has two slightly different concepts which are both called tremolo. The first is a rapid repetition of a single pitch or chord, whereas the second is a rapid alternation between two different notes or chords. In addition, either species of tremolo may be measured or unmeasured. A measured tremolo is an abbreviation for written-out notation; that is, the tremolo is intended to be perceived as notes with distinct rhythmic values. On the other hand, in an unmeasured tremolo no specific number of alternations is intended.

For the repetition of a single note or chord, MEI offers the bTrem (bowed tremolo) element, which is a member of the model.eventLike class, meaning it is encoded following the normal course of musical events within a layer. It holds exactly one note or chord element that is to be repeated.

musical example
Bowed tremolandi
<bTrem>
   <note dur="1" oct="4" pname="b"></note>
</bTrem>

The @measperf attribute value indicates the exact note values in an aural rendition of a measured tremolo, i.e., quarters, 8ths, and so on. The stem modifier must also be explicity set on the child note or chord element for a complete visual representation. The number of slashes present on the note may disagree with the number of slashes that should be present according to the @measperf attribute, especially in music manuscripts.

<bTrem measperf="32">
   <note dur="4" oct="4" pname="g" stem.mod="3slash"></note>
</bTrem>

The bTrem element can be used as shorthand for a tuplet consisting of repetitions of a single note or chord. This kind of markup may be the result of an optical music recognition process in which complete semantics cannot be determined a priori. When used this way, the @num attribute on bTrem can record a number to be rendered along with the pseudo-tuplet. In spite of this capability, the tuplet element is preferred.

<bTrem num="3">
   <note dur="4" oct="4" pname="g" stem.mod="3slash"></note>
</bTrem>

In the case of alternating pitches, MEI offers the fTrem (fingered tremolo) element. While it mostly behaves the same as bTrem, a fingered tremolo requires exactly two child elements, either being a note or chord. The @measperf attribute value indicates the exact note values in an aural rendition of a measured tremolo, i.e., 4ths, 8ths, 16ths, etc. The number of slashes present in the source is captured by the @slash attribute. The number of slashes present may disagree with the rhythmic value indicated by the @measperf attribute, especially in manuscript sources.

<fTrem measperf="32">
   <note dur="4" oct="4" pname="g"></note>
   <note dur="4" oct="4" pname="c"></note>
</fTrem>
4.2.5.4. Fermata

A very common feature of music notation from the CMN period is the so-called ‘fermata’. It is usually written as a dot above or below an arc. It may stand above or below the staff it affects. If this symbol is used, its ‘open’ side always faces the staff. A fermata indicates that the note or rest under it should be held longer than its written duration would normally require. Sometimes, a fermata occurs over a barline to indicate the end of a phrase or section.

In MEI, fermatas may be encoded using an attribute on note, chord or rest. This attribute allows placement of a fermata above or below the element to which it’s attached.

<note fermata="above"></note>

However, if there is further information about the fermata that should be addressed in the encoding, MEI offers the fermata element. This element, which is a member of the model.controleventLike class and therefore requires the use of such attributes as @staff, @layer, @tstamp and @startid, allows specification of the orientation of the fermata using its @form attribute. In addition, the @shape attribute may be used to indicate whether the fermata is rendered as a semicircle (“curved”) or semisquare (“square”). If the fermata should be rendered using some other symbol, a user-defined symbol may be referred to using the @altsym attribute.

<fermata form="inv" place="above" shape="square" staff="2" tstamp="4"></fermata>
<fermata altsym="#myFermata.1" place="above" staff="2" tstamp="5"></fermata>
4.2.5.5. Octave Shift

An indication that a passage should be performed one or more octaves above or below its written pitch is represented by the octave element.

musical example
Octave displacement

Its @dis and @dis.place attributes record the amount and direction of displacement, respectively. The @rend attribute captures the appearance of the continuation line associated with the octave displacement. The starting point of the octave displacement 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 one starting-type attribute and one ending-type attribute.

4.2.6. Instrument-specific Symbols in CMN

CMN contains a number of symbols which are closely related to a specific instrument. MEI offers elements for three of these symbols, namely breath marks, harp pedal diagrams, and piano pedals.

4.2.6.1. Breath Marks

A breath mark indicates a point at which the performer of a wind instrument or singer may breathe. It is sometimes also used to indicate a short pause or break for instruments not requiring breath, which allows it to also serve as a guide to phrasing. In MEI, breath marks are encoded using the breath element, which is a member of model.controleventLike. It is a semantic error not to specify a starting point attribute.

<measure>
   <staff n="1">
      <layer>
         <note dur="2" oct="3" pname="g" syl="Wald,"></note>
         <note dur="4" oct="3" pname="c" syl="so"></note>
      </layer>
   </staff>
   <breath staff="1" tstamp="1.5"></breath>
</measure>

The usual sign for the breath mark is a comma; however, other visual forms of the breath mark may be indicated using the @altsym attribute (see chapter User-defined Symbols for further details).

4.2.6.2. Harp Pedals

Modern harps have seven pedals which allow adjustment of their strings to different pitches. The settings for these pedals occur at the beginning of the harp notation and/or whenever it is necessary to change the harp’s tuning. These settings may be rendered using letter pitches (in the order of the pedals from left to right) or in a diagrammatic fashion, such as the form invented by Carlos Salzedo.

In MEI, harp pedal settings are encoded using the harpPedal element. It is a member of the model.controleventLike class and is therefore placed within measure, following all staff children. The @staff and @layer attributes may be used to assign it to a certain staff or layer. Either a @tstamp or @startid attribute must be used to indicate the placement within the measure (see Timestamps and Durations and Pointers and References for further details about those linking mechanisms).

The musical intention of the element is described using the @c, @d, @e, @f, @g, @a and @b attributes, which affect the corresponding strings of the harp. All of these attributes may take the values “f” (flat), “s” (sharp) or “n” (natural), where “n” is the default value, which is assumed when one of these attributes is not specified.

<measure>
   <!-- staves omitted -->
   <harpPedal a="f" b="f" e="f" staff="2" tstamp="1"></harpPedal>
</measure>

In the preceding example, the A, B, and E pedals are in the flat position, while the other, non-specified pedals are in the natural position.

4.2.6.3. Piano Pedal

Music for piano also often includes indications of the use of pedals. In MEI, these symbols are encoded using the pedal element. As a member of the model.controleventLike class, it is located within measure and refers to a staff, layer and timestamp using the @staff, @layer and @tstamp attributes. Alternatively, the @startid attribute may be used to identify a note or chord to which the mark should be assigned.

The meaning of the mark is captured using the @dir attribute, which provides the following values:

down: depress the pedal

up: release the pedal

bounce: release, then immediately depress the pedal again

half: depress the pedal half way

<measure>
   <!-- staves omitted -->
   <pedal dir="down" staff="2" tstamp="1"></pedal>
</measure>

4.2.7. Ossia

The term ossia, Italian for “or”, denotes an alternative for a certain passage which is provided by the composer without any preference of one alternative over another. An ossia often provides a simpler (easier to perform) version of the original content. Another frequent use case for ossia is the provision of indications about performance practice, such as an alternative version with ornamentation written out in full. In all cases, it is up to the performer to choose between the alternatives.

Most often an ossia is rendered above the main staff on a reduced-size staff. Sometimes, however, the alternate material occurs on the same staff as the primary text, but in a separate layer. In this case, the alternative material is usually rendered in small-sized notation on the normal-sized staff. For both situations, MEI offers the ossia element, which may be nested either inside measure to reflect an ossia on a separate staff, or inside staff to reflect an inline ossia in a separate layer. The following example demonstrates an ossia on a separate staff:

<measure>
   <staff n="1">
      <!-- first staff, without ossia -->
   </staff>
   <ossia>
      <staff>
         <!-- alternative content on reduced-size staff -->
      </staff>
      <staff n="2">
         <!-- original content on regular staff -->
      </staff>
   </ossia>
   <staff n="3">
      <!-- third staff, without ossia -->
   </staff>
</measure>

The example above demonstrates that only one of the two staff elements within ossia has an @n attribute. This mechanism allows one to distinguish between the “regular” and the “alternative” content: The one bearing the @n attribute goes in line with the preceding measure’s staff, the other one is printed in reduced size above. In this case, the vertical order of staves follows document order: The top-most staff is encoded as the first child, the lowest comes last. In combination with the presence of the @n attribute, this allows the capture of multiple simultaneous ossia staves.

All staves within ossia, even the alternative ones without a direct reference, obey the definitions of the associated staffDef, which can be derived from the value of the @n attribute. Alternatively, a separate staffDef may be given at the beginning of the contained layer element(s).

In case of an inline ossia, the whole setup of elements moves down one step in the hierarchy, as seen in the following example:

<measure>
   <staff n="1">
      <!-- content omitted -->
   </staff>
   <staff n="2">
      <ossia>
         <layer n="1">
            <!-- original content in regular layer -->
         </layer>
         <layer>
            <!-- alternative content in separate layer -->
         </layer>
      </ossia>
   </staff>
   <staff n="3">
      <!-- content omitted -->
   </staff>
</measure>

4.2.8. Directions and Rehearsal marks

In CMN scores, there is often a large number of natural language instructions. Some of them concern the loudness and the speed of the performance, in which case MEI offers the elements dynam (described at Dynamics in CMN) and tempo. In other cases, however, they provide other instructions for the performer. Instead of providing separate elements for all possible types of such directions, MEI offers the generic dir element. Although this element is not CMN specific (it is defined in Shared Elements, Models, and Attributes), it is especially important in this repertoire.

A tempo or character indication is often provided above the topmost staff of the first measure of a score, movement, or section. This indication, such as “Allegro moderato” or “Andante maestoso”, may be regarded as a label. Though it is possible to label the movement, etc. using a @label attribute attached to the enclosing structural entity (that is, on mdiv or section), it is often required to capture the exact position, spelling, or other features of the label as found in the underlying source material. In these cases, an element is necessary.

Labels which address the tempo at which the music should be performed should be encoded using the tempo element, which is a specialized form of dir. tempo is a member of the model.controleventLike class and as such occurs as a child of measure, following all staff children. Its @staff, @layer and @tstamp attributes are used to ensure correct semantic positioning, and @place indicates a visual position with respect to the staff.

<measure n="1">
   <!-- all staves omitted -->
   <tempo place="above" staff="1" tstamp="1">Allegro moderato</tempo>
</measure>

Rehearsal marks are another specialized kind of directive. Consisting of letters, numbers, or a combination of both, rehearsal marks are used in scores and corresponding performer parts to identify convenient points to restart rehearsal after breaks or interruptions. For this reason, they are often visually emphasized by placing them within a square or circle. In MEI, they are encoded using the reh element, which holds the textual content of the rehearsal mark. The visual rendition of the rehearsal mark, including the surrounding shape, may be captured using the rend element described in chapter Text Rendition.

The following detail from an edition of Hector Berlioz’ Symphonie Fantastique shows a typical example:

musical example
Rehearsal mark
<measure>
   <staff n="1">
      <!-- content omitted -->
   </staff>
   <staff n="2">
      <!-- content omitted -->
   </staff>
   <staff n="3">
      <!-- content omitted -->
   </staff>
   <reh place="above" staff="1" tstamp="1">
      <rend rend="box">37</rend>
   </reh>
</measure>

The following example demonstrates how rehearsal marks often apply to more than one staff. In this instance, the rehearsal mark is placed above staff 1 and below staves 7 and 11.

<measure>
   <reh place="above" staff="1" tstamp="1">A</reh>
   <reh place="below" staff="7 11" tstamp="1">A</reh>
</measure>

4.2.9. Repetition in CMN

Repetition is a characteristic feature of music. Many musical forms rely on repetition (sometimes with modification) of distinct sections of the music. Repetition in this sense can be thought of as ‘structural’. At the same time, composers and engravers of music often use local symbols for repeating smaller portions of music instead of writing them in full more than once. In this case, the repetition is better defined as a species of abbreviation.

4.2.9.1. Structural Repetition

Large-scale structural repetition, utilizing section and expansion elements, is discussed in section Content of Musical Divisions. This section will focus on repetition within sections.

4.2.9.2. Measure-Level Repetition Symbols

In addition to repetition at the section level, CMN includes a number of different symbols for measure-level repetitions. Many of these symbols are found in manuscripts and may be regarded as personal conventions of their respective authors. Some signs, however, have been widely adopted. For example, it is common to indicate the repetition of a single beat or an entire measure with one or more diagonal lines, sometimes with dots at the upper left and lower right, much like a percent sign. The illustration below contains the most common signs:

musical example
Beat repeat signs

In general, MEI places primary emphasis on the capture of the semantic meaning of symbols, not their visual rendition. In this case, the focus is on the material being repeated, for example, a beat, a measure, a 2-measure fragment, etc. The following elements are provided for this purpose:

(beat repeat) – An indication that material on a preceding beat should be repeated.
(half-measure repeat) – A half-measure repeat in any meter.
(measure repeat) – An indication that the previous measure should be repeated.
(2-measure repeat) – An indication that the previous two measures should be repeated.
(multiple repeat) – Multiple repeated measures.

The beatRpt element is used to represent a single repeated beat. Its visual rendition can be recorded using the @rend attribute. This attribute indicates the number of slashes required to render the appropriate repeat symbol, which, as demonstrated in the preceding figure, depends on the rhythmic content of the beat being repeated. When a beat that consists of a single note or chord is repeated, the repetition sign is typically rendered as a single thick, slanting slash; therefore, the value ‘1’ should be used. The following values should be used when the beat is divided into even notes: 4ths or 8ths=1, 16ths=2, 32nds=3, 64ths=4, 128ths=5. When the beat is comprised of mixed duration values, the symbol is always rendered as 2 slashes and 2 dots.

In addition to its indication of a repeated beat, the beatRpt element is sometimes used in popular music notation, especially in guitar or percussion parts, to indicate a repeated rhythmic pattern. The beatRpt element can be used, but when these parts require durations longer or shorter than a beat, note elements with appropriately-shaped note heads should be employed instead.

The mRpt element is available for repetition of an entire measure. Like mRest, it must be the sole child of layer, no other events should be used. The @n attribute of mRpt should not be used to record the number displayed above the measure in the figure below. Instead, the numbering of repetitions of the written-out measure can be enabled using the @multi.number attribute available on the scoreDef and staffDef elements.

musical example
Measure repetition
<measure>
   <staff>
      <layer>
         <beam>
            <note dur="8" oct="4" pname="f"></note>
            <note dur="16" pname="a"></note>
            <note oct="5" pname="c"></note>
            <note dur="8" oct="4" pname="a"></note>
         </beam>
         <beam>
            <note dur="8" oct="5" pname="c"></note>
            <note oct="4" pname="a"></note>
            <note pname="g"></note>
         </beam>
      </layer>
   </staff>
</measure>
<measure>
   <staff>
      <layer>
         <mRpt></mRpt>
      </layer>
   </staff>
</measure>
<measure>
   <staff>
      <layer>
         <mRpt></mRpt>
      </layer>
   </staff>
</measure>
<measure>
   <staff>
      <layer>
         <mRpt></mRpt>
      </layer>
   </staff>
</measure>

The halfmRpt element represents the incorrect, but frequently found, use of the measure repeat (or similar) sign to indicate repetition of half of a measure. This practice mostly occurs in hand-written notation and usually involves the repetition of the second half of a measure in duple time. This element is necessary because the function of the symbol, not the visual symbol itself, is of primary importance. The following example from the beginning of Beethoven’s Waldstein sonata illustrates such usage:

musical example
Half-measure repeat
<measure>
   <staff n="1">
      <!-- omitted -->
   </staff>
   <staff n="2">
      <layer n="1">
         <!-- omitted -->
      </layer>
      <layer n="2">
         <chord dur="2" stem.mod="1slash">
            <note oct="2" pname="g"></note>
            <note oct="1" pname="b"></note>
         </chord>
         <halfmRpt></halfmRpt>
      </layer>
   </staff>
</measure>
<measure>
   <staff n="1">
      <!-- omitted -->
   </staff>
   <staff n="2">
      <layer n="2">
         <halfmRpt></halfmRpt>
         <halfmRpt></halfmRpt>
      </layer>
   </staff>
</measure>

As seen in the example above, it is possible to continuously repeat half measures, even across barlines.

The mRpt2 and multiRpt elements (like the multiRest element) never occur in scores, only in performer parts, where it is often necessary to abbreviate the notation due to page size limitations.

musical example
Two-measure repetition
musical example
Multi-measure repetition

The mRpt2 element represents repetition of a 2-measure fragment, while multiRpt is for repetition of fragments longer than two measures. In modern publishing practice, repeats of more than two measures are written out using repeat signs. This element is provided, however, for handling non-standard practices often found in manuscripts. The @num attribute on multiRpt records the number of preceding measures to be repeated.

All elements described above allow for association of the sign with a symbol in a digital facsimile (via the @facs attribute) and with a user-defined symbol (using @altsym). See Facsimiles and User-defined Symbols for further details. In addition, the @expand attribute is available on the foregoing elements to inform a rendering process whether to use the repeat symbol or the full content represented by it. A value of “true” indicates that the content should be displayed, while a “false” value means to show only the repeat symbol.