MewMMLPad

MML Reference — full command specification

🌐 日本語

Every line begins with a track letter (AP). Commands are case-sensitive (notes excepted, in Accent mode).

Concatenating uppercase track letters with no spaces applies the same content to all of those channels (multi-channel writing).

ABCDE  L16        ; Sets L16 on channels A through E
AB     c4 d4 e4   ; Plays c4 d4 e4 on both A and B
  • Channels are AP.
  • A space is required right after the letters (AB4 is parsed as channel A playing note B4).

Pitch and octaves

Notation Meaning
C D E F G A B Natural notes (Do–Si)
C+ or C# One semitone up (sharp)
C- One semitone down (flat)
C= Natural (ignore the key signature for this note only)
On Octave (n = 0–8, default 4)
< Lower the octave by 1
> Raise the octave by 1

Note names and octave commands are valid in either case (c = C, o3 = O3). The exception is when $Accent=On (Accent mode) is active: uppercase notes use the accent velocity (V) and lowercase notes use the non-accent velocity (v). When you are not using Accent mode, mix cases as you like.

Natural can be combined with a length:

{-eab} c=4    ; In E♭ key, C remains natural
c=4.          ; Dotted quarter natural C

Note length

Notation Meaning
Ln Set the default length (1 = whole, 2 = half, 4 = quarter, 8 = eighth, 16 = sixteenth, 32 = thirty-second. Default 4)
Ln. Dotted (×1.5). Example: L4. = dotted quarter
Ln.. Double-dotted (×1.75). Example: L4..
Ln... Triple-dotted (×1.875). Example: L4...
C4 Quarter-note C (length right after the note)
C4. Dotted quarter C
C4.. Double-dotted quarter C
C4-32 Quarter minus a thirty-second (= 7/32 beat)
C4+8. Quarter plus a dotted eighth (= 7/16 beat)

The arithmetic can be chained: C1-4-8, etc.

Special notes

Notation Meaning
R or R4 Rest (length may be specified)
N60 Direct MIDI note number (0–127)
X or X4 Re-trigger the previous pitch (length may be changed)
C4&C4 Same-pitch tie: always merged into a single note (equivalent to c2, no re-trigger)
a8&b8 Different-pitch tie: handled per $TieMode
a^b Slur: play a at Q=8 (full gate) and continue into b
g^g Same-pitch slur defaults to “re-attack” (FullGate). Set $SameNoteSlur=Combine to make it merge like &

Tie / slur modes

& (tie) is the “connect notes” symbol — same-pitch is always Combine (merged). ^ (slur) is the legato symbol that re-attacks the next note. Only the same-pitch behavior of ^ can be switched with $SameNoteSlur.

Setting Behavior
$TieMode=Slur (default) / $TieMode=Default Different-pitch tie holds the previous note at full gate and then normally attacks the next one. Chainable (c&d&e&c).
$TieMode=Bend Different-pitch tie: no re-attack — pitch bends to the next note at its onset. Requires $BendRange to be set.
$BendRange=12 Pitch-bend range (default 2 semitones). The built-in synth follows the same range automatically. Intervals greater than the range are clipped.
$SameNoteSlur=Default / FullGate Same-pitch ^ = FullGate (re-attack). Does not affect same-pitch &.
$SameNoteSlur=Combine Same-pitch ^ = Combine (merged, like &).

Volume / velocity

Notation Meaning
Vn Set accent velocity (0–127, default 100)
vn Set non-accent velocity (used in Accent mode)
) Raise velocity by lv
( Lower velocity by lv
lvn Set the step size for ) / ( (default 8)

Tempo / quantize

Notation Meaning
Tn Move the BPM slider in standalone playback (ignored in DAW mode)
Qn Gate length as a fraction of the full length (1–8, default 8). 8 = 100 % gate, 4 = 50 % gate.
qn Shorten release by n ticks (192-per-bar, independent of Q). Example: q4 → release ends 4 ticks earlier (1 beat = 48 ticks, so well under a beat).

Accent mode

Notation Meaning
$Accent=On Enable Accent mode
$Accent=Off Disable Accent mode (default)

With Accent mode on:

  • Uppercase notes (CB) → the accent velocity set by V.
  • Lowercase notes (cb) → the non-accent velocity set by v.
V100 v50  CEcegCEceg

Transpose (the K command)

Notation Meaning
Kn Shift subsequent notes by n semitones (example: K7 = perfect fifth up)
K-2 Shift down 2 semitones
K0 Reset (back to 0)
K) Relative +1 semitone
K( Relative -1 semitone
K)2 Relative +2 semitones (number is allowed)
  • Range: -127 to +127.
  • Added to the UI transpose slider’s value.
  • The current value appears in parentheses (e.g. (+3)) on the channel monitor.

Key signature

Notation Meaning
{-eab} Set flats on E, A, B (example: C minor)
{+f} Set sharp on F
{=eab} Reset E, A, B back to natural
{=*} Reset all (C major)
  • Per-note accidentals (C+ / C- / C=) override the key signature.
    • Example: {-e} e- → E♭ (the explicit - wins).
    • Example: {-e} c= → C natural (this note ignores the key signature).
  • Stacked specs like {-e}{-a} accumulate. Use {=e} to reset just one note.

Pan

Notation Meaning
P64 Absolute (0–127, 64 = center)
PL32 32 steps left of center (= P32)
PR32 32 steps right of center (= P96)
PC Back to center (= P64)

Out-of-range values are clamped.

Pitch bend

Syntax:

source(delay) _ (transition) target(total_length)

The parts in parentheses are optional, with different defaults for each:

Omitted part Default
Delay 0 (bend starts immediately)
Transition total_length − delay (uses all the remaining time)
Total length The L default

Omitting total length (= L)

Notation Behavior
a_b Bend from a to b over the L duration
a_16b Spend 1/16 of L bending to b, then hold b for the rest

Specifying total length

Notation Behavior
a_b4 Bend starts immediately. Total = quarter note.
a_16b4 Bend starts immediately, spends 1/16, total = quarter note.
a8_b4 Hold for an eighth, then bend over the rest. Total = quarter.
a8_16b4 Hold for an eighth, bend for a sixteenth. Total = quarter.

Other

a8_16>b4         ; Octave commands like > can appear before the target note
g4 ~32 >c2_8d1   ; Combinable with glissando
Setting Description
$BendRange=12 Pitch-bend range (default 2 semitones). Also applies to different-pitch ties (Bend mode). The built-in synth follows the same range automatically; external host instruments need a matching setting in the DAW.
$PitchBendOrigin=Default Note-on on the target pitch; the source pitch is shown by a mid-bend value (default).
$PitchBendOrigin=Target Same as Default.
$PitchBendOrigin=Source Note-on on the source pitch; bend toward the target.

Glissando

Notation Behavior
g~b1 Glissando from g to B1 (B in octave 1)
g~16b1 Glissando in 1/16 steps
$Glissando=16 Set the default step size (default 32)
  • The source note (g) is not sounded on its own.
  • The path is chromatically interpolated within the time you give it.

Tuplets

Notation Behavior
{gac}4 3 notes evenly spread across a quarter (triplet)
{ga>cef#gb<}2 7 notes in a half note (septuplet)
  • Inside { }, the commands < > O V Q & ^ _ are allowed.
  • & ties and ^ slurs work inside tuplets (& per $TieMode, ^ per $SameNoteSlur).
  • Octave changes inside { } persist outside as well.
  • Rests R count as one slot.

Repeats

Notation Behavior
[CDEF]4 Repeat 4 times
[C [EG]2 A]3 Nested repeats are allowed
[a:b]3 Loop exit: on the final iteration only, skip everything after : → expands as a b a b a. Handy for dropping a fill-in only on the last pass.

Aliases (macros)

Notation Behavior
% Name cdef Define content “cdef” under the name “Name”
A %Name Expand “cdef” on track A
% Chord CEG Any MML can be aliased
  • Alias names are alphanumeric.
  • During expansion, the playhead stays at the alias call site.

Variables

Notation Behavior
!X{abc} Define variable X as “abc” (single-character name)
!X Expand variable X
A !X{D} !X Inline definition followed by immediate use on the same line

Variables are per-channel (X on A and X on B are independent values).

Program change

Notation Behavior
@n Send a Program Change (0–127). If n is 128 or higher, it is auto-split into Bank LSB + Program (bank = n / 128, slot = n mod 128).
@bank:slot Specify Bank and Slot explicitly (e.g. @3:120 → Bank 3, Slot 120)
  • At the same PPQ, Bank Select is sent before Program Change.
  • Consecutive identical PCs are deduplicated (per channel).

Program Change send mode

Setting Behavior
$ProgramChange=Default Send Program Change as per the MIDI spec (default).
$ProgramChange=CC<num> Send the slot number on CC<num> instead of Program Change. Example: $ProgramChange=CC102. For hosts where PC does not reach processBlock (such as Cubase in VST3). Bank Select still goes on CC 0 / 32.

Misc

Notation Behavior
Tn Move the BPM slider in standalone playback (ignored in DAW mode)
; comment Everything from ; to the end of the line is a comment (ignored)
# header Lines starting with # are ignored