MML Player

Use this tool to share quick musical ideas.

MML syntax

MML (Music Macro Language) is a compact text format for describing melodies.

TopicTutorialExamples
NotesUse a to g for notes A to G.cegc
RestUse r for rest.ccggaagrffeeddc
WhitespaceUse whitespaces to make the MML more readable.c e g c
AccidentalsUse + for sharps, and - for flats.df+ad
e-gb-e-
OctaveUse o followed by a number to set the octave of subsequent notes. ※ default octave is 4cego5c
Octave shiftUse > to go up one octave, and < to go down one octave.c>c<c
TempoUse t followed by a number to set the tempo of subsequent notes. ※ default tempo is 120 beats per minutet200cegc
LengthUse l followed by a number to set the length of subsequent notes. ※ default length is 4 (quarter notes)l8cegc
Length overrideFollow the note name with a number to set the length of that specific note.ccggaag2ffeeddc2
Dotted notesFollow the note or rest with a . to make it 1.5 times longer.t136l8 b.b.b b.b.>e e.e.d d.d.<a
ChordsPut multiple notes in square brackets [] to play them simultaneously.l2 [dfa>ce] [<g>b>d+] [cega>d]
VelocityUse v followed by a number (0-100) to set the velocity (volume) of subsequent notes. ※ default velocity is 100v100 c v50 e v25 g v12 >c
RepeatUse /: and :/, optionally followed by number to repeat a section ※ default repeat is 2t80l16/:b->cdf<:/>/:cdeg:/

For full syntax description, see mml-iterator docs.

Extensions

  • Put --- (on its own line) to separate multiple MML sequences to be played simultaneously.
  • Use // to add comments.
// This is a comment
t160v50 l32/:er:/16 l16efed+era>cerar>c8r8
l16 dc<b>dc<ba>c<bag+baec<a>fedc<bag+ba
---
t160v32o2l8 /:a>[ce]32r16.< e>[ce]32r16.<:/4
>d[fb]32r16. c[e>c]32r16. <b>[dg+]32r16. <a>[ea]32r16.
l16<[e>e]r[f+>f+]r[g+>g+]r[e>e]r[a>a]

About this tool

Powered by mml-iterator and Tone.js.