夜光 MML Workshop

Mabinogi MML Syntax Guide

From nothing to reading and writing it

  1. What MML is
  2. Notes and rests
  3. Lengths and dots
  4. Octaves
  5. Tempo: shared by the whole piece
  6. Velocity
  7. Ties and the n command
  8. Tracks and the character limit
  9. How other tools differ
  10. The four most common mistakes

What MML is

MML (Music Macro Language) is a way of writing a score as plain text. The composing system in Mabinogi and Mabinogi Mobile reads exactly this kind of text — you paste a string like t120 l4 cdefg into the game's Blank Score and your character plays it.

It is not staff notation and not numbered notation; it is closer to writing down how each note is played, as commands. The upside is that you can copy, paste and process it with text tools. The downside is that nothing tells you when it is wrong — usually you only find out by playing it.

Every section below can be pasted straight into the editor and played. Read it while changing things: hearing the difference matters more than following the words.

Notes and rests

Seven letters map to Do through Si:

WrittenNoteWrittenNote
cDogSol
dReaLa
eMibSi
fFarRest (no sound)

Sharps use + or #, flats use -:

c+   Do sharp (same as Re flat)
d-   Re flat

Upper and lower case both work; this site treats them as the same note.

Lengths and dots

A number after the letter is that note's length, and the number is the denominator:

WrittenMeans
c1Whole note
c2Half note
c4Quarter note
c8Eighth note
c16Sixteenth note

Writing a number on every note gets tedious, so l (length) sets a default length — every note without its own number uses it:

l8 cdefg      exactly the same as c8 d8 e8 f8 g8
l8 cde4 fg    only e is a quarter note, the rest are eighths

A dot after it makes it a dotted note, 1.5 times as long:

c4.   quarter note × 1.5
c4..  quarter note × 1.75

The dot attaches to the number, and it does not stack. After l4., a following c. is 1.5 beats, not 2.25; plain c is the 1.5-beat one. Plenty of people get this wrong, and it is where miscounted beats in long phrases come from.

Octaves

o followed by 1 to 7 decides which octave the pitch sits in. o4c is middle Do.

< drops one octave and > raises one — when a melody runs up and down, those two are much shorter than writing o over and over:

o4 cde >c    that last c is an octave higher

The range the game can write is o1 to o7. Notes outside it are brought back into range and flagged in the status bar, so nothing is quietly played at a pitch the game does not have.

Tempo: shared by the whole piece

t followed by a number sets the tempo in BPM, for example t120.

This is the easiest thing to get wrong: t does not belong to one track, it applies to the whole piece.

A t written in any track changes every track from that position onwards. When more than one track writes one at the same position, the lowest track number wins.

Here is how it bites you. You write t100 in the first track only. If a player lets each track carry its own tempo, track 1 runs at 100 while the rest stay at the default 120 — and it sounds like the piece drifts further out the longer it plays. This site follows the game's behaviour: every track's t is merged into one tempo map before anything is converted, so the problem cannot happen here. The Tempo column in the status bar prints the merged result, so a mismatch is visible at a glance.

To change the tempo, use the Tempo button on the toolbar. It collapses the tempo that actually applies onto the melody track and clears t out of the others — one exit only, so you never end up with a score where two tracks fight each other.

Velocity

v followed by 0 to 15 sets the volume; the bigger the number, the louder. Like l it stays in effect — once set, every note after it uses that velocity until the next v.

v12 cde v8 fga    the first three notes louder, the last three softer

In an ensemble, dropping the accompaniment tracks a few steps lets the melody come through. The Velocity button on the toolbar adjusts a whole stretch at once, so you do not have to edit them one at a time.

Ties and the n command

& joins two adjacent notes of the same pitch into one long note:

c1&c1    a Do two whole notes long, with no break in the middle

Long notes across a bar line, and beats a single length cannot express (five beats, say), both rely on it.

n followed by a number is an absolute pitch: n48 is the same as o4c. It ignores o and does not change the octave state that follows. You rarely want it by hand — it mostly turns up in scores that tools produced.

Tracks and the character limit

Mabinogi's Blank Score takes 6 tracks: one melody plus five chord tracks. Tracks are separated by commas, with MML@ in front of the whole piece and ; at the end:

MML@t120l4cdefg,l4ceg,l4egc;

Each track holds 2,400 characters at most. That is a hard limit in the game — go over it and the text will not paste in. Whitespace does not count: line breaks and indentation use none of the budget, so break lines by bar freely to keep the score readable.

This site's editor opens 15 tabs, but only the first 6 reach the game; the other nine are for parking material while you arrange. A tab's position is its identity, so dragging to reorder moves the content and the instrument with it.

Past 2,400 characters the count turns red, but nothing stops you editing. To get it back down, see that section of the FAQ.

How other tools differ

MML is not only used by Mabinogi, and the details differ between implementations. This site's parser follows Mabinogi's spelling, and handles a few foreign ones on top so that a score you picked up elsewhere still reads in:

WrittenWhat this site does
hTreated as b. German notation; it turns up in 3MLE scores now and then
Instrument commands starting with @Read, but they do nothing. The sound here is decided by the Instrument dropdown on the tab
[ceg]4 chordsDiscontinued. [ and ] are thrown away along with any other characters that make no sense, and the note letters inside are read as single notes in order — so chords in an old score turn into a melody
A comma inside one trackYou get a prompt to use Paste instead, which is what splits it into tracks properly
The MML@ prefix and the trailing ;Harmless when pasted into a single tab; parsing and export both deal with them for you

The four most common mistakes

  1. Thinking t only affects its own track — it affects the whole piece. Give every track its own tempo and the result is guaranteed to drift.
  2. Miscounting a stacked dot — after l4., a following c. is still 1.5 beats.
  3. Assuming [ceg] chords still work — they are discontinued, and those three letters are read as three notes in a row. A real chord has to be split across tracks.
  4. Counting characters but not tracks — 2,400 is the limit for each track, not for the piece. Six tracks together come to more than fourteen thousand characters.

To turn a finished piece into MML without typing it note by note, see the MIDI to MML guide.