10. Analysis Markup and Harmonies

This chapter of the MEI Guidelines describes how the results of a musical analysis or harmonic information may be stored in MEI.

10.1. Analytical Information

This chapter describes the use of attributes that capture data which may be useful for analytical purposes. The analysis module provides attributes that record relationships between entities found in the encoding. These attributes may be used differently by different users, depending on the purpose of the analysis.

These Guidelines recommend that encoders employ commonly accepted analytical practices, such as ‘functional analysis’ or ‘Schenkerian analysis’, and document their use in the encodingDesc described in section Encoding Description. For general information on musical analysis, please consult Grove Music Online, ‘Analysis’.

10.1.1. General Relationships Between Elements

The relationships between event elements, such as note, chord, and rest, are the basic material of musical analysis; the attributes described below ensure a closed network of these relations and provide the opportunity to record data useful for common analytical tasks. In the context of a formal analysis, for instance, the attributes presented here can be useful in the capture information about the structure of a musical work.

MEI offers several attributes in the att.linking class for the description of basic relationships:

Points to an element of which the current element is a copy.
Points to an element that is the same as the current element but is not a literal copy of the current element.
Used to point to other elements that correspond to this one in a generic fashion.
Used to point to the next event(s) in a user-defined collection.
Points to the previous event(s) in a user-defined collection.
Points to one or more events in a user-defined collection that are known to be successors of the current element.
points to one or more events in a user-defined collection that are known to be predecessors of the current element.
Points to elements that are synchronous with the current element.

The att.alignment class also contains an attribute for describing temporal relationships:

Indicates the point of occurrence of this feature along a time line. Its value must be the ID of a when element elsewhere in the document.

These attributes accommodate the encoding of linkages between the element carrying the attribute and one or more other elements. All of them use URIs to establish the connection. While the examples below illustrate relationships between musical events, the use of the aforementioned attributes is not restricted to musical events. On the contrary, these attributes can be used to capture information about relations between any elements. Further information on this can be found in Linking Data.

Using the attributes above makes it possible to create relationships between events, which are often widely-spaced in both encoded order and time. The attributes allow a large number of connections, enhancing the informational content, and therefore the potential usefulness, of the encoding.

The @copyof attribute points to an element of which the current element is a copy. It can be used to repeat a note, for example, without encoding the whole note element again. The copy is a ‘deep’ one; that is, the @copyof attribute copies all attributes and child elements which belong to the copied element, such as the @dur and @oct attributes of a copied note. The value of the @copyof attribute must be a URI, which usually refers to an element in the current document. The following example demonstrates use of the @copyof attribute:

<section>
  <measure n="1">
    <staff n="1">
      <layer>
        <note xml:id="analysis.note1_1" dur="4" oct="4" pname="g"/>
      </layer>
    </staff>
  </measure>
  <measure n="2">
    <staff n="1">
      <layer>
        <note copyof="#analysis.note1_1"/>
      </layer>
    </staff>
  </measure>
</section>

In this example, the note in the second measure has exactly the same characteristics as the note in the first measure.

Using @copyof is not limited to copying events. The @copyof attribute can also be used to copy an entire measure or staff. When there are many repeated features, the use of the @copyof greatly reduces encoding effort. The image and the following encoding of the beginning of Schubert’s Erlkönig illustrates the benefit of using the @copyof attribute.

musical example
First measure of Schubert’s Erlkönig
<measure>
  <staff n="1">
    <layer>
      <tuplet num="3" num.visible="true" xml:id="analysis.tup1">
        <chord dur="8">
          <note oct="3" pname="g"/>
          <note oct="4" pname="g"/>
        </chord>
        <chord dur="8">
          <note oct="3" pname="g"/>
          <note oct="4" pname="g"/>
        </chord>
        <chord dur="8">
          <note oct="3" pname="g"/>
          <note oct="4" pname="g"/>
        </chord>
      </tuplet>
      <tuplet copyof="#analysis.tup1" xml:id="analysis.tup2"/>
      <tuplet copyof="#analysis.tup1" xml:id="analysis.tup3"/>
      <tuplet copyof="#analysis.tup1" xml:id="analysis.tup4"/>
    </layer>
  </staff>
</measure>

This example can be reduced further by using @copyof inside the initial tuplet to represent the repeated chords:

<measure>
  <staff n="1">
    <layer>
      <mRest/>
    </layer>
  </staff>
  <staff n="2">
    <layer>
      <tuplet num="3" num.visible="true" xml:id="analysis.tup5">
        <chord dur="8" xml:id="analysis.t1c1">
          <note oct="3" pname="g"/>
          <note oct="4" pname="g"/>
        </chord>
        <chord copyof="#analysis.t1c1"/>
        <chord copyof="#analysis.t1c1"/>
      </tuplet>
      <tuplet copyof="#analysis.tup5" xml:id="analysis.tup6"/>
      <tuplet copyof="#analysis.tup5" xml:id="analysis.tup7"/>
      <tuplet copyof="#analysis.tup5" xml:id="analysis.tup8"/>
    </layer>
  </staff>
  <staff n="3">
    <layer>
      <mRest/>
    </layer>
  </staff>
</measure>

While @copyof signifies a duplicate copy of an element, the @sameas indicates that the current element represents exactly the same entity as the one referenced in @sameas. Use of @sameas is used for describing the same entity from multiple perspectives, e.g., the same event in two layers.

While @copyof and @sameas have defined semantics, the @corresp may be used to create user-defined relationships between elements. The example below demonstrates the encoding of a relationship between the third note and the fermata, even though the fermata is not placed directly above the note.

<measure n="1" right="end">
  <staff n="1">
    <layer n="1">
      <note dur="4" oct="4" pname="c" xml:id="analysis.note1"/>
      <note dur="4" oct="4" pname="d" xml:id="analysis.note2"/>
      <note dur="2" oct="4" pname="e" xml:id="analysis.note3"/>
    </layer>
  </staff>
  <fermata corresp="#analysis.note3" place="above" tstamp="4.75"/>
</measure>

The @corresp attribute only marks the correspondence between the current element and one or more other entities. To describe the nature of the correspondence, one must use annot.

The @next and @prev attributes point to elements which follow or precede the current element in some fashion other than that indicated by encoding order. The use of these attributes helps to avoid confusion in the sequence of events, for example, in voice leading across layers or staves, when the encoding reflects the physical arrangement of voices. In the second measure of the following example, the target of the next attribute occurs after the pointing element in time, but before it in encoding order:

musical example
Bach Chorale, Ach Gott, vom Himmel sieh' darein, m. 6-7
<measure n="6" xml:id="analysis.m_sc_62">
  <staff n="1">
    <layer n="1">
      <note dur="4" oct="4" pname="g" xml:id="analysis.n_sc_63_3"/>
      <note dur="4" oct="4" pname="a" xml:id="analysis.n_sc_65_3"/>
      <note dur="4" fermata="above" oct="4" pname="b" xml:id="analysis.n_sc_67_3"/>
      <note dur="4" oct="4" pname="g" xml:id="analysis.n_sc_68_3"/>
    </layer>
    <layer n="2">
      <beam>
        <note dur="8" oct="4" pname="e" xml:id="analysis.n_sc_63_2"/>
        <note dur="8" oct="4" pname="g" xml:id="analysis.n_sc_64_2"/>
      </beam>
      <beam>
        <note dur="8" oct="4" pname="f" xml:id="analysis.n_sc_65_2"/>
        <note dur="8" oct="4" pname="e" xml:id="analysis.n_sc_66_2"/>
      </beam>
      <note accid="s" dur="4" next="#analysis.n_sc_68_2" oct="4" pname="d" xml:id="analysis.n_sc_67_2"/>
      <beam>
        <note dur="8" oct="4" pname="e" xml:id="analysis.n_sc_68_1"/>
        <note accid="n" dur="8" oct="4" pname="d" xml:id="analysis.n_sc_69_1"/>
      </beam>
    </layer>
  </staff>
  <staff n="2">
    <layer n="1">
      <note dur="4" oct="3" pname="b" xml:id="analysis.n_sc_63_1"/>
      <note dur="4" oct="4" pname="c" xml:id="analysis.n_sc_65_1"/>
      <note dur="4" oct="3" pname="f" xml:id="analysis.n_sc_67_1"/>
      <note dur="4" oct="3" pname="b" xml:id="analysis.n_sc_68_2"/>
    </layer>
    <layer n="1">
      <beam>
        <note dur="8" oct="3" pname="e" xml:id="n_sc_63_0"/>
        <note dur="8" oct="3" pname="d" xml:id="n_sc_64_0"/>
      </beam>
      <note dur="4" oct="3" pname="c" xml:id="n_sc_65_0"/>
      <note dur="4" fermata="below" oct="2" pname="b" xml:id="n_sc_67_0"/>
      <note dur="4" oct="3" pname="e" xml:id="n_sc_68_0"/>
    </layer>
  </staff>
</measure>
<measure n="7" xml:id="m_sc_70">
  <staff n="1">
    <layer n="1">
      <beam>
        <note dur="8" oct="4" pname="a" xml:id="analysis.n_sc_71_3"/>
        <note dur="8" oct="4" pname="b" xml:id="analysis.n_sc_72_3"/>
      </beam>
      <note dur="4" oct="5" pname="c" xml:id="analysis.n_sc_73_3"/>
      <note dur="4" oct="4" pname="b" xml:id="analysis.n_sc_75_3"/>
      <beam>
        <note dur="8" oct="5" pname="c" xml:id="analysis.n_sc_76_3"/>
        <note dur="8" oct="4" pname="b" xml:id="analysis.n_sc_77_3"/>
      </beam>
    </layer>
    <layer n="2">
      <space dur="4"/>
      <note dur="4" oct="4" pname="a" xml:id="analysis.n_sc_73_2"/>
      <note accid="s" dur="4" oct="4" pname="g" xml:id="analysis.n_sc_75_2"/>
      <note dur="4" oct="4" pname="a" xml:id="analysis.n_sc_76_2"/>
    </layer>
    <layer n="3">
      <beam>
        <note dur="8" oct="4" pname="c" xml:id="analysis.n_sc_71_1"/>
        <note dur="8" oct="4" pname="d" xml:id="analysis.n_sc_72_1"/>
      </beam>
      <note dur="4" oct="4" pname="e" xml:id="analysis.n_sc_73_1"/>
      <note dur="4" oct="4" pname="e" xml:id="analysis.n_sc_75_1"/>
      <beam>
        <note dur="8" oct="4" pname="e" xml:id="analysis.n_sc_76_1"/>
        <note dur="8" oct="4" pname="d" xml:id="analysis.n_sc_77_1"/>
      </beam>
    </layer>
  </staff>
  <staff n="2">
    <layer n="1">
      <note dur="4" next="#analysis.n_sc_73_2" oct="3" pname="a" xml:id="analysis.n_sc_71_2"/>
    </layer>
    <layer n="2">
      <note accid="n" dur="4" oct="3" pname="f" xml:id="n_sc_71_0"/>
      <beam>
        <note dur="8" oct="3" pname="c" xml:id="n_sc_73_0"/>
        <note dur="8" oct="3" pname="d" xml:id="n_sc_74_0"/>
      </beam>
      <note dur="4" oct="3" pname="e" xml:id="n_sc_75_0"/>
      <beam>
        <note dur="8" oct="2" pname="a" xml:id="n_sc_76_0"/>
        <note dur="8" oct="2" pname="b" xml:id="n_sc_77_0"/>
      </beam>
    </layer>
  </staff>
</measure>

This attribute may also be useful to clarify a sequence of entites which occurs across some form of interruption, in this case, notes before and after a system or page break where there is no custos or direct in the source:

<measure n="1">
  <staff n="1">
    <layer>
      <note dur="4" next="#analysis.m1s1e2" oct="4" pname="f" stem.dir="up" xml:id="analysis.m1s1e1"/>
      <pb/>
      <note dur="8" next="#analysis.m1s1e3" oct="3" pname="b" prev="#analysis.m1s1e1" stem.dir="up" xml:id="analysis.m1s1e2"/>
      <note dur="8" oct="4" pname="c" prev="#analysis.m1s1e2" stem.dir="up" xml:id="analysis.m1s1e3"/>
    </layer>
  </staff>
</measure>

A one-to-many relationship between the current element and the entities being referred to can be expressed by using a list of space-separated URIs in @corresp.

The @synch attribute points to an element that is synchronous with; that is, begins at the same moment in time, as the current element. It is useful when the encoding order differs from the order in which entities occur in time.

The @when attribute may be used to indicate the point of occurrence of the feature bearing this attribute along a time line. Its value must be the ID of a when element. For more detailed information regarding the use of @when, please see Performances.

10.1.2. Event-Specific Analytical Information

In addition to the common analytical attributes, the analysis module also offers other, more specific attributes on certain musical elements:

Encodes the harmonic interval between pitches occurring at the same time.
Encodes the melodic interval from the previous pitch. The value may be a general directional indication (u, d, s, etc.), an indication of diatonic interval direction, quality, and size, or a precise numeric value in half steps.
Describes melodic function using Humdrum **embel syntax.
Captures scale degree information using Humdrum **deg syntax -- an optional indicator of melodic approach (^ = ascending approach, v = descending approach), a scale degree value (1 = tonic ... 7 = leading tone), and an optional indication of chromatic alteration, "1", "v7", "^1", or "v5+", for example. The amount of chromatic alternation is not indicated.
Holds pitch class information.
Contains sol-fa designation, e.g., do, re, mi, etc., in either a fixed or movable Do system.
10.1.2.1. Melodic Intervals

The@intm attribute offers several methods for encoding the melodic interval from a preceding pitch. First, Parsons Code allows for description of the contour of the melody in very general terms; that is, as up, down, or same note. Parsons Code is helpful for identifying musical works with clearly defined melodies and analyzing the relationship between successive notes of monophonic tunes. For more information about the Parsons Code, please see the “The Directory of Tunes and Musical Themes” by Denys Parsons (2002). The next example shows interval relationships indicated by the Parsons Code:

<measure n="1">
  <staff n="1">
    <layer>
      <note dur="4" oct="4" pname="c"/>
      <note dur="4" oct="4" pname="d" intm="u" />
      <note dur="4" oct="4" pname="e" intm="u"/>
      <note dur="4" oct="4" pname="f" intm="u"/>
      <note dur="2" oct="4" pname="g" intm="u"/>
      <note dur="2" oct="4" pname="g" intm="s"/>
      <note dur="4" oct="4" pname="f" intm="d"/>
    </layer>
  </staff>
</measure>

Alternatively, diatonic interval quality and size may be indicated by a letter signifying the interval quality (A= augmented, d= diminished, M = major, m = minor, P = perfect) followed by a number indicating the size of the interval. The interval direction may be encoded using a leading plus (+) or minus (-) sign:

<measure>
  <staff>
    <layer>
      <note dur="4" oct="5" pname="c"/>
      <note dur="4" oct="5" pname="d" intm="+M2"/>
      <note dur="4" oct="5" pname="c" intm="-M2"/>
      <note dur="4" oct="4" pname="b" intm="-m2"/>
      <note dur="4" oct="3" pname="b" intm="-P8"/>
    </layer>
  </staff>
</measure>

As a third option, signed integers may be used to record the difference in half steps between the previous pitch and the current one. Decimal values accommodate the description of microtonal intervals:

<measure>
  <staff>
    <layer>
      <note dur="4" oct="4" pname="c"/>
      <note dur="4" oct="4" pname="d" intm="1.1"/>
      <note dur="4" oct="5" pname="d" intm="7.9"/>
      <note dur="4" oct="5" pname="c" intm="-2.334"/>
    </layer>
  </staff>
</measure>
10.1.2.2. Melodic Function

The @mfunc attribute describes melodic function of a note or neume using the Humdrum **embel syntax. In the following example, the note B is labeled as a lower neighbor while all other notes are labeled as chord tones:

<section>
  <measure n="2">
    <staff n="1">
      <layer>
        <chord dur="4" stem.dir="up" xml:id="analysis.chord1">
          <note dur="4" mfunc="ct" oct="4" pname="f" xml:id="analysis.m2e1"/>
          <note dur="4" mfunc="ct" oct="4" pname="a" xml:id="analysis.m2e2"/>
          <note dur="4" mfunc="ct" oct="5" pname="c" xml:id="analysis.m2e3"/>
        </chord>
        <note accid="f" dur="4" mfunc="ln" oct="4" pname="b" stem.dir="down" xml:id="analysis.m2e4"/>
      </layer>
    </staff>
  </measure>
  <measure n="3">
    <staff n="1">
      <layer>
        <chord dur="4" stem.dir="up" xml:id="analysis.chord2">
          <note dur="4" mfunc="ct" oct="4" pname="c" xml:id="analysis.m3e5"/>
          <note dur="4" mfunc="ct" oct="4" pname="e" xml:id="analysis.m3e6"/>
          <note dur="4" mfunc="ct" oct="4" pname="g" xml:id="analysis.m3e7"/>
        </chord>
      </layer>
    </staff>
  </measure>
</section>
10.1.2.3. Harmonic Intervals
Encodes the harmonic interval between pitches occurring at the same time.

In contrast with @intm, which characterizes melodic (sequential) intervals, the @inth attribute is used to encode the harmonic interval between the current note and other pitches occurring at the same moment in time. The notes of interest may or may not be marked as a chord. In the markup below, for example, the values of @inth capture the harmonic intervals between notes distributed across multiple staves and layers.

<measure>
  <staff>
    <layer n="1">
      <note dur="4" inth="M3 P5" oct="4" pname="c" xml:id="analysis.e1"/>
    </layer>
    <layer n="2">
      <note dur="4" inth="M3 m3" oct="4" pname="e" xml:id="analysis.e2"/>
    </layer>
  </staff>
  <staff n="2">
    <layer n="3">
      <note dur="4" inth="P5 m3" oct="4" pname="g" xml:id="analysis.e3"/>
    </layer>
  </staff>
</measure>

Use of the @inth permits detailed specification of intervallic information for every note and its function in relation to other simultaneously-occurring notes and hence about the harmonic nature of the musical work.

10.1.2.4. Scale Degrees
Captures scale degree information using Humdrum **deg syntax -- an optional indicator of melodic approach (^ = ascending approach, v = descending approach), a scale degree value (1 = tonic ... 7 = leading tone), and an optional indication of chromatic alteration, "1", "v7", "^1", or "v5+", for example. The amount of chromatic alternation is not indicated.

The @deg attribute can be used to represent key-dependent scale-degree information for music in major or minor keys.

Scale-degree values are relative to the prevailing major or minor key. In the case of minor keys, scale degrees are characterized with respect to the harmonic minor scale. For example, the pitch F in the key of A minor is the submediant (6), but F is the lowered submediant (6-) in the key of A major.

Melodic approach can be indicated by a leading caret (^) or lowercase v, representing ascending and descending approaches, respectively.

Chromatic alteration of the scale degree can be represented using a trailing plus (+) or minus (-) signs, signifying raised or lowered scale degree, respectively. The actual amount of chromatic alteration is not indicated.

<!-- Fifth scale degree in the prevailing scale -->
<note deg="5"/>
<!-- Augmented 5th -->
<note deg="5+"/>
<!-- Lowered 6 scale degree approached from below -->
<note deg="^6-"/>
<!-- Leading tone approached from above -->
<note deg="v7"/>
10.1.2.5. Pitch Class

The @pclass attribute can be used to encode information about the pitch class to which a note belongs. The attribute’s value must be an integer less than or equal to 11. It is only allowed on the note element. The @pclass attribute comes from “musical set theory” elaborated first by Howard Hanson and Allen Forte as a new method for organizing tones. It provides a concept for categorizing musical objects (notes) and describing their relationships. It is a kind of grouping and combining, mostly developed in connection with atonal music. However, the concept of set theory is general and can also be applied to tonal music. A pitch class means the summary of every pitch with specific characteristics that means a pitch class set is an unordered collection of pitches, e.g., every pitch with the name C.

A pitch class may contain a large number of pitches, because different octaves and enharmonic spellings of pitch make no difference. The notes C, E, and G would be 0, 4 and 7 in pitch class notation, for example, regardless of the octave in which they are performed. The example below contains the same pitch in four different enharmonic spellings, but all are part of the same pitch class.

<chord>
  <note dur="2" oct="5" pclass="2" pname="d"/>
  <note accid="ss" dur="4" pclass="2" pname="c"/>
  <note accid="ff" dur="1" pclass="2" pname="e"/>
</chord>

For further information on pitch class set theory, please consult the following sources:

10.1.2.6. Solmization

Solmization is a system which associates a syllable with each note of a musical scale. There are various forms of solmization used throughout the world. In Europe and North America, solfège is the most common practice. In this system, the seven syllables for a major scale are do, re, mi, fa, so, la and ti. In the ‘fixed-do’ system, the syllable “do” is always associated with the pitch “c”, while in the ‘movable-do’ system, “do” is associated with the tonic note. The @psolfa attribute is only allowed on note and nc elements. Its value is unconstrained in order to accommodate various solmization systems.

<measure>
  <staff n="1">
    <layer>
      <note dur="4" oct="4" pname="c" psolfa="do"/>
      <note dur="4" oct="4" pname="d" psolfa="re"/>
      <note dur="4" oct="4" pname="e" psolfa="mi"/>
      <note dur="4" oct="4" pname="f" psolfa="fa"/>
    </layer>
  </staff>
</measure>

10.1.3. Metrical Conformance

It is often helpful to record whether a given staff, layer, or measure obeys the meter established for it. The following attributes are provided for this purpose:

Indicates the relationship between the content of a staff or layer and the prevailing meter.
Indicates the relationship between the content of a measure and the prevailing meter.

When used on staff or layer elements, the @metcon attribute can be used to indicate if the duration of the contained events is equal to (“c”), less than (“i”), or greater than (“o”) that predicted by the time signature. When used on the measure element, @metcon takes a boolean value, where “true” indicates conformance by all staff and layer descendants of the measure.

In the first example below, the layer, staff, and measure all match the prevailing meter. In the second example, however, the first layer does not comply with the meter, making the staff containing it and measure as a whole non-compliant. When there is a single layer or when all the layers on a staff agree with each other, metrical compliance can be indicated on the staff element. When, however, not all layers have the same value for @metcon, then it is necessary to omit @metcon at the staff level. The value of @metcon on the measure level can usually be computed based on the values of its layer and staff sub-elements.

<!-- in 2/4 -->
<measure metcon="true" n="1">
  <staff n="1">
    <layer>
      <note dur="4" oct="4" pname="f"/>
      <note dur="8" oct="4" pname="b"/>
      <note dur="8" oct="4" pname="a"/>
    </layer>
  </staff>
</measure>
<!-- in 2/4 -->
<measure metcon="false" n="1">
  <staff n="1">
    <layer metcon="i">
      <note dur="4" oct="4" pname="f"/>
      <note dur="8" oct="4" pname="b"/>
    </layer>
    <layer metcon="true">
      <note dur="4" oct="4" pname="d"/>
      <note dur="8" oct="4" pname="g"/>
      <note dur="8" oct="4" pname="f"/>
    </layer>
  </staff>
</measure>

10.2. Harmony

This chapter describes the encoding of indications of harmony ocurring within a music text, e.g., chord names, tablature grids, figured bass, or signs for harmonic analysis, and the methods by which these indications can be connected with their interpretations. For encoder-supplied analysis of intervallic content, please see chapter Analytical Information.

10.2.1. Indications of Harmony

On the most basic level, chords in the musical text can be encoded using the chord element:

A simultaneous sounding of two or more notes in the same layer *with the same duration*.

Additional information on the use of the chord element is available in Basic Music Events and Notes, Chords and Rests in CMN.

With only this kind of markup, harmonic information is implicit in the notes themselves. The elements and attributes of this module, however, provide for the encoding of explicit indications of harmony, such as chord symbols, tablature grids, figured bass signs, and the symbols of harmonic analysis like Roman numerals and their interpretation.

10.2.1.1. Interpreted Chord Data in scoreDef

An harmonic label, such as “7”, may occur many times throughout an MEI instance. Where the goal is diplomatic transcription, simply recording the uninterpreted label is sufficient. Recording the precise meaning of such a label requires storing an interpretation. But, including the interpretation at every point of occurrence of the label would swell the size of the file and complicate the markup for those users who are not interested in the interpretation. Therefore, MEI separates the encoding of harmonic labels from the encoding of the interpretation of those labels.

The following elements enable the creation and re-use of interpreted chord data:

Chord/tablature look-up table.
(chord definition) – Chord tablature definition.
Records the fret position at which the chord tablature is to be played.
An individual pitch in a chord defined by a chordDef element.
Encodes the harmonic interval between pitches occurring at the same time.
Indicates which finger, if any, should be used to play an individual string. The index, middle, ring, and little fingers are represented by the values 1-4, while 't' is for the thumb. The values 'x' and 'o' indicate muffled and open strings, respectively.
Records the location at which a string should be stopped against a fret.
A barre in a chord tablature grid.
Records the location at which the strings should be stopped against a fret in a fretboard diagram. This may or may not be the same as the actual location on the fretboard of the instrument in performance.

The chordTable element is a container for a set of chord definitions, while the chordDef element defines a single chord. Chord definitions may be created a priori or as the result of analysis of the pitch content of the music at hand, for instance, by examination of the notes occurring on the downbeat of each measure. In this way, the chord definitions serve as a record of the analysis.

Even though it is not required by the schema, an @xml:id attribute on chordDef is necessary to permit the creation of associations between harmonic indications in the musical text with the chord defined here. The @xml:id attribute provides a unique identifier for the chord definition that can be referenced by the harm element’s @chordref attribute.

Individual pitches of a chord are encoded using chordMember. The @inth attribute provides the means for indicating the number of half steps of the chord note above the bass note.

These simple resources allow for the detailed specification and interpretation of harmonic indications found in the musical text. For example, the harmonic label A can be equated with a fully spelled-out indication of functional harmony that can be substituted for the harmonic label, say, in an aural rendition:

<!-- Chord defined in scoreDef --><chordDef xml:id="harmonychordA">
   <chordMember oct="2" pname="a"></chordMember>
   <chordMember oct="3" pname="e"></chordMember>
   <chordMember accid.ges="s" oct="4" pname="c"></chordMember>
   <chordMember oct="4" pname="e"></chordMember>
   <chordMember oct="4" pname="a"></chordMember>
</chordDef>
<!-- Later in musical text -->
<harm chordref="#harmonychordA" tstamp="1">A</harm>

Alternatively, the non-bass chord tones may be indicated, not with pitch names, but with their intervallic distance above the bass note. Therefore, the example above may also be encoded:

<chordDef xml:id="harmonychordA2">
   <chordMember oct="2" pname="a"></chordMember>
   <chordMember inth="7"></chordMember>
   <chordMember inth="16"></chordMember>
   <chordMember inth="19"></chordMember>
   <chordMember inth="24"></chordMember>
</chordDef>

The preceding encoding possibilities provide the detailed information necessary to create playable chord annotations. For more generic uses, however, the encoding can be taken one step further; that is, it can be reduced to its minimum intervallic content by eliminating octave duplications and expressing all chord members, including the bass note, using intervals above the bass. Of course, the @inth attribute for the bass note itself should be set to 0. For example:

<chordDef xml:id="harmonychordA3">
   <chordMember inth="0"></chordMember>
   <chordMember inth="4"></chordMember>
   <chordMember inth="7"></chordMember>
</chordDef>
10.2.1.2. Chord Tablature Grids

The @pos attribute on chordDef, the @fing and @fret attributes on chordMember, and the barre element child of chordDef are provided in order to create displayable and performable chord tablature grids for guitar and other fretted string instruments. The fret at which a finger should be placed is recorded in the @fret attribute, while @fing indicates which finger, if any, should be used to play an individual string. The values x and o are used to indicate muffled and open strings, respectively.

The chordDef element may contain barre sub-elements when a single finger is used to stop multiple strings. Here the @fret attribute gives the fret position at which the barre should be created, while the @startid and @endid attributes are used to indicate the chordMember elements on which the barre starts and finishes.

10.2.1.3. Indications of Harmony in the Music Text

With regard to indications of harmony, MEI attempts to strike a balance between very precise (interpreted) and very loose (uninterpreted) markup needs. Therefore, various kinds of harmonic labels are accommodated by the harm element. While some are more structured than others, in the final analyis they all function as labels. Therefore, MEI provides only a single element for the capture of harmonic indications of all kinds:

Indicates the presence of an extension symbol, typically a line.
Describes how the harmonic indication should be rendered.

The harm element can be used to capture chord labels that consist entirely of text:

<measure>
   <harm tstamp="1">Cmaj</harm>
   <harm tstamp="2">ii6</harm>
</measure>

or labels that are chord tablature grids:

musical example
Chord grid without label
<harm chordref="#harmonychordA" tstamp="1"></harm>

or labels that mix these styles:

musical example
Chord grid with label
<harm chordref="#harmonychordA" rendgrid="gridtext" tstamp="1">A7</harm>

The harm element must define a point of attachment using one of the following attributes: @startid, @tstamp, @tstamp.ges or @tstamp.real. The most commonly-used of these are @startid and @tstamp.

The @dur attribute encodes the logical and visual duration of the harmony. Please note that the @dur attribute here is not a true duration, but rather a time stamp for the end point of the harmony.

Precise placement of the harmonic label can be controlled through the use of attributes in the att.harm.vis attribute class.

10.2.1.3.1. Figured Bass

Figured bass is a specialized form of harmonic indication. In order to support the capture of the semantics of figured bass, and not just its visual representation, MEI provides the following elements:

fb
(figured bass) – Symbols added to a bass line that indicate harmony. Used to improvise a chordal accompaniment. Sometimes called Generalbass, thoroughbass, or basso continuo.
Indicates the presence of an extension symbol, typically a line.

Figured bass, consisting as it does of text, can always be represented purely visually. This is probably how an OMR program or other naive encoder might deal with the markup of figured bass:

musical example
Figured bass
<harm place="above" staff="1" tstamp="1">6</harm>

However, this kind of approach fails to recognize that a figured bass is being used and not some other system of harmonic indications. To capture this knowledge, the preceding example can also be marked more explicitly with:

<harm place="above" staff="1" tstamp="1">
   <fb>
      <f>6</f>
   </fb>
</harm>

In order to provide greater control over the individual components of the figured bass, each component can be treated as a figure. The natural symbol is encoded using the Unicode MUSIC NATURAL SIGN character.

musical example
Figured bass with accidental
<harm place="above" staff="1" tstamp="1">
   <fb>
      <f>7</f>
      <f></f>
   </fb>
</harm>

Encoding order of the component f elements is significant as is the encoding order of the characters within each component. In the preceding example, the entire figured bass sign is encoded from top to bottom, in other words, just as the figure appears on the page. In the following examples, the encoding order of the characters in f explicitly locates the accidentals:

musical example
Figured bass with chromatically altered figure
<harm place="below">
   <fb>
      <f>7♭</f>
   </fb>
</harm>
musical example
Figured bass with chromatically altered figures
<harm>
   <fb>
      <f>6</f>
      <f>4+</f>
      <f>♮3</f>
   </fb>
</harm>

Characters with combining slashes can be handled using the Unicode characters COMBINING REVERSE SOLIDUS OVERLAY (6⃥) and COMBINING LONG SOLIDUS OVERLAY (6̸). The combining nature of these Unicode characters indicates very clearly that they “overstrike” the preceding character. The usual convention for slashes; that is, 6\ and 6/ for backslash and slash, respectively, may also be followed:

musical example
Figured bass with chromatically altered figure
<harm>
   <fb>
      <f>6⃥</f>
      <!-- or -->
      <f>6\</f>
   </fb>
</harm>

Each component of the figured bass sign may use the @extender attribute to indicate that horizontal lines are used to mark the extent of the figure’s harmonic influence. The @altsym attribute can be used to point to a user-defined symbol that better represents the figure component, for example, the combined “2” and “+” below. Similar to the slash in the preceding example before, the small curve over the “5” in example 6 can be represented by the Unicode COMBINING INVERTED BREVE.

musical example
Figured bass with alternative sign
<measure>
   <harm tstamp="1">
      <fb>
         <f>̑</f>
         <f extender="true">5</f>
         <f altsym="combo2plus">2+</f>
      </fb>
   </harm>
   <harm tstamp="3">
      <fb>
         <f>3</f>
      </fb>
   </harm>
</measure>

Because the repertoire of signs is so large, figures which consist entirely of a mark indicating repetition of the preceding figure, should be represented by the character appearing in the document. For example, in some notational styles, the repetition sign is a dash (-), while in others it is a solidus (/). Using characters like this is also consistent with other existing figured bass encoding schemes.

musical example
Figured bass repetition
<harm tstamp="1.5">
   <fb>
      <f>-</f>
   </fb>
</harm>

Often, the distinction between extending lines and repetition signs is unclear. Treating what at first appear to be extenders as repetition signs, however, can sometimes help to simplify the required markup and to make the intent of the signs explicit. For example, in the following example the dashes on beat 4 and 4.5 are treated as repetition signs:

musical example
Extenders and repetition
<measure>
   <harm tstamp="3.5">
      <fb>
         <f>♭3</f>
         <f>6</f>
         <f>5</f>
      </fb>
   </harm>
   <harm tstamp="4">
      <fb>
         <f>-</f>
         <f>♯3</f>
      </fb>
   </harm>
   <harm tstamp="4.5">
      <fb>
         <f>7</f>
         <f>-</f>
      </fb>
   </harm>
</measure>

Using @extender attributes for this example may make it easier to render the figured bass symbol, but it is less explicit with regard to the intended harmony. For example, it is difficult to ascertain what harmony should be sounding on beat 4 and its after-beat.

<measure>
   <harm tstamp="3.5">
      <fb>
         <f>♭3</f>
         <f extender="true">6</f>
         <f>5</f>
      </fb>
   </harm>
   <harm tstamp="4">
      <fb>
         <f extender="true">♯3</f>
      </fb>
   </harm>
   <harm tstamp="4.5">
      <fb>
         <f>7</f>
      </fb>
   </harm>
</measure>

The primary goal of fb is not the capture all the visual idiosyncracies that can be found in printed and manuscript scores throughout the centuries, but to provide a more-or-less standardized label. The markup below, or any markup in fact, cannot capture the exact look of the figured bass signs. The @altsym attribute may be used to provide access to a user-defined symbol for precise rendition. Similarly, the @facs attribute may be employed to point to the symbol as it occurs in the encoding source material.

musical example
Figured bass with alternative sign
<!-- Ex. a --><measure>
   <harm tstamp="3">
      <fb>
         <f>8</f>
         <f altsym="#my6_1" facs="#source6_1">6♮</f>
         <f>4+</f>
         <f>2</f>
      </fb>
   </harm>
   <harm tstamp="4">
      <fb>
         <f altsym="#my6_2" facs="#source6_2">6\</f>
         <f>4</f>
         <f>3</f>
      </fb>
   </harm>
</measure>
<!-- Ex. b --><harm tstamp="4.5">
   <fb>
      <f>6\</f>
   </fb>
</harm>
<!--  Ex. c --><harm tstamp="1">
   <fb>
      <f>5/</f>
   </fb>
</harm>
<!--  Ex. d --><harm>
   <fb>
      <f altsym="#my5" facs="#source5">5+</f>
   </fb>
</harm>