Last updated: February 2001
NOTE
Although the markup follows music notation, MML is not primarily intended for
notation. Delivery should also be possible through synthetic devices.
The images serve as reference only to facilitate understanding of MML.
View this example as an XML file.
<?xml version="1.0" ?>
<?xml-stylesheet href="../../style/music.css" type="text/css"?>
<mml xmlns="http://www.musicmarkup.info/dtd">
<head>
<title>Now that the sun doth shine no more</title>
<meta http-equiv="Content-Type"
content="text/mml; charset=iso-8859-1" />
<meta name="description"
content="Chorale by Bach" />
<meta name="composer"
content="Adam Krieger" date="1667" />
<meta name="arranger"
content="Johann Sebastian Bach" />
<meta lang="de" name="lyrics"
content="Johann Friedriech Hertzog" date="1692" />
<meta lang="de" name="title"
content="Nun sich der Tag geendet hat" />
<meta lang="en" name="lyrics"
content="Catherine Winkworth" date="1863" />
<meta lang="en" name="title"
content="Now that the sun doth shine no more" />
<link rel="stylesheet" href="mymain.css" type="text/css" />
<sync match="treb-1" with="bass" />
<sync match="treb-1" with="vs1-1" />
<sync match="treb-1" with="vs2-1" />
</head>
mml | head | title | meta | link
<song> <div noteset="4" note="4"> <notation clef="C"> </notation>
song |
div
clef | octave | note
Each cleff is in a different division.

<upbeat id="treb">[A E] </upbeat>
<bar barid="treb-1">3[E A] [3E B] [3E:8 C]F:8 [3G C]
<notation>
<bindbegin id="b1" beat="3" note="E" />
<bindend end="b1" beat="3.5" />
</notation>
</bar>
Note the repetition of the notes 3G and E on the last beat of bar 2, and 3E and C in bar 3
<bar barid="treb-2">[A D] [3G D] ([3G E])2 </bar> <bar barid="treb-3">[A D] [3E E] ([3E C])2 </bar> <bar barid="treb-4">[3E:2 B:2] R [B E] </bar>
The simultaneous notes on beat one of bar 4 could also be written as
<bar barid="treb-4">([3E B]:2)2 </bar>

<bar barid="treb-5">[B:8 C]A:8 [3Gs B] [A:8 C]Gn [3Fn A]
<notation>
<bindbegin id="b2" beat="1" />
<bindend end="b2" beat="1.5" />
<bindbegin id="b3" beat="3" />
<bindend end="b3" beat="3.5" />
</notation>
</bar>
<bar barid="treb-6">3(Gs F:8]E:8) 3([E:8 4A]Fs:8) [3Gs B] [A E]
<notation>
<bindbegin id="b4" beat="1" />
<bindend end="b4" beat="1.5" />
<bindbegin id="b5" beat="2" />
<bindend end="b5" beat="2.5" />
</notation>
</bar>
<bar barid="treb-7">[A:8 D]3Gs:8 [A C] [A B.] 3G B:8
<notation>
<bindbegin id="b6" beat="1" />
<bindend end="b6" beat="1.5" />
</notation>
</bar>
<bar barid="treb-8">(E A):2.
</bar>
</div>
Here is the Bass Clef markup:

<!-- === Bass === -->
<div id="bass" noteset="2">
<notation clef="bass">
</notation>
<upbeat>[A:8 3A]B:8
<notation>
<bindbegin id="up1" beat="1" note="A" />
<bindend end="up1" beat="1.5" />
</notation>
</upbeat>
<bar barid="bass-1">[C 3C:8]B:8 [A:8 A]1Gs:8 [A3 B:8]3A:8 [1E E:8]C:8
<notation>
<bindbegin id="bass-b1" beat="1" note="C" />
<bindend end="bass-b1" beat="1.5" />
<bindbegin id="bass-b2" beat="2" />
<bindend end="bass-b2" beat="2.5" note="A" />
<bindbegin id="bass-b3" beat="3" />
<bindend end="bass-b3" beat="3.5" />
<bindbegin id="bass-b4" beat="4" note="G" />
<bindend end="bass-b4" beat="4.5" />
</notation>
</bar>
<bar barid="bass-2">
[1F F]
<slur>3C:8 3[B:16 A]</slur>
[1Gn G 3B] [1C C 3C] [C 3C]
<notation>
<bindbegin id="bass-b5" beat="1" note="C" />
<bindend end="bass-b5" beat="2.7" />
<bindbegin id="bass-trip-b5" beat="2.5" />
<bindend end="bass-trip-b5" beat="2.7" />
</notation>
</bar>
<bar barid="bass-3">[2Fs 3C] [2Gs 3B] [A:8 3B]B:8 [C 3C]D:8
<notation>
<bindbegin id="bass-b6" beat="3" />
<bindend end="bass-b6" beat="3.5" />
<bindbegin id="bass-b7" beat="4" />
<bindend end="bass-b7" beat="4.5" />
</notation>
</bar>
<bar barid="bass-4">[E:2 <slur>3A] Gs</slur> R [1Gs 3E]
<notation>
<slurbegin id="bass-s1" beat="1" note="A" />
<slurend end="bass-s1" beat="2" />
</notation>
</bar>

<bar barid="bass-5">[A 5E] [E:8 5E]D:8 [C 5E] [D:8 5D]C:8
<notation>
<bindbegin id="bass-b8" beat="2" note="E" />
<bindend end="bass-b8" beat="2.5" />
<bindbegin id="bass-b9" beat="4" note="D" />
<bindend end="bass-b9" beat="4.5" />
</notation>
</bar>
<bar barid="bass-6">([B:8 5D:8] [E:8 3B:8]) [C:8 3C]A:8 [E 3B] [C 3A]
<notation>
<bindbegin id="bass-b10" beat="1" note="C" />
<bindend end="bass-b10" beat="1.5" note="A" />
<bindbegin id="bass-b11" beat="2" note="B" />
<bindend end="bass-b11" beat="2.5" note="E" />
</notation>
</bar>
<bar barid="bass-7">[B 3D] [A 3E] [D3 Fn:8] D:8 [E 3B:8] 3(E D):16
<notation>
<bindbegin id="bass-b12" beat="4" />
<bindend end="bass-b12" beat="4.25" />
<bindbegin id="bass-b13" beat="4.5" />
<bindend end="bass-b13" beat="4.7" />
</notation>
</bar>
<bar barid="bass-8">(A 3As):2
<notation>
</notation>
</bar>
</div>
Here are the English lyrics of the song. The base note length is a quarter. Both these features were declared in the Head with the lyric element. Note that there are at least two methods marking the lyrics. Here lyrics are declares as content of the bar elements.

<lyric verse="1">
<upbeat> Now </upbeat>
<bar barref="treb-1"> that the sun doth
</bar>
<bar barref="treb-2"> shine no more, And
</bar>
<bar barref="treb-3"> day hath
<squash syllable="2">reached</squash>
its
</bar>
bar | lyric
| squash | upbeat
verse | barref
The squash element with the value 2 means that two syllables are squashed onto one note value.
<bar barref="treb-4"> close, They </bar> <bar barref="treb-5"> calmly sleep who </bar> <bar barref="treb-6"> wept before, The </bar> <bar barref="treb-7"> wearied find re </bar> <bar barref="treb-8"> pose. </bar> </lyric>

<lyric verse="2"> <upbeat>But</upbeat> <bar barref="treb-1"> Thou, my God, no </bar> <bar barref="treb-2"> rest doth know In </bar> <bar barref="treb-3"> Thy unslumb'ring </bar> <bar barref="treb-4"> might; Thou </bar> <bar barref="treb-5"> hatest darkness </bar> <bar barref="treb-6"> as Thy foe, For </bar> <bar barref="treb-7"> Thou Thyself are </bar> <bar barref="treb-8"> light.</bar> </lyric> </song> </mml>
An MML processor should make possible a short version to write lyrics. This will obviousluy not worek universally on XML parsers, but then typical XML parsers will in any case not be able to deliver music except as text. Lyrics could also be marked as follows with the pipe (ie the | character) method:
<lyric note="4" verse="1" lang="en"> Now | that the sun doth | shine no more, And | day hath reached its | close, They | calmly sleep who | wept before, The | wearied find re | pose. </lyric>
<lyric verse="2"> But | Thou, my God, no | rest doth know In | Thy unslumb'ring | might; Thou | hatest darkness | as Thy foe, For | Thou Thyself are | light. </lyric>
Lyrics could be written in the *.mml file as content of the song element, or in a separate lyrics file with the *.lyr extension. In such a case the external lyric file is called to the base file with the link element:
<head> <link rel="lyric" href="../lyrics/chorale.lyr" type="text/css" lang="en" /> </head>
The pipe method above is preferred if lyrics are in a separate file.
1999, 2000, 2001 © Jacques Steyn