This chapter explains how to specify note duration (aka, note value). This refers to the length of a note on the score, before it is converted to duration in seconds based on the tempo.
Initially, the base duration (reference duration) is set to the length of a quarter note. This means that notes without any duration specifications will default to quarter notes.
Placing * after a note doubles its duration, each time it is added (thus, adding two makes it four times longer). Placing / reduces the duration by half each time it is added (in other words, / functions like a note flag on the staff notation). A dotted note is expressed with .; one dot extends the note length by 1.5 times, and two dots by 1.75 times. The table below shows the notation for representative durations when the base duration is a quarter note. The tick count indicates durations in units of 1/480th of a quarter note. Since these designations are relative to the base duration, for example, if the base duration is an eighth note, all values in this table will be half of what is shown.
| MML | Meaning | Staff notation |
Ticks | MML | Meaning | Staff notation |
Ticks | |
|---|---|---|---|---|---|---|---|---|
c*** |
double whole note | ![]() |
3840 | c*. |
dotted half note | ![]() |
1440 | |
c** |
whole note | ![]() |
1920 | c. |
dotted quarter note | ![]() |
720 | |
c* |
half note | ![]() |
960 | c/. |
dotted eighth note | ![]() |
360 | |
c |
quarter note | ![]() |
480 | c.. |
double-dotted quarter note | ![]() |
840 | |
c/ |
eighth note | ![]() |
240 | c/.. |
double-dotted eighth note | ![]() |
420 | |
c// |
sixteenth note | ![]() |
120 | |||||
c/// |
thirty-second note | ![]() |
60 |
To specify durations for a group of notes, enclose the group with { and }, and place the note duration symbols after it.
{cc}/ {cccc}// {c{cc}/}/ {c.c/}/

In the example above, the last note becomes a sixteenth note because the base duration within the { and }/ is halved, and the / next to the note halves it again. Note that beam connections in the staff notation are determined automatically by notation systems, and are irrelevant to how notes are grouped in MML (thus, even if you write the first two notes as c/c/, this will not cause the beam to break).
The sequence of symbols indicating note values shown in the table above (considered an empty sequence for quarter notes) can be combined using ~ to represent the sum of their durations. The ~ character corresponds to a tie in staff notation. For example, writing c~ is interpreted as connecting an empty symbol sequence and another empty sequence, resulting in a duration equivalent to two quarter notes, namely a half note. Other usage examples are shown below.
c~~ c~/ c/~~/ c/~

In Pytakt, any notation specifying note values is treated as equivalent as long as the number of ticks is the same. For example, the above example can also be expressed using only ties, with the base duration set to an eighth note (L8).
L8 c~~~~~c~~c~~~c~~
This notation style is known as “Sutoton” notation (Sutoton is a form of rhythmic phoneticization in Japanese traditional music), and is helpful for converting rhythms imagined in the mind into MML.
When a positive integer n follows immediately after /, such as /3, adding it to a note or a { … } group reduces its duration to one-nth of the original. This enables the representation of various tuplets, as shown in the examples below.
{ccc}/3 {ccc}*/3 {ccccc}/5 {ccc~cc}/3 {ccccc{ccc}*/3}*/7 {cccc}*./4

To change the base duration, place a capital L followed by one of 1, 2, 4, 8, 16, 32, 64, or 128. For example, L16 changes the base duration to the length of a sixteenth note. For a dotted note, append DOT to the length specification; for a double-dotted note, append DOTDOT (e.g., L8DOT changes the base note value to a dotted eighth note). The base duration can be changed at any point in the song (see the example below).
L8 cde* L16 gabagfed L1 c

When the base duration is changed within curly braces, it is valid only within those braces; after exiting the braces, the original base duration resumes. Additionally, placing a duration change in parentheses (e.g., (L4)) after a note modifies the duration for that specific note only; such specifications can be used as absolute duration specifications, unaffected by the base duration at that point (see below).
L8 cd(L4)f {L16 gaba} ge

You can also specify the base duration using mathematical expressions. In this case, write L= followed by an expression consisting of a duration name like L16 as described above, a numerical value, or a combination of these using +, -, *, or /. For example, L=L4/3 sets the base duration to one-third of a quarter note, L=L2+L8 sets it to the summed duration of a half note and an eighth note, and L=100 sets it to 100 ticks (equivalent to 100/480th of a quarter note). You can also use it inside parentheses like c(L=100). Note that when using mathematical expressions, you must always precede L=, such as c(L=L4/3) or {L=L2+L8 cdef}; notations like c(L4/3) or {L2+L8 cdef} will result in an error.
Below are examples of songs described using the features explained so far. The L8 at the beginning of each line is optional except for the first line, but is recommended for clarity.
F. Schubert, “Heidenröslein” (transposed to C major) IMSLP page
L8 eeee {gffe}/d~ ddef g~^cr
L8 eeee {gf+f+e}/d~ gga.g/ {f+gab}/g~ {gbagf+ed+e}/ ^c.f+/ g~
L8 ddef g{ab}/^c~ a^cfac{ed}/c~
H. Werner, “Heidenröslein” (transposed to C major) IMSLP page
L8 e~eg.f/e d~dd~~ e~efga a~~g~~
L8 g~fe~e e~dc~~ c~ccde f~ed~~ e~eg.f/e e~~d~~
L8 e~ga~a gab^c~~ ^c~ag~e d.e/dc~~
F. Schubert, “Ständchen (Serenade)” IMSLP page (No. 4)
L8 {ab-a}*/3^d~~a {gag}*/3^d~gr a~~g{gfe}*/3 f~~~rr rrrrrr rrrrrr
L8 {ab-a}*/3^f~~a {gag}*/3^e~~^d ^c~~b-{b-ag}*/3 a~~~rr rrrrrr rrrrrr
L8 a.^c+/^f~~^e ^d.a/f~~d {b-ab-}*/3^d~~b- a~~~~~
L8 {gf+g}*/3b-~~g f~~~~~
L8 a.^c+/^f~~^e ^d.a/f+~~d {ba+b}*/3^d~~b a~~~~~
L8 ^{ed+e}*/3^g~~^c+ ^d~~~~~
L8 a.a/^c+.^c+/^e.^e/ ^d~^c+~rr a~~^c+^e.^d/ ^c+~~~rr
L8 ^f+~~^e^{edc+}*/3 b.^c+/^d~br rrrrrr rrrrrr
L8 {ba+b}*/3^d~~b a~~~~~ ^{ed+e}*/3^g~~^c+ ^d~~~~~ ~~ rr ^d~
L8 b-~~~~~ a~~~~~ f+~~~rr r(L=L2DOT*6)
If the base duration is a quarter note, the opening would be
{ab-a}/3^d.a/, but as above, using an eighth note as the base duration makes the dotted rhythm clearer. Good to remember that{}*/3is a common notation used to fit three notes within the space of two.
The same piece written in the second style described in Chapter 2 is as follows:
L8 {A Bb A}*/3 ^D~~ A {G A G}*/3 ^D~ G r A~~ G {G F E}*/3 F~~~rr rrrrrr rrrrrr
L8 {A Bb A}*/3 ^F~~ A {G A G}*/3 ^E~~ ^D ^C~~ Bb {Bb A G}*/3 A~~~rr rrrrrr rrrrrr
L8 A. ^C#/ ^F~~ ^E ^D. A/ F~~ D {Bb A Bb}*/3 ^D~~ Bb A~~~~~
L8 {G F# G}*/3 Bb~~ G F~~~~~
L8 A. ^C#/ ^F~~ ^E ^D. A/ F#~~ D {B A# B}*/3 ^D~~ B A~~~~~
L8 ^{E D# E}*/3 ^G~~ ^C# ^D~~~~~
L8 A. A/ ^C#. ^C#/ ^E. ^E/ ^D~ ^C#~rr A~~ ^C# ^E. ^D/ ^C#~~~rr
L8 ^F#~~ ^E ^{E D C#}*/3 B. ^C#/ ^D~ B r rrrrrr rrrrrr
L8 {B A# B}*/3 ^D~~ B A~~~~~ ^{E D# E}*/3 ^G~~ ^C# ^D~~~~~ ~~ rr ^D~
L8 Bb~~~~~ A~~~~~ F#~~~rr r(L=L2DOT*6)