MML: Notation Module

Also see the brief discussion: Music notation

  1. Note
  2. Key
  3. Clef
  4. Staff
  5. Bind
  6. Tie
  7. Slur
  8. Rest
  9. Text
  10. Dotted note
  11. Sharps and flats

An abstract note can be given expression in various ways as illustrated here. It could be expressed in the textual format of MML, in the graphic symbol manner as in Western staff notation, expressed as a frequency, or indicated on a piano roll. In MML its own notation method is obvioulsy primary. It should be posisble to translate that format into any of the other presentational systems. Presently we focus on CWN (Common Wester Notation) and leave other systems for future investigation. The elements explained here thus concern this specific notation system.

Notation module

1 Note

note

The abstract notion of note is declared with the note attribute that could be used with different structural music units. In CWN the glyph representing the musical "note" refers to a relative frequency (in terms of its position on the graphic lines of the staff) and relative duration (in terms of its length value). The abstract MML "note" can thus easily be translated into such a graphical representation as it contains al the necessary information for such a translation. In the above illustration 3A:4 means: a quarter A note in octave 3.

Rest

In CWN the rest is explicitly marked (while in MIDI the absence of a sound is implicit).

A CWN rest is indicated with the "R" symbol in MML and functions exactly like note symbols in terms of length values -- obviously frequency is not an issue! In other words, any length feature that applies to a note also applies to a rest.

An MML sensitive program should be able to transform an "R" and its associated values into the appropriate notational glyph - even the "R" is not stated explicitly. Absence of a note should be translated into rests.

Note that MML has two models indicating the absence of sound. If a piece of music is marked where the absence of sound is implicit (such as MML created from MIDI), the MML application program should translate such absences into explicit rests.

Example
R:2

This markup should be transformed into the Western notation minim rest glyph. The rendering of a rest on a device such as a synthesizer is irrelevant. For such a device the rest is the default, while a note has to be explicitly triggered. Once the note is released (in other words, no longer played) the status reverts back to rest. There may nevertheless be sound, even if there is no note. This will happen in cases where echo or reverb continues with some waveform of the note.

2 Key

key
a shorthand description for the set of notes (ie pitches) in an octave

key

A key can be declared with the following attributes:

Markup example in song
...
 <song key="Cmaj">
 ...
 </song>
 ...
Markup example in bar
...
  <bar barid="34" key="Cmaj">
 ...
 </bar>
 ...

Here are some possible keys:

maj
maj7
maj9

Top

3 Clef

clef
identifies the staff by limiting the range of possible notes

clef

The clef is used exclusively for music notation.

Some clefs are:

treble G clef
bass F clef
alto C clef
tenor C clef

The clef is used for visual notation. For audio the key attribute is used. These attributes thus have exactly the same function, except that they are rendered differently. Perhaps a rendering machine could automatically translate the key into clef. It may also be possible to use a more abstract notion, and then translate kay and clef into rendered versions using XSLT.

Top

4 Staff

staff
the set of lines on which notes are written

staff | value

There are different visual representations of staff. The five parallel lines used for "standard" Western music notation is the most commonly known staff. Other configurations are possible, ranging from a single line to up to 20 lines. The staff element is used exclusively for music notation and irrelevant for music generation. The number of lines to be contained in the staff are indicated with the value of the value attribute.

staff is an empty element.

Markup example for a 5-line staff
...
 <song>
 <staff value="5" />
 </song>
 ...

Top

5 Bind

bind | bindbegin | bindend | end | id

Binding in music notation begins at some point and end at another -- to bind together notes within a bar with a graphic line. Its function is to make sight-reading easier by marking notes as a group.

In the first draft of MML a single element was used with IDs indicating where binds begin, and IDREFS where binds end. However, with all the different kinds of IDs used in MML things became very hairy, and it was decided to rather indicate the beginning and end of binds with explicit element names.

Example

This is sample code is from Chopin's Trois Nocturne. This approach can handle quite complex binds.

The starting point of a bind gets an ID which is IDREF'ed (with the end attribute) where it is ended. The beat on which the bind begins is also indicated explicitly.

<notation>
  <bindbegin id="bind2" beat="5" />
  <bindend end="bind2" beat="6.5" />
  <slurend beat="3" id="slur1" />
  <slurbegin id="slur2" beat="4" />
</notation>

Top

6 Tie

tie
combining two notes of the same pitch to be played as if they were one note

tie

The tie is used for notation purposes to indicate note length. From an audio perspective the tie is irrelevant.

Groups

Notes with irregular values can be grouped in sets of 3, 5 or 6. The length of such a set of notes is the same as that of a single note of the same kind.

triplet 3 notes
quintuplet 5 notes
sextuplet 6 notes

Three minim notes in a set of minim triplets together have the same length value as a single minim.

Top

7 Slur

slur
a notation symbol indicating the set of notes that belong to a phrase

slur | slurbegin | slurend | end | id

The slur is a phrase mark -- a curved line stretching from the first note of the phrase to the last. Its function is to make sight-reading easier by marking phrases.

In the original draft of MML slur was used to hanlde both the start and end of the slur symbol, but the same problems as with bind were experienced in practice with the multitude of IDs. Slur is thus now also marked with explicit element names for beginning (slurbegin) and ending (slurend).

Example

This is sample code is from Chopin's Trois Nocturne. This approach can handle quite complex slurs.

The starting point of a slur gets an ID which is IDREF'ed (with the end attribute) where it is ended. The beat on which the slur begins is also indicated explicitly. In this example a slur begins in the first bar showed here, and ends in the following bar. The first bar also includes a slur that ends, and which started in a previous bar not shown here.

<bar barid="treb-1">[F:4]4 G F E C F
  <notation>
    <slurend beat="3" id="slur1" />
    <slurbegin id="slur2" beat="4" />
  </notation>
</bar>
  
<bar barid="treb-2">D:2 B:4 5(B C D An B A Gs A C B Gb) C
  <notation>
    <slurend beat="3" end="slur2" />
    <slurbegin id="slur3" beat="4" />
    <slurend end="slur3" beat="4.7" />
  </notation>
</bar>

Top

8 Rest

Rest
indicates silence for an expected note length value in a specific bar

A rest is the absence of any frequency -- the music part takes a rest. In MML the notation rest is indicated with the uppercase letter R. For applications such as MIDI a rest is not explicitly indicated. In such environments a rest is usually implicitly derived from the absence of notes (such as the duration between a Note Off and following Note On commands).

Rest length values are used for notational purposes only. For performance the absence of a note indicates silence -- ie, by default there is silence.

For notational purposes, rests are indicated as follows:

Latin English Numerical MML notation
semibrave whole 1 1
minim half 2 2
crotchet quarter 4 4
quaver eighth 8 8
semiquaver sixteenth 16 16
demisemiquaver thirty-second 32 32
hemidemisemiquaver sixty-fourth 64 64

Note that there is a relative rest value for each of the relative note lengths values.

Example
<bar barid="5" note=":4">R R R G </bar>

OR

<bar barid="5" note=":4"> (R)4 G </bar>

Rests are indicated in exactly the same way as notes.

Top

9 Text

text

Text is used mainly for textual objects on a score. The text element is used for textual content, excluding the text of lyrics (for which the lyric element is used). Text objects include instrument names (eg hobo, flute, fagot) and expressions (eg forte, andante, adagio) that are written on a score and used for reading the score. Only instrument names are marked with text. For the actual playing of an instrument the instrument element is used.

The text element marks the content - ie the actual words. Their appearance (such as font-family and so on) and position on a score are declared with a style sheet.

Example

Here is an example of the use of text in Musorgky's Boris Godunov. Note that the text element merely marks the structure of the element. The actual position, color, font and so on need to be declared with a style sheet, in this case a hypothetical style sheet called "XYZ". Different languages are indicated with the ISO language abbreviation using the lang attribute, and where necessary the appropriate character set (using the charset attribute) should also be declared.

<song>
 <text style="ABC">Andante</text>
 <instrument.basic type="piccolo">
 <text lang="it" style="XYZ">Flauto Piccolo (III)</text>
 ...
 </song>

10 Dotted note

The dotted note is relevant in notation, not to the structure of music.

In staff notation a dot following a note indicates that its length value is doubled. The period is used in MML for the dot. Note that the application of this should be monitored so as not to confuse the period with the class attribute. Class attributes are contained within start tags (eg <bar.classone> ), while the period for the dotted note occurs only as content of an element between the start and end tags (eg <bar>A.</bar> ).

Example

In this example of bar 8 consisting of quarter notes there is a vertical (ie simultaneous) group of minims, each with a dotted value.

<bar barid="8" note=":4"> [E A]:2. </bar>

Top

11 Sharps and flats

Accidental
a note may be raised or lowered in relation to a "natural" note

The notion of sharps and flats applies only to music notation or in terms of temperament. In terms of absolute frequency it is irrelevant. However, music is often visually recorded in Western notation and a sound producing device needs to be able to translate such notes into relevant frequencies. In this context the scale, tuning and instrument elements should determine whether a given sharp and flat have the same or different frequencies. The direction of play may also be a factor -- whether the scale is played upwards or downwards in frequencies.

For a whole section of a song, lowered or raised notes are usually indicated on the horizontal line set immediately after the clef symbol. Accidentals are used for smaller parts of a song (eg inside a bar) that require lowering or raising of a note with respect to "natural" notes.

This is indicated with the accidental sign, in MML with the lowercase 's' (shrap) or 'f' (flat) characters.

NOTE
Using the lowercase f for a specific purpose while there is an uppercase F note implies that MML is case sensitive. An MML sensitive program must thus interpret Ff correctly as F-sharp.

Sharp
a note raised by a semitone with respect to a natural note

The sharp is indicated by the lowercase 's' character.

Example

The C4 note raised by a semitone is thus indicated as 3Cs:4 (ie quarter C-sharp in the 3rd octave).

Flat
a note lowered by a semitone with respect to a natural note

The flat is indicated by the 'f' character.

Example

The D4 note lowered by a semitone is thus indicated as 3Df:4 (ie quarter D-flat in the 3rd octave).

Double sharp
a note raised by two semitones with respect to a natural note

The double sharp is indicated by the 'ss' sign.

Example

A C:4 note raised by two semitones is thus indicated as Css:4

Double flat
a note lowered by two semitones with respect to a natural note

The double flat is indicated by the 'ff' sign.

Example

The D:4 note lowered by two semitones is thus indicated as Dff:4.

Canceling sharps or flats

A certain key "naturally" containing certain sharps or flats, such sharps or flats may be canceled or naturalized at specific instances. The h character is used.

Canceling a sharp or flat: h

Canceling a double sharp or flat: hh

Top

© 1999, 2000 Author: Jacques Steyn