[This local archive copy is from the official and canonical URL, http://is.up.ac.za/mml/specs.htm, 1999-06-10; please refer to the canonical source document if possible.]
scope | specifications | examples
For the purpose of the first phase of developing MML there are five main components (each with several subcomponents) important for marking a song:
The time and frequency elements are the basic structural elements of music.
The structural components of a song that are identified in MML are the following (in order from large to small):
An album consists of a number of songs, listed sequentially. An agent should by default perform the songs in the order in which the songs appear in the list. This order can be overridden with a specific playlist.
In practice there are a number of words used for this concept, including the word "program". The word album is recommended as program is used in too many different contexts in the music environment. Meanings range from the order in which music pieces are performed at a concert, to computer programs and stored chunks of data on digital music devices (such as synthesizers). Using "program" as an element name may just contribute to further confusion.
An album can be declared as follows:
Here is an example of a list of songs on the 'album'.
<song src="oneday.mml" id="1">
<song src="rabbit.mml" id="2">
Here is an example of mixed devices used for the album.
<song src="oneday.mml" id="1">
<device type="CD" program="5">
<device type="PC" url="http://www.music.org">
<song src="someday.mml" id="2">
<device type="CD" program="12">
Here are various aspects that should be kept in mind for album.
When a user chooses a particular album, the rendering device executes the songs in the album according to the default order. A user may set up his/her own playlist, in which case the rendering device will follow that order. It should also be possible for a user to specify the device used for rendering. For example, the user may have access to different devices (tape recorder, CD-player, MIDI-engine) and may possess versions of a song for each of these devices. In the playlist the user can then stipulate which device should be used.
The playlist is based on the list of songs in an album. The playlist can call on songs either by their full URN or URLs, or by their ids. The playlist can call upon songs from different albums.
A playlist can be declared as follows:
A playlist can be declared in the head of the *.mml file, or in a separate *.pla file that is called with the link element.
In this example the order in the album is reversed in the playlist.
<song src="oneday.mml" id="1">
<song src="rabbit.mml" id="2">
The head element functions like the head element of any SGML document. It contains all the metadata, links and the song title.
<meta performer="Joe Blu">
The title element is contained in the head of a song file.
Metadata contains information about a song or album. The structure of the meta element is as follows:
Reserved keywords are used as "fields" to identify the kind of metadata. Here is a tentative list of possible keywords:
See Global song naming scheme.
<meta performer="Joe Blu"
date="Fri, 01 May 1998 22:30:00 GMT"
This definition is very loose and what is regarded as an autonomous song probably depends on the composer.
The SDML cantus (ie Latin for "song") is similar to the MML song. The words "song" and "composition" have similar meanings in this context.
However, a song in MML also refers to structural performance and sound manipulation elements, thus "composition" is too limited. From a melodic point of view, a song (usually) consists of several music phrases.
The song element takes the name attribute and various others.
<bar 2>[A D] [3G D] ([3G E])2
<bar 3>[A D] [3E E] ([3E C])2
<bar 4>[3E:2 B:2] R [B E]
The typical structure of popular music usually consists of three phrases, an A and B part and the chorus.
|Verse 1||Phrase A|
|Verse 2||Phrase A|
|Verse 3||Phrase A|
|Chorus repeated||Phrase B|
A phrase can also be a smaller unit. Features that are applied to a phrase, such as a change in tempo, are valid for that phrase only.
For a bookmark the id and idref attributes are used as in SGML or HyTime. A public or system identifier is indicated. Any object can be linked to an MML "document". External objects need to be delcared firts, then called from within the body of the song.
Creating a bookmark typically consists of three steps:
Here is an example of declaring the linked entity:
<!ENTITY soundone SYSTEM "http://www.songs.org/wow.wav">
The linked location is anchore din the boy of the song with the HyTime "name location" (nameloc) element. At the objects intended location in the body of the song, add:
Links to the object can be made from many different other locations. The HyTime element clink (pronounced "c-link") element with the linkend attribute is used.
<clink linkend="1">Follow this link</clink>
The link element links the *.mml file to other files (see the list of possible files). The link element is empty and is declared as content of the head element.
Music can be described in terms of rhythmic patterns of accent -- not all notes in a bar have the same loudness. So apart from pitch and time, there is also the emphasis which notes receive. This relative emphasis is declared with the accent element. Accent values are expressed as percentages compared to the loudest beat in the song, or alternatively, th eloudest beat in a phrase (in which case accent needs to be a child of phrase).
Here is an example of the long form of the accent, ie beat number are indicated.
<accent> 1:10 2:15 3:20 4:15 </accent>
It is not necessary to explicitly accentuate each beat. Only selected beats may be highlighted:
<accent> 2:15 4:15 </accent>
Non-explicit beats should then take the average accents of the whole song or phrase.
Here is an example of a repeated note with different accents (in this case it is a snare intro).
<bar 6 (:16)8>D
<accent> 65 70 75 80 85 90 95 100</accent>
<bar 6>(R:4)3 Fs
This is translated into English as follows: The division's default note value is 1/8 notes. Bar 6 consists of 8 1/16th D-notes in octave 3. The notes become progressively louder from the first (65%) to the last (100%). On beat 8 there is a crash cymbal (note F-sharp) in the same octave. There are 3 1/4 rests in bar 6 before the crash.
This example would describe a snare intro that ends together with a crash cymbal.
The classes element allows the creation of author defined shorthand descriptions. Instead of declaring a list of elements at each instant, a series of classes can be declared and instantiated by calling on the class name.
Consider the score of Musorgsky's Boris Godunov. There are 8 C staffs totalling 40 bars on the first page. Instead of repeating the detail for all the similar bars, a class can be declared that is called.
key Fs Cs Gs Ds;
time 4:4 }
<bar 1:4> R </bar>
The function of the div element is similar to the HTML element in that it marks a blocklevel structure. It differs in that an identifier name can be declared in the div start tag, to be called upon in another (or more than one) element instance.
The application of this is as follows. The features declared for the division apply to all the children -- except where declared otherwise.
Say there is a section of music that is repeated exactly the same at different locations in the song. At the first occurrence, mark the section with the div element and assign a unique identifier name to it by using the declare attribute. At each other instance where the section should reappear, call on that unique identifier with the repeat attribute and the unique identifier name.
See the Identifier method for repeating parts of music.
The function of the span element is similar to the HTML span as it also marks inline level structures. It differs in that an identifier name can be declared in the span start tag, to be called upon in another (or more than one) element instance.
In this example an id is declared with the name one.
<bar 2>D:2 B:4
<span declare id="one"><bind><slur>5(B C D An B A Gs A C Gb) </slur></bind></span>
At a later instance, in this case Bar 10, the exact sequence of notes can be called upon with the repeat attribute as follows:
<slur id="4" end>B:4</slur>
<beat 4 repeat id="one">
This example comes from the MML of Chopin's Trois Nocturne. Also see the Identifier method for repeating parts of music.
A comment by the markup author in the code is marked just as in SGML:
<!-- this is a comment -->
Music often consists of repetition on various structural levels. It would be very uneconomical to expect explicit markup for elements that are repeated endlessly. For this reason MML deviates somewhat from most other markup languages by introducing a convention for marking repetitions.
Repetition can be declared with a notation method, or by declaring an identifier name for a section of music.
Repetition is indicated with the round brackets usually used for parenthesis:
( and )
The number of times the element should be repeated must be written after the close parenthesis symbol.
Here is the comprehensive markup for a division including five bars:
Here is the short form of the above example:
This is read as: In this division, repeat the bar element and its content five times.
A repeated element may contain another element that is repeated as its content.
In this example the same note is repeated in in several bars, and the bars are contained in a division.
<div (bar (note 2D:4)4)5>
This is translated into English as: There are five bars in the division. Each bar consists of four notes with the value: a D quarter note in the second octave.
The above examples do not specify the position where the repetition occurs. MML allows for specifying a range, with the range element. Two numbers are stated in the range: where the range begins and where it ends. What the range refers to depends on its context.
In this example the range applies to bars. The first value of the range indicates the bar number where the range begins, the seconds number the bar number where it ends.
<div (bar(range 6:10)5>
This states that within the division there are five repeated bars beginning with bar 6, ending with bar 10 (see the Note on calculations).
Repeated music phrases may contain almost exactly the same content, perhaps with a deviation somewhere along its progression. The repeated phrase can be declared with the repeat attribute, whilke exceptions within the repeated sequence are declared with the exclude attribute. Exclusion can be declared in the same manner as a range, ie beginning with the excluded element number and ending where the exclusion ends.
<div (bar(range 6:10 exclude 7)5>
In this range of 5 bars (in the division) beginning with bar 6, ending with bar 10 the 7th bar is excluded.
<div (bar(range 16:30 exclude 20:22)15>
In this range of 15 bars (in the division) beginning with bar 16, ending with bar 30, 3 bars (from 20 to 22) are excluded.
With the identifier method the section of music that needs to be copied at other instances is marked with the span or div elements, or that of the parent element of the phrase. Using these elements' declare attribute, a unique identifier name is declared. This identifier name is later used with the repeat attribute. The exact music sequence will then be repeated.
The following example comes from the MML of Chopin's Trois Nocturne.
In this example an id is declared with the name "one".
<bar 2>D:2 B:4
<span declare id="one"><bind><slur>5(B C D An B A Gs A C Gb) </slur></bind></span>
At a later instance, in this case Bar 10, the exact sequence of notes can be called upon as follows:
<slur id="4" end>B:4</slur>
<beat 4 repeat id="one">
When calculating a number of elements remember that when you add or subtract you apply the calculation to a spanned series. In other words, 10-5 does NOT equal 5, but 6, as the starting point (number) should be added as well.
In ordinary maths 10-5=5.
However, consider the following bars
|bar 1||bar 2||bar 3||bar 4||bar 5||bar 6||bar 7||bar 8||bar 9||bar 10|
Begin at bar 10 and count five bars to the left. You will end at bar 6. This is because you are counting spans. Remember to keep this in mind otherwise you will end up with included bars you actually wanted to exclude.
The characters and symbols in this section have a special meaning in MML.
Music often consists of groups of events on two different planes. A set of events can occur simultaneously, such as a group of notes that are played together, and vertically displayed in the visual staff notation. A set of events can also occur sequentially one after another, horizontally displayed in the visual staff notation. For each of these kinds of sets different notation is necessary.
In MML simultaneous events are grouped together inside the square brackets [ and ].
Here is an example of notes that are played simultaneously:
3[A C E]
The notes A C and E form a chord group in octave 3.
In MML sequential events are grouped together inside the round brackets ( and ).
Here is an example of a sequence that is repeated 5 times:
(A B C)5
The octave can be declared either with the octave element, or with the octave number preceding the note name, as in this long form:
5B 5C 5B 5D
This can be written in a short form as:
5(B C B D)
If this sequence is to be repeated, it is written as:
5(B C B D)4
This sequence is repeated 4 times.
The sequence 5( B C B D):4 has a different meaning -- each note is a quarter note. A colon preceding a number inicates note length value. If this sequence is to be repeated 4 times, the markup is: 5(B C B D):4)4 .
In this long form example the groups of notes to played simultaneously are all in the 5th octave:
[5B 5D] [5C 5E] [5B 5D] [5D 5Fs]
The short form for this is:
5([B D] [C E] [B D] [D Fs])
If this sequence is to be repeated 3 times, it is indicated as follows:
5([B D] [C E] [B D] [D Fs])3
Note that in the following example the octave number 3 applies only to the note Gs (in octave 3). A number immediately following square brackets (which indicate simultaneous notes) does NOT indicate multiplication.
<bar 6:4> [A:8 D]3Gs:8
This is translated as:
All notes occur in octave 4, except when stated otherwise. Bar 6 consists of quarter notes. Notes A and D are played together. Note A is an eighth note, to be followed with an eighth G-sharp note on octave 3.
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> ).
In this example in bar 8 consisting of quarter notes there is a vertical (ie simultaneous) group of minims, each with a dotted value.
<bar 8:4> [E A]:2. </bar>
The dotted note is relevant in notation, not to the structure of music.
Reduced very crudely, music is a function of time and frequency. Music events follow on one another through the arrow of time. Of course there can be more than one music event taking place at the same time, which distinguishes music from, for example, speech. It is difficult for us to understand when more than one person speaks at the same time (except in a speech choir). Yet modern music is typically multitimbral with many music events happening at the same time. One characteristic of the time aspect of music is repetitions of various kinds, of which rhythm is one.
Rhythm has two components: beat and tempo.
In MML tempo maps relative units (bar, beat and tick) to absolute time (minute, second, millisecond). Tempo is most often measured in terms of beats per minute (BPM) -- this method will also be used in MML.
|Relative unit||Absolute unit|
The syntax of the tempo declaration is:
relative unit (ie beat) : absolute unit
This is read "Relative unit per absolute unit". The colon is used in MML for the word per.
This tempo will be valid for the entire song except when overridden by a new value for either a bar, beat or tick.
In this example the default tempo is 130 beats per minute
Tempo can be declared in different locations:
Music may gradually slow down or increase in pace. One should be able to mark the starting point of the gradual change in tempo and the end point. Electronic devices should be able to calculate the gradual change.
The gradual increase and decrease in tempo are indicated with numerical values of the gradual attribute. The specified value should be the target value. The bar number at which the target should be reached is indicated with the target attribute.
In this example the tempo of bar 26 is stated as 105BPM to gradually increase to 120BMP by bar 30.
<tempo "105" gradual="120" target="30">
If this music has to gradually decrease in tempo from bar 26 to 30, the markup is:
<tempo "105" gradual="95" target="30">
Music performance very seldom conform to strict metronomic time. In the MIDI world the concept of humanization was introduced to change computerized music to be less machinelike. This is usually done by randomly changing different time aspects of the song.
Humanization is indicated as a percentage variation in terms of the base tempo. If the base tempo is 120BMP a variation of 10% will increase the tempo to 132BPM or decrease it to 108BMP. This is declared with the random attribute.
<tempo 120 random="10%">
Time is usually indicated in notation as: 4/4, 6/8, 7/4 etc. The second number indicates the dominant or base note length of the bar, the first number indicates the number of beats in the bar. The time element is used to mark time in a song.
The time element needs to be stated only where the time signature changes.
Time could also be stated in the short form in the start tag of the relevant element:
The bar concept relates to the bar (or measure) in written notation. The MML bar element, however, is more abstract than the bar notation and is a unit of abstract time. Usually, for most popular music, there is a one-to-one relation between bar and the notation "bar". Esoteric music that cannot be described with a notational bar could conceptually be described with the bar element, as long as there is a rhythmic pattern. Obviously the bar element would be irrelevant for non-patterned music.
A bar contains a relative time unit such as a minim, quarter, eighth, etc.
A bar typically consists of a number of beats, and beats in turn of ticks. A bar with a time signature of 4/4 typically consists of four beats in the bar.
Bars in the song are numbered sequentially. Bars are structural units and used as reference points. The content of a bar typically contains note values.
The bar number is indicated with the barid (read bar-id) attribute. Each bar should get its unique identifier name. As there are so many repeated structural elements in music that need unique identifiers, additional id attributes are introduced, of which barid is one.
<bar barid="1" notevalue="4">
<bar barid="2" notevalue="4">
A beat in a bar can typically be emphasized with drums -- but keep in mind that there is a beat even in the absence of accentuated rhythms. The beat is a relative time value. A beat may contain several notes, either a set of simultaneous notes or sequential notes.
The relative time unit of the bar indicates how many beats are in the bar. A bar with a relative time unit such as 6/8 indicates that there are 6 beats in the ba, each with a relative length of an eighth.
The beat element does not need to be stated explicitly. A sequence of notes in a bar automatically indicate beats, thus by default a 6/8 bar will take 6 beats, each note name given falling on a beat. Notes with non-beat values need to be declared explicitly.
Beat declaration also take long and short forms in exactly the same way as do bars.
In this example each note represents a beat.
<bar 3>F G A C
A beat can be subdivided sequentially as follows.
This 3rd beat of bar 6 consists of 3 consecutive notes. They are numbered in the order of appearance.
<bar 6>G B
<beat 3>A F C</beat> G </bar>
To identify each note in this beat sequence the notes are marked in the order of appearance, in this case as follows:
A = beat 3:1
F = beat 3:2
C = beat 3:3
To mark note F in beat 3 in this example with special features, use the following markup:
<bar 6>F G (A F C):16 G
<beat 3:2><slur id="5" begin>
Ticks are relative units of time measured in terms of fractions of a quarter note. In MML there are 384 ticks per quarter note.
Here is a table with tick values related to other note values.
|Note value||Tick value|
|Note value||Tick value|
|Note value||Tick value|
Note lengths in Western notation are relative and not absolute. Conventional relative note lengths are:
Absolute note lengths can be given in milliseconds, ie ms.
<beat 3>3C: 210ms
Read: a C note in the third octave, 210 ms long.
These relative lengths can be modified by extending their relative values, indicated in Western Notation by dots.
Music theorists distinguish between the possible notes in an "octave" and the actual notes. Possible notes are called the gamut, actual notes are expressed in terms of the so-called naturals and their variations. The cent is the smallest useful unit of frequency difference. One octave consists of 1200cent in the equally tempered tuning system.
Keep in mind that both octave and cent are relative units.
There are 1200cent in one octave. Average users can tolerate deviances of up to 50cent from a base note, while professional musicians pick up differences between 10 - 20 cent. A well-trained musician with good discriminating abilities can pick up differences of as little as 5cent.
From a machine perspective frequencies can be analyzed in terms of much smaller unites. Such absolute value frequencies are measured in Herz (Hz).
The cent is usually written as a "c" character with a vertical slanted line through it, ie ANSI 155 (¢, or ¢).
See the table showing the difference between just intonation and equal temperament.
Notes can be expressed absolutely as frequencies, or relatively with conventional notation. A note is also expressed in terms of its duration (see the Note length values)
These note names refer to the so-called naturals.
When these relative note names are used, the octave should also be declared, eg 3C refers to note C in octave 3.
Here are a few C notes, each in a different octave:
Apart from the note name, referring to pitch, its length is also important. In Western staff notation relative length units are as follows:
1 = whole
2 = minim / half
4 = crotchet / quarter
8 = eighth
16 = sixteenth
32 = thirty-second
64 = sixty-fourth
In MML convention a length units number follows the note name., separated with a colon.
Here are examples of an A note with different relative note length values.
The default is the whole note. However, a songs as a whole, or any part of it, may have a different default note length. To have economical markup it is advised that a default value be declared for smaller structural units, for example on beat level.
Here is a bar (bar number 20) with eighth notes as default:
Here is a beat with sixteenth notes as default:
Absolute note values are expressed in terms of frequency noted in Herz (Hz). When all notes are expressed absolutely, there is no need to state octaves.
Also see scale.
The name octave is derived from Latin referring to the eight white notes on a keyboard that form a set. Octaves are repeated cyclical at higher or lower frequencies.
Together with the 5 black notes there are 12 notes in an octave. This is only in Western tempered music. Other music systems may have only 5 notes to the "octave", or even in excess of 20 notes.
A seven-octave piano keyboard ranges in frequency from about 20Hz to 5'000Hz. There are different conventions for numbering octaves, such as the Helmholz method, (starting about in the middle of the piano keyboard and numbering outwards, thus a dual method) and the method used by music physicists (starting at one end, the lower end, and numbering serially upward).
An octave can be indicated with two methods:
When the octave number is indicated together with the note name, the number in MML precedes the note name.
As 20Hz is about the lowest audible frequency (note that lower frequencies are not so much heard as felt), numbering octaves in MML will begin with octave 0 (ie zero) at A= 27.5Hz given a certain tuning system. Conventions usually indicate the octave number as a subscript after after the note name, eg C4. This is impossible in markup code. In MML the number will precede the note name, thus middle C is 4C because it is in the 4th octave.
The octave may be declared once in the head of the song, assuming that it will not change during the course of the song. A change in octave can nevertheless be declared as a child of the song element.
The human ear is capable of hearing sounds in the range of frequencies 20Hz to 20KHz (or most likely, 17-18KHZ). Music typically ranges between 2 to 5KHz, however, the 2' pitch pipe organ reaches 8'372Kz. Harmonics of cymbals reach up to 16'000Hz (octave 9 in the table below). Here is a table showing the frequencies of A notes in different octaves, given 4A = 440HZ.
|Octave number||Helmholz number||Approximate frequencies for first A of each octave|
|Octaves 8 and 9 above are theoretical
The approximate frequencies is for a given tuning (for A = 440Hz). When A has another value (eg 442Hz), the frequencies of the other notes will also be different.
In MML the information above is typically contained in a mapped file. For A=440 the filename is 440.mmm, and for A=442 the filename is 442.mmm. Also see tuning.
Here are a few C notes in different octaves.
<bar 21>A 4A 2A A
Read: there are four A notes each on a different beat. A on beats 1 and 4 are on octave 3; the second beat on octave 4, the third on octave 2.
The scale determines which base frequencies are allowed within a set of notes. There are many different scales used in different cultures. In Western music the dominant scale consists of 12 tones in an octave. Other music systems, such as the Javanese gamelan or Indian raga use other configurations.
Even in Western music there are a few different scales in use. Due to a certain tradition the so-called equal temperament currently dominates Western culture and global popular music. In the equal temperament system the octave is divided equally between the notes. From a physics point of view this results in an out of tune scale, but our ears are so accustomed to it that it sounds right.
Here are some of the other scales that have been used in the West:
Avante garde composers in twentieth century West have experimented with as many as 19 and 24 tones to an octave, but this music has not reached the masses. In order to be globally relevant, MML will have to consider these other schemes.
The notion of sharps and flats applies only to music notation or in terms of temperament. In terms of frequency it is irrelevant.
For a whole section of a song lowered or raised notes are usually indicated immediately after the clef. Accidentals are used for a small part of the song (eg inside a bar) that requires lowering or raising of a note with respect to "natural" notes.
This is indicated with the accidental sign, in the MML with the lowercase 's' or 'f' sign.
The sharp is indicated by the lowercase 's' character.
The C4 note raised by a a semitone is thus indicated as C4s (ie C-sharp in the 4th octave).
The flat is indicated by the 'f' character.
The D4 note lowered by a semitone is thus indicated as D4f (ie D-flat in the 4th octave).
The double sharp is indicated by the 'ss' sign.
The C4 note raised by two semitones is thus indicated as C4ss
The double flat is indicated by the 'ff' sign.
The D4 note lowered by two semitones is thus indicated as D4ff.
A certain key "naturally" containing certain sharps or flats, such sharps or flats may be canceled or naturalized at specific instances.
Canceling a sharp or flat: h
Canceling a double sharp or flat: hh
Tuning is not so straightforward as it appears to be, especially on fixed pitch instruments such as keyboards. Tuning is based on the notion of scales, and there are many different scale systems in use all over the world, even within the tradition of Western music. Notes within the dominant Western scale stand in certain mathematical relationships to one another. The Pythagorean scale commonly used in Western music emphasis's thirds and sixths as consonances (ie notes that sound good together with the base note). When the frequencies of notes are calculated on the basis of the ratios between notes, the direction in which the calculations are made is important. Moving up the scale gives one answer, moving down gives another answer. For this reason the G-sharp and A-flat notes have different frequencies, yet there is only one note-key on a keyboard for both. Organs and harpsichords often provide separate keyboards for these different notes -- so that a performer could play a G sharp that differs in frequency from an A flat (which have the same frequency on standard keyboards).
To accommodate different tuning possibilities, MML will map a tuning file to the markup file.
There are two important notions here:
In Western music the note A is usually used to tune other notes by. In practice different frequencies are used for A (either 440Hz or 442Hz), which means that other notes then are also tuned to different frequencies.
In MML the frequency of the referenced A (or other note) should be indicated.
The base frequency itself serves as a reference point. Other notes are in certain relationships to the base note, and their exact frequency values depend on the system of tuning.
Here are the major tuning schemes, based on the frequency relationships between notes.
As different tuning systems can be implemented, a markup file (*.mml) should map tuning data from a data file containing tables of frequencies. Such tuning files should be saved as *.tun or *.tuning files.
This table shows the difference between just intonation and equal temperament in frequency.
|Major scale||Chromatic scale||Equal temperament||Just intonation||How far equal is off just|
|Values are in cent (¢)|
Different lyrics are often repeated for similar musical phrases as verses. It is thus necessary to indicate the applicable verse number in certain contexts with the verse attribute. Lyrics can be written as content of the song element, or in a separate file with the *.lyr extension.
In this example the lyrics for verses 1 and 2 are mapped on the same bar sequence. The bar is the parent element -- as lyrics are usually matched to music. Where music should be matched to lyrics, the task is much more complex.
In MML it should not be necessary to delcare a lyric element for each bar. Lyrics should continue along the bars until stopped with the end tag. For bars without lyrics either the lyric element should be ended, or empty piped syllables should be indicated.
<lyric verse="1">blah blah blah </lyric>
<lyric verse "2">blah2 blah2 blah2 </lyric>
There is not always a one-to-one relationship between the serial instances of notes in a bar and the syllables of the lyrics. Sometimes a single syllable is stretched out over more than one note -- indicated with the stretch element. Other times more than one syllable are squashed onto a single note -- indicated with the squash element.
Lyrics can be matched to note sequences as follows:
To determine which method is applied, the parser should first scan for double pipes. If found, the syllable method is applied and single pipes mean syllables. If not, single pipes mean bars and the bar method is applied.
In this example the syllable is stretched over 3 notes. Embrace the syllable with the stretch element.
<lyric>Once upon a
<stretch 3>time </stretch>
In this example 2 syllables are squashed to one note. Embrace the syllables with the squash element.
<lyric>Three little birds
<squash 2>upon </squash>
The following elements are applicable to the Western staff notation system.
A key can be declared as follows:
The clef is used for music notation.
Some clefs are:
The clef is used for visual notation. For audio the key element is used. These elements thus have exactly the same function, except that they are rendered differently. Perhaps a rendering machine could automatically translate the key into clef.
The five parallel lines used for music notation is the most commonly known staff. Other configurations are possible, ranging from a single line to quite a lot (eg 20 lines). The staff is used for music notation.
staff is an empty element.
The bind element is used specifically for notation to bind together notes with a bar. Its function is to make sight-reading easier by marking notes as a group.
The position of the start and end tags of the bind element indicate the range of the notes that are linked together with the small solid bar.
<bar 5>3G <bind>(3G B A C):8</bind>
The tie is used for notation purposes to indicate note length. From an audio perspective the tie is irrelevant.
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.
Three minim notes in a set of minim triplets together have the same length value as a single minim.
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.
A slur often spans across bar borders, and its ends are linked to specific notes. The following procedures should be used for implementing the slur:
A rest is the absence of any frequency -- the music part takes a rest. In MML the rest is indicated with the uppercase letter R.
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:
Note that there is a relative rest value for each of the relative note lengths values.
<bar 4:4>R R R G
<bar 4:4> (R)4 G
Rests are indicated in exactly the same way as notes.
In terms of MIDI a rest is indicated by Note Off.
Text is used mainly for notation 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.
The text element is used for the content - ie the actual words. Their position on a score is declared with a style sheet.
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 needs to be declared with a style sheet. Different languages are indicated with the ISO language abbreviation (the lang attribute), and where necessry the appropriate character set (the charset attribute) should also be declared.
<text lang="it" style="XYZ">Flauto Piccolo (III)</text>
When marking the structure of a song, a number of the elements need to be declared only once. Except when they are overridden, these default declarations will be implemented throughout the song.
Some of these default elements are:
These elements can be declared in the head element.
Nesting refers to declaring an element as the content of another. The element containing the other element is called the parent element. The contained element is called the child element. The end tag of a child element must occur before the end tag of its parent.
In this example the tempo and bar elements form a nested set.
In bar 1 the tempo is 120BPM, in bar 2 it is 130BPM
A commentary is a string of text (typed or spoken) that needs to be synchronized with the music. Commentary can take at least the following characteristics:
Songs may have unique names on a specific system, but names that are globally unique is a different matter, as the same song may have many different variations, performed differently by the same artist, as well as by many different artists, while different songs can have exactly the same names. A system similar to the ISBN system used for books will work better in the context of unique global names. The unique global name should include the following:
At this phase of the development of MML the global naming scheme will not be considered. It needs to be addressed in a future phase.
Here is an alphabetical list of elements:
a accent adsr album bar beat bind bookmark cent clef commentary div head key link lyric meta nameloc note octave phrase playlist range rest scale slur song span squash staff stretch tempo text tick time title tuning
Here is an alphabetical list of attributes:
barid begin charset declare (to declare an identifier for content that could be called upon in other instances) end exclude gradual href http id lang linkend name notevalue random rel repeat (to repeat an id'd stretch of music) span (how many bars a features spans) src staffid target type verse
Different files are used for different components of music. Here is a list of the recommended file extensions:
Data contained in these files may also be embedded in the *.mml file as content of the head element.
scope | specifications | examples
1999 © Author: Jacques Steyn, University of Pretoria, South Africa