10Analysis 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.1Analytical 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 3.4.2 Encoding Description. For general information on musical analysis, please consult Grove Music Online, ‘Analysis’.

The relationships between event elements, such as note, chord, and rest, are the basic material of musical analysis. MEI provides linking attributes to ensure a closed network of these relations. They provide the opportunity to record data useful for common analytical tasks. In the context of a formal analysis, for instance, these attributes can be useful in the capture information about the structure of a musical work. Further information on these attributes can be found in 13 Linking Data.

10.1.1Event-Specific Analytical Information

In addition to the common linking attributes (see 13.1.1 General Relationships Between Elements), 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.
@
pclass (att.pitchClass)
Holds pitch class information.
@
psolfa (att.solfa)
Contains sol-fa designation, e.g., do, re, mi, etc., in either a fixed or movable Do system.

10.1.1.1Melodic 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>
Listing 362.

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>
Listing 363.

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>
Listing 364.

10.1.1.2Melodic 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>
Listing 365.

10.1.1.3Harmonic 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>
Listing 366.

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.1.4Scale 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"/>
Listing 367.
<!-- Augmented 5th -->
<note deg="5+"/>
Listing 368.
<!-- Lowered 6 scale degree approached from below -->
<note deg="^6-"/>
Listing 369.
<!-- Leading tone approached from above -->
<note deg="v7"/>
Listing 370.

10.1.1.5Pitch 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>
Listing 371.

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

10.1.1.6Solmization

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>
Listing 372.

10.1.2Metrical 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>
Listing 373.
<!-- 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>
Listing 374.

10.2Harmony

This chapter describes the encoding of indications of harmony occurring 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 10.1 Analytical Information.

10.2.1Indications 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 2.2.3 Basic Music Events and 4.2.5 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.1Interpreted 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 tablature definition.
@
Records fret position.
An individual pitch in a chord defined by a chordDef element.
@
Encodes the harmonic interval between pitches occurring at the same time.
@
tab.fing (att.stringtab)
This attribute is deprecated and will be removed in a future version. 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.
@
tab.fret (att.stringtab)
Records the location at which a string should be stopped against a fret.
A barre in a chord tablature grid.
@
fret (barre)
This attribute is deprecated in favor of tab.fret, and will be removed in a future version. 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 oct="3" pname="e"/>
<chordMember accid.ges="s" oct="4" pname="c"/>
<chordMember oct="4" pname="e"/>
<chordMember oct="4" pname="a"/>
</chordDef>
<!-- Later in musical text -->
<harm chordref="#harmonychordA" tstamp="1">A</harm>
Listing 375.

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 inth="P5"/>
<chordMember inth="M10"/>
<chordMember inth="P12"/>
<chordMember inth="P15"/>
</chordDef>
Listing 376.

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 P1. For example:

<chordDef xml:id="harmonychordA3">
<chordMember inth="P1"/>
<chordMember inth="M3"/>
<chordMember inth="P5"/>
</chordDef>
Listing 377.

10.2.1.2Chord 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.3Indications 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 analysis they all function as labels. Therefore, MEI provides only a single element for the capture of harmonic indications of all kinds:

@
extender (att.extender)
Indicates the presence of an extension symbol, typically a line.
@
rendgrid (att.harm.vis)
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>
Listing 378.

or labels that are chord tablature grids:

example
Figure 117. Chord grid without label
<harm chordref="#harmonychordA" tstamp="1"/>
Listing 379.

or labels that mix these styles:

example
Figure 118. Chord grid with label
<harm chordref="#harmonychordA" rendgrid="gridtext" tstamp="1">A7</harm>
Listing 380.

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.1Figured 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:

Symbols added to a bass line that indicate harmony. Used to improvise a chordal accompaniment. Sometimes called Generalbass, thoroughbass, or basso continuo.
@
extender (att.extender)
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:

example
Figure 119. Figured bass
<harm place="above" staff="1" tstamp="1">6</harm>
Listing 381.

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>
Listing 382.

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.

example
Figure 120. Figured bass with accidental
<harm place="above" staff="1" tstamp="1">
<fb>
<f>7</f>
<f></f>
</fb>
</harm>
Listing 383.

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:

example
Figure 121. Figured bass with chromatically altered figure
<harm place="below">
<fb>
<f>7♭</f>
</fb>
</harm>
Listing 384.
example
Figure 122. Figured bass with chromatically altered figures
<harm>
<fb>
<f>6</f>
<f>4+</f>
<f>♮3</f>
</fb>
</harm>
Listing 385.

You may use 6\ and 6/ for numerals that should be shown with a backslash and slash, respectively. An alternative would be to use the "bslash" (backward slash) and "fslash" (forward slash) on the rend element.

example
Figure 123. Figured bass with chromatically altered figure
<harm>
<fb>
<f>
<rend rend="bslash">6</rend>
</f>
<!-- or -->
<f>
<rend rend="fslash">6</rend>
</f>
</fb>
</harm>
Listing 386.

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.

example
Figure 124. 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>
Listing 387.

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.

example
Figure 125. Figured bass repetition
<harm tstamp="1.5">
<fb>
<f>-</f>
</fb>
</harm>
Listing 388.

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:

example
Figure 126. 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>
Listing 389.

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>
Listing 390.

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.

example
Figure 127. 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>
Listing 391.
<!-- Ex. b -->
<harm tstamp="4.5">
<fb>
<f>6\</f>
</fb>
</harm>
Listing 392.
<!-- Ex. c -->
<harm tstamp="1">
<fb>
<f>5/</f>
</fb>
</harm>
Listing 393.
<!-- Ex. d -->
<harm>
<fb>
<f altsym="#my5" facs="#source5">5+</f>
</fb>
</harm>
Listing 394.