MML Player
MML syntax
MML (Music Macro Language) is a compact text format for describing melodies.
| Topic | Tutorial | Examples |
|---|---|---|
| Notes | Use a to g for notes A to G. | cegc |
| Rest | Use r for rest. | ccggaagrffeeddc |
| Whitespace | Use whitespaces to make the MML more readable. | c e g c |
| Accidentals | Use + for sharps, and - for flats. | df+ade-gb-e- |
| Octave | Use o followed by a number to set the octave of subsequent notes. ※ default octave is 4 | cego5c |
| Octave shift | Use > to go up one octave, and < to go down one octave. | c>c<c |
| Tempo | Use t followed by a number to set the tempo of subsequent notes. ※ default tempo is 120 beats per minute | t200cegc |
| Length | Use l followed by a number to set the length of subsequent notes. ※ default length is 4 (quarter notes) | l8cegc |
| Length override | Follow the note name with a number to set the length of that specific note. | ccggaag2ffeeddc2 |
| Dotted notes | Follow 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 |
| Chords | Put multiple notes in square brackets [] to play them simultaneously. | l2 [dfa>ce] [<g>b>d+] [cega>d] |
| Velocity | Use v followed by a number (0-100) to set the velocity (volume) of subsequent notes. ※ default velocity is 100 | v100 c v50 e v25 g v12 >c |
| Repeat | Use /: and :/, optionally followed by number to repeat a section ※ default repeat is 2 | t80l16/: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.