[This local archive copy is from the official and canonical URL, http://www.cir.nus.edu.sg/music/mnmlv200.html; please refer to the canonical source document if possible.]
Syntax Specification for the
Musical Notation Markup Language
to be used for Internet Music Transfer and Archiving
Peter Chiam Yih Wei, Kartik Narayan,
Leong Kok Yong and Dr. Tan Tin Wee
Internet Research and Development Unit,
Computer Centre,
National University of Singapore
Objective
MNML is developed to be a syntax which will, in the most concise way
possible, attempt to represent the entire musical and lyrical content of a
music score. A score thus coded can be transmitted over a network and
reconstructed in its entirety at the client's end. Other applications
could include archiving of musical pieces, which could be searched for
particular melodies and time signatures. It must be noted that MNML, at this
stage, will only preserve the basic melody and lyrics of the piece, and will
not attempt to fully describe the music, with all its nuances. The syntax
is not designed to include all the embellishments found in the original
score. Some embellishments critical to the music will be supported.
Description
Every entity seen in a musical score, with the exception of the horizontal
lines representing staves are termed as 'Musical Objects' in MNML. These
would include:
- Clefs
- Notes
- Rests
- Bar-Lines
- Text
- Key Signatures
- Time Signatures
These 'Musical Objects' have certain properties depending on the nature of
the object. Following are the Objects and their properties.
- Clefs
- Clef Number: a number that represents the staff number
that the clef will appear on. For example, in a 3-staff
notation, we must have 3 clefs, 1, 2 and 3, which will
respectively be used on staves 1, 2 and 3.
- GIF Filename: is the name of the file that will be used in the
actual score.
- Middle Note: The middle note defines the octave and tone of the
note that will appear on the middle line of the staff
containing the clef. For example, in the case of a treble
clef, the middle note is '4b'.
- Position: is the x-displacement of the clef relative to the bar-line
that denotes the beginning of the current bar. The unit is
pixels.
- Notes
- Staff: denotes the staff on which the notes will appear.
- Octave: denotes the Octave of the note (0 for the lowest audible
C, 3 for middle C).
- Note Value: ranges from 'A' to 'G' for notes with their stems
upwards and 'a' to 'g' for notes with their stems downwards.
In addition, the appropriate symbols may be used for a
sharp (#), double sharp (x), flat (-), double flat (=) or
natural (n).
- Duration: is a number representing the duration of the note. It
ranges from 0 for a Breve, 1 for a semi-breve, 2 for a
Minim and so on.
- Position: is the x-displacement of the note relative to the bar-line
that denotes the beginning of the current bar. The unit is
pixels.
- Miscellaneous: properties include whether the note belongs to a group
joined by beams, ties and/or slurs, and/or whether the note is
a part of a triplet etc.
- Rests
- Staff: denotes the staff on which the rests will appear.
- Octave: denotes the Octave of the note in whose position the rest
will appear.
- Note Value: ranges from 'A' to 'G' and denotes the Note Value of
the note in whose position the rest will appear.
- Duration: is a number representing the duration that the rest is
to be held. It ranges from 0 for a breve, 1 for a semi-breve, 2 for a Minim and so on.
- Position: is the x-displacement of the rest relative to the bar-line
that denotes the beginning of the current bar.
- Bar-Lines
- Bar Type: is a number from 1 to 3 representing:
1 - single fine (bar line)
2 - double fine
3 - single fine and single thick (end of piece)
- Position: is the x-displacement of the line relative to the bar-line
that denotes the beginning of the current bar.
- Text
- Vertical Offset: is represented by the number of the staff that the
text are associated with, in addition to a symbol '+' or '-'
specifying whether the text appears below (+) or above (-)
the staff.
- Text: is the text itself
- Formatting: italics, underlined, bold or normal.
- Justification: Centered Right or Left. Centered means that the text is
located with its center at the specified position. Left
means that the text is located with its beginning at the
specified position. Right means that the text is located
with its end at the specified position.
- Position: is the x-displacement of the text relative to the bar-line
that denotes the beginning of the current bar.
- Key Signatures
- Definition: denotes the key signature of the musical piece.
- Position: is the x-displacement of the key signature relative to the
bar-line that denotes the beginning of the current bar.
- Time Signatures
- Definition: denotes the time signature of the musical piece.
- Position: is the x-displacement of the time signature relative to the
bar-line that denotes the beginning of the current bar.
Structure
Every Musical Object appearing in a score is defined in the MNML format
within a pair of angled brackets '<' and '>'. The properties of the
Musical Object are defined within the brackets as fields separated by
colons ':'.
The structure and usage of MNML is best explained by
the use of examples. Following are certain examples defining the
important characteristics of MNML.
Examples:
- A Clef has two tags associated with it. One to define the clef and
one to draw it.
- <defn 1:"treble.gif":4b>
defines the clef on staff 1 of the score as a clef represented by the GIF
file "treble.gif". Also the middle note for this clef is defined as the B
above the middle C.
- <clef 1:20>
draws clef 1 (defined earlier) on staff 1 20 pixels to the right of the
previous bar line.
- Notes
- <1:3en:4:40>
draws a quaver (4) on the first staff (1) 40 pixels to the right of the
previous bar line; the note is the E above middle C (3e) and has a stem
pointing down (lower case 'e').
- <2:2C#:5:80:h1,3> <2:D::100:h1,3>
<2:E::120:h1,3>
(h1,3) defines a set of 3 notes grouped together by a beam (h) and assigned
the index number 1.
These 3 notations draw a set of 3 semi-quavers (5) joined together by beam
number 1 (h1,3). The 3 notes are C#, D and E all an octave below middle C.
The notes are drawn on staff 2. The definition of clef 2 must be made earlier,
or a default of treble clef will be assumed.
You may have observed above that the 2nd and 3rd notes do not have
associated octaves and durations. It is implicit in the nature of MNML to
inherit these properties from the previous Musical Object.
Inheritance is a very powerful feature of MNML.
- <1:2C+E+G:2:80>
defines a chord of C E G an octave below middle C, of minims (2) on the first
staff, 80 pixels to the right of the previous bar line. Note the inheritance.
- Rests
- <rest 2:4c:2.:50>
draws a dotted minim rest in the position of C above middle C, 50 pixels to the
right of the previous bar line on staff 2.
- Bar-Lines
- <bar 1:200>
draws a single fine bar line 200 pixels to the right of the previous bar line.
- Text
- <text 1+:"Hallelujah":u:c:50>
writes the word 'Hallelujah', underlined (u), centred (c) 50 pixels to the
right of the previous bar line below the first staff (1+).
- Key Signatures
- <key 1:#fcg:nd:20>
This represents a transition from E major (F sharp, C sharp, G sharp,
D sharp) to A major (F sharp, C sharp, G sharp, D natural), 20 pixels to the
right of the previous bar line on the first staff.
- <key 2:-bead::20>
Defines the key signature of A flat major (BEAD flats) on the second staff,
20 pixels to the right of the previous bar line. Note the empty third field
between the second and third colons representing the lack of naturals.
- Time Signatures
- <time 1:4/4:20>
This represents a simple quadruple time (4/4) on the first staff, 20 pixels
to the right of the previous bar line.
- <time 2:2/4:30>
This represents a simple duple time (2/4) on the second staff, 30 pixels to
the right of the previous bar line.