14. 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.

14.1. Overview of the Harmony Module

The module makes available the following components:

14.1.1. Elements

The following elements are provided by the harmony module:

An indication of fingering in a chord tablature grid.
(chord definition) – Chord tablature definition.
An individual pitch in a chord defined by a <chordDef> element.
Chord/tablature look-up table.
f
(figure) – Single element of a figured bass indication.
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.
(harmony) – An indication of harmony, e.g., chord names, tablature grids, harmonic analysis, figured bass.

14.1.2. Attribute Classes

The harmony module contains the following attribute classes:

Attributes that describe a fret location.
Analytical domain attributes.
Gestural domain attributes.
Logical domain attributes.
Visual domain attributes.

14.1.3. Model Classes

The following model classes are enabled by the harmony module:

Groups elements that group playable chord definitions.
Groups elements that function as control events; that is, those events that modify or otherwise depend on the existence of notated events.
Groups elements that record figured bass.
Groups elements that represent single figured bass elements.
Groups elements that record harmony.

14.2. 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.

14.2.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.
An indication of fingering in a chord tablature grid.
Records the location at which a string should be stopped against a fret.

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:<div class="sampleCode" data-lang="false">

<!-- 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>

</div>

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>

14.2.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.

14.2.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:

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

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.

14.2.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
<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>

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
<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>

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.

<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>

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 --><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>
<!-- 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>