First you have your header. This has worked for me thus far: <mei; xmlns="http://www.music-encoding.org/ns/mei"> <meiHead> <fileDesc> <titleStmt> <title>Musicality of a Phrase</title> </titleStmt> <pubStmt/> </fileDesc> </meiHead> Even if you don’t plan on using most of these tags keep them! They are important for matching the schema. Then we begin by encoding the key elements of the piece, that is the key signature, time signature, and labels of each part. Mine looks like this: <music> <body> <mdiv> <score> <scoreDef meter.count="2" meter.unit="4" key.sig="3s"> (beats in a measure/the kind of note that gets one beat/the key signature) <staffGrp symbol="line"> (the marking next to the first measure) <staffDef n="1" label="Singstimme." lines="5" clef.shape="G" clef.line="2"/> (the number of staves associated with the part/the name of the part/how many lines in the staff/what clef/what line the clef is associated with) <staffGrp symbol="brace" label="Pianoforte."> <staffDef n="2" lines="5" clef.shape="G" clef.line="2"/> <staffDef n="3" lines="5" clef.shape="F" clef.line="4"/> </staffGrp> </staffGrp> </scoreDef> </score> </mdiv> </body> </music> Keep in mind that <mdiv> can be useful in separating particular portions of text. That is, if you are encoding an entire opera, you can use <mdiv act= “1”> or something of that nature to delineate where one portion of the opera ends and the other begins. We use it in our project to separate the songs from each other.
Be sure to include the beats per minute if it is included at the top of the page, usually above the first measure. This can be included as a comment within the <measure> tag, and looks like this: <!--<tempo place="above" staff="1" mm="96">♩=96</tempo>-->
Then we move into encoding the music. I recommend starting with something simple, like a piece with one staff, but if you’re ambitious like us and are starting with a three it can get a little complicated. It will be okay! It looks like this: <measure n="1"> <!--<tempo place="above" staff="1" mm="96">♩=96</tempo>--> <staff n="1"> <layer n="1"> <rest dur="1"/> </layer> </staff> <staff n="2"> <layer n="1"> <note pname="e" oct="5" dur="2" dots= "1" stem.dir="up"/> <note pname="e" oct="5" dur="4" stem="up" tie="i"/> </layer> <layer n="2"> <note pname="c" oct="5" dur="2" dots="1" stem.dir="up"/> <note pname="c" oct="5" dur="4" stem="up" tie="i"/> </layer> <layer n="3"> <note pname="a" oct="5" dur="2" dots="1" stem.dir="up"/> <note pname="a" oct="5" dur="4" stem="up" tie="i"/> </layer> <layer n="4"> <beam> <note pname="e" oct="4" dur="8" stem.dir="down"/> <note pname="f" oct="4" dur="8" stem.dir="down"/> <note pname="e" oct="4" dur="8" stem.dir="down"/> <note pname="f" oct="4" dur="8" stem.dir="down"/> </beam> <beam> <note pname="e" oct="4" dur="8" stem.dir="down"/> <note pname="f" oct="4" dur="8" stem.dir="down"/> <note pname="e" oct="4" dur="8" stem.dir="down"/> <note pname="f" oct="4" dur="8" stem.dir="down"/> </beam> </layer> </staff> <staff n="3"> <layer> <mSpace/> </layer> </staff> </measure>
Let’s break it down. So we start with the measure number, then go right into the staff. Work from top to bottom. Staff number 1, layer 1 (layers note which musical phrase we’re looking at, again start from top to bottom), and then we encode our notes. The note name, the octave the note is in, the duration (WARNING: This is NOT the duration in terms of the time signature, so a quarter note is “4,” not “1” beat if we’re in four/four. This exists outside of the time signature, remember), whether or not there are rhythmic dots, and the stem direction. If you have notes connected (i.e. 16th notes), they get the <beam> tag at the start.
But wait, what if we have a measure with no information? Can we leave it out? I recently discovered no you cannot! Instead, you insert the <mSpace> element, which stands for measure space. This makes sure we are aware that there is an empty measure but not missing any information.
ENCODING TIES: to encode a tie, there are three different @attributes: -the “i” @attribute shows the initial note that starts the tie -the “m” @attribute shows a note that is in the middle of a tie -the “t” @attribute shows the note that terminates the tie we write this as follows: tie="i" or “m” or “t”
Sometimes it gets a little complicated, and we have to include things like chords, which are clusters of notes played at one time. These look like this: <chord> <note pname="f" oct="4" dur="1"/> <note pname="g" oct="4" dur="1"/> <note pname="a" oct="4" dur="1"/> <note pname="c" oct="5" dur="1"/> <note pname="e" oct="5" dur="1"/> </chord> In this instance, while we usually work from top to bottom, we build the chord from the bottom. The bottom note in this chord is an F, so we start with that!
So we’ve covered @attributes like @pname, @oct, @dur, @stem.dir, and @tie. Here’s another one: @accid!! This notates an accidental, such as a sharp, flat, or natural. In order to mark an e flat, for instance, you would do the following: <note pname="e" oct="4" dur="1" stem.dir="up" tie="i" accid="f"/>
Notes for @attributes: @pnames must be lowercase letters stem directions MUST be called @stem.dir. You’ll be tempted to get rid of the .dir. DO NOT DO THIS!!!! @accid must be the first letter of the accidental (“f” for flat, “n” for natural, and “s” for sharp. With double flats or sharps, simply do two letters (“ff” “ss”).
On the subject of @attributes, let’s cover articulation. Articulation is the weight or specific way of playing the note in terms of how long/short/heavy/light etc. it should be played. We mark it like this: <note pname="f" oct="4" dur="8" stem.dir="up" artic="stacc"/> In this case, the articulation (marked as @artic) is staccato, which is why we have the abbreviation “stacc.” There are many different options for articulation, which oxygen gives you once you type in the @artic.
So, something you may not have considered is how to encode a first and second ending, or any kind of repetition. This can be a little difficult, but we’ll break it down! When you have a first and second ending, they tend to have repeat signs at the start and end of each section. We tag these sections as <section> and add a comment “this section to be repeated.” We also add the tag with the @attribute: <measure n="22" right="rptend"> This says that there is a repeat sign on the “right” side, and that it repeats the “ending.” Depending on where this sign is located (right or left) it can indicate a repetition of the end or the start. We then tag the measures that are within the endings as <ending n= “1”> or two, depending on what ending you are addressing. The end tag will follow the final measure of that section.
Slurs and Dynamics: Slurs are a little funkier to tag, but it’s doable! The notation comes at the end of the measure, after all of the staves and layers. It looks something like this: <slur tstamp="4" tstamp2="0m+4.5" curvedir="below" staff="1"/> So let’s break this down. The first “tstamp” or timestamp, marks where the first beat of the slur appears. So here, the slur appears on the fourth beat. The second “tstamp” marks where the slur ends, in this case, on the upbeat of 4. We use “0m+4.5” to make clear that we are in the same measure; that is, the slur does not carry across bar lines. If the slur started on the down beat of 2 and ended on the upbeat of 4, it would say tstamp=”2” and tstamp2=“0m+3.5”. The @curvedir is optional, but offers notation for where the slur marking appears in relation to the notes, and the staff informs us of where in that measure it appears.
Dynamics are similar to slurs in how they are encoded. The notation can come at the end or beginning of the measure (as long as it’s not in a staff, you’re good to go) and looks something like this: <dynam tstamp="1" place="below" staff="2">f</dynam> Once again, the “tstamp” or timestamp makrs where the first beat of the dynamic appears (usually that’s the first beat of the measure). The place indicates where in the music it is located, and in this case it would be below the staff itself, and from there you specify which staff it is located around. Then you close the start tag, and specify verbatim what is written in the music (f for forte, p for piano, etc.) and then the endtag. Likewise, hairpins, which are another form of dynamic which mark crescendos and decrescendos, have their own element that is annotated using the same @attributes as a <dynam> element. It looks something like this: <hairpin form="cres" tstamp="3" tstamp2="3.5" place="below" staff="1"/> You can also include the layer if you are concerned about specifying that @attribute, but I was happy with just noting where it was in relation to the staves.
Displaced Pitch: What happens if the pitch has been displaced? We call this otava, or otava bassa depending on whether the pitch is being raised an octave or lowered an octave. In this instance, the tagging can be a little tricky, but is similar to the slur. It looks a little something like this: <octave dis="8" dis.place="below" tstamp="1" tstamp2="0m+4.5" staff="3" layer="1"/> So what does all that mean? WELL the <octave> tag reminds us that something different is happening with the pitch itself, either it is being played an octave higher or lower. The @dis attribute states how much of a shift there is (an octave is eight notes, so 8) while the @dis.place attribute marks whether it’s an octave higher (above) or lower (below). The @tstamps function the same way as in the slur tag, and the @staff and @layer do as well.