MML Implementation Chart

Control Commands Arguments Examples
Note C, D, E, F, G, A, B 1, 2, 23(1/2 Note Triplet), 4, 43(1/4 Note Triplet), 8, 83(1/8 Note Triplet),
16, 163(1/16 Note Triplet), 32, 323(1/32 Note Triplet), 64, 643(1/64 Note Triplet), .(Dotted Note)
+ (for sharp note), - (for flat note)
C8 D8 E-16 E16 F8. F+8.
Rest R 1, 2, 23(1/2 Note Triplet), 4, 43(1/4 Note Triplet), 8, 83(1/8 Note Triplet),
16, 163(1/16 Note Triplet), 32, 323(1/32 Note Triplet), 64, 643(1/64 Note Triplet), .(Dotted Note)
R2
Default Length L 1, 2, 23(1/2 Note Triplet), 4, 43(1/4 Note Triplet), 8, 83(1/8 Note Triplet),
16, 163(1/16 Note Triplet), 32, 323(1/32 Note Triplet), 64, 643(1/64 Note Triplet), .(Dotted Note)
L8
Octave O 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 O4
Octave Shift <, > CDEFGAB>C
Repeat Sign [, ] [[CDE]GFEDC]
Volume V Volume Value V32
Tempo T Tempo Value T120
User Event @{Event Name} Event Name @{MYEVT1} @{MYEVT2}

MML Examples

Example No.1 (Notes)

C8 D8 E8 F8 G8 A8 B8 > C8
L8 C D E F G A B > C

Example No.2 (Dotted Note)

C4. E4. G4

Example No.3 (Rest)

R4 C4 R4 > C4
L4 R C R > C

Example No.4 (Triplet Notes)

This triplet notes feature is the original MML specification for supporting triplet notes.

1/8 Note Triplet

C83 G83 > C83

1/4 Note Triplet

C43 G43 > C43

1/2 Note Triplet

C23 G23 > C23

Songs

The Sample Song - Bach invention no.13

"T90L16REA>C<BEB>DC8E8<G+8>E8<AEA>C<BEB>DC8<A8R4R>ECE<A>C<EGF8A8>D8F8.D<B>D<GBDFE8G8>C8E8.C<A>C<F8>D8.<BGBE8>C8.<AFAD8B8>C4R4<RG>CED<G>DFE8G8<B8>G8C<G>CED<G>DFE8C8G8E8>C<AEACE<A>CD8F+8A8>C8<BGDG<B>D<GB>C8E8G8B8AF+D+F+<B>D<F+AG8>G8.ECE<A8>F+8.D<B>D<G8>E8.C<A>C<F+>GF+ED+F+<B>D+E4R4<<E2L16O2A8>A4G+8AEA>C<BEB>DC8<A8G+8E8AEA>C<BEB>DC8<A8>C8<A8>D<AFADF<A>C<B8>D8G8B8.GEGCE<GBA8>C8DF<B>D<G8B8>CE<A>C<F8D8G>GFGCG>CED<G>DFE8C8<B8G8>C<G>GED<G>DFE8C8R4RGEGCE<GBA8>C8E8G8F+ADF+<A>D<F+AG8B8>D8F+8EGCE<G>C<EGF+8A8B8>D+8RECE<A>CEGF+D<B>D<GB>DF+EC<A>C<F+A>C8.<B>C<AB8<B8>E>E<BGE<BGBE2"

The Sample Song - Super Mario Bros. Theme Song

  "T180"

  /* This L0 is a trick for playing chords. */
  "L0"

  /* Intro */
  "O3D>F+>E8 O3D>F+>E8 R8 O3D>F+>E8 R8 O3D>F+>C8 O3D>F+>E4"
  "O3G>GB>G4 R4 O2G>>G4 R4"

  "["
    /* A */
    "O3G>E>C4 R8 O3E>CG4 R8 O3G>E4"
    "R8 O3F>CA4 O3G>DB4 O3G->D-B-8 O3F>CA4"
    "O3E>CG43 O3>CG>E43 O3>EG>G43 O3>F>CA4 O3>DA>F8 O3>EB>G8"
    "R8 O3>CA>E4 O3A>E>C8 O3B>F>D8 O3G>DB4 R8"
  "]"

  "["
    /* B */
    "O3C4 O3>>EG8 O3G>>D+F+8 O3>>DF8 O3>B>D+8 O3>C8 O3>>CE8"
    "O3F8 O3>EG+8 O3>FA8 O3>CG>C8 O3>C8 O3>CA8 O3F>E>C8 O3>F>D8"
    "O3C4 O3>>EG8 O3E>>E-G-8 O3>>DF8 O3>B>D+8 O3G8 O3>C>CE8"
    "R8 O3>>FG>C8 R8 O3>>FG>C8 O3>>FG>C8 R8 O3G4"
    "O3C4 O3>>EG8 O3G>>D+F+8 O3>>DF8 O3>B>D+8 O3>C8 O3>>CE8"
    "O3F8 O3>EG+8 O3>FA8 O3>CG>C8 O3>C8 O3>CA8 O3F>E>C8 O3>F>D8"
    "O3C4 O3A->A->E-8 R8 R8 O3B->F>D8 R8 R8"
    "O3>CE>C8 R8 R8 O3G8 O3G4 O3C8 R8"
  "]"

  /* C */
  "O2A->>A->C8 O3>A->C8 R8 O3E->A->C8 R8 O3>A->C8 O3A->B->D4"
  "O3G>G>E8 O3>E>C8 R8 O3C>EA8 O3>CG4 O2G4"
  "O2A->>A->C8 O3>A->C8 R8 O3E->A->C8 R8 O3>A->C8 O3A->B->D8 O3>G>E8"
  "O3G4 R8 O3C8 R4 O2G4"
  "O2A->>A->C8 O3>A->C8 R8 O3E->A->C8 R8 O3>A->C8 O3A->B->D4"
  "O3G>G>E8 O3>E>C8 R8 O3C>EA8 O3>CG4 O2G4"
  "O3D>F+>E8 O3D>F+>E8  R8 O3D>F+>E8 R8 O3D>F+>C8 O3D>F+>E4"
  "O3G>GB>G4 R4 O2G>G4 R4"

  "["
    /* A */
    "O3G>E>C4 R8 O3E>CG4 R8 O3G>E4"
    "R8 O3F>CA4 O3G>DB4 O3G->D-B-8 O3F>CA4"
    "O3E>CG43 O3>CG>E43 O3>EG>G43 O3>F>CA4 O3>DA>F8 O3>EB>G8"
    "R8 O3>CA>E4 O3A>E>C8 O3B>F>D8 O3G>DB4 R8"
  "]"

  "["
    /* D */
    "O3C>>CE8 O3>A>C4 O3F+>EG8 O3G4 O3>CEG+4"
    "O3F>FA8 O3>>CF8 O3F8 O3>>CF8 O3>CFA8 O3>C8 O3F4"
    "O3D>GB43 O3>>FA43 O3F>>FA43 O3G>>FA43 O3>>EG43 O3B>>DF43"
    "O3G>>CE8 O3>A>C8 O3G8 O3>FA8 O3>CEG8 O3>C8 O3G4"
    "O3C>>CE8 O3>A>C4 O3F+>EG8 O3G4 O3>CEG+4"
    "O3F>FA8 O3>>CF8 O3F8 O3>>CF8 O3>CFA8 O3>C8 O3F4"
    "O3G>GB8 O3G>>DF8 R8 O3G>>DF8 O3G>>DF43 O3A>>CE43 O3B>B>D43"
    "O3>CG>C8 O3>CE>C8 O3G>E>C8 O3G>E>C8 O3C>C4 R4"
  "]"

  /* C' */
  "O2A->>A->C8 O3>A->C8 R8 O3E->A->C8 R8 O3>A->C8 O3A->B->D4"
  "O3G>G>E8 O3>E>C8 R8 O3C>EA8 O3>CG4 O2G4"
  "O2A->>A->C8 O3>A->C8 R8 O3E->A->C8 R8 O3>A->C8 O3A->B->D8 O3>G>E8"
  "O3G4 O3>>E8 O3C>>G8 O3>>>E8 O3>>>C8 O2G>>>D8 O3>>>G8"
  "O2A->>A->C8 O3>A->C8 R8 O3E->A->C8 R8 O3>A->C8 O3A->B->D4"
  "O3G>G>E8 O3>E>C8 R8 O3C>EA8 O3>CG4 O2G4"
  "O3D>F+>E8 O3D>F+>E8  R8 O3D>F+>E8 R8 O3D>F+>C8 O3D>F+>E4"
  "O3G>GB>G4 R4 O2G>G4 R4"

  "["
    /* D */
    "O3C>>CE8 O3>A>C4 O3F+>EG8 O3G4 O3>CEG+4"
    "O3F>FA8 O3>>CF8 O3F8 O3>>CF8 O3>CFA8 O3>C8 O3F4"
    "O3D>GB43 O3>>FA43 O3F>>FA43 O3G>>FA43 O3>>EG43 O3B>>DF43"
    "O3G>>CE8 O3>A>C8 O3G8 O3>FA8 O3>CEG8 O3>C8 O3G4"
    "O3C>>CE8 O3>A>C4 O3F+>EG8 O3G4 O3>CEG+4"
    "O3F>FA8 O3>>CF8 O3F8 O3>>CF8 O3>CFA8 O3>C8 O3F4"
    "O3G>GB8 O3G>>DF8 R8 O3G>>DF8 O3G>>DF43 O3A>>CE43 O3B>B>D43"
    "O3>CG>C8 O3>CE>C8 O3G>E>C8 O3G>E>C8 O3C>C4 R4"
  "]"

  /* E */
  "O3G>E>C4 R8 O3E>CG4 R8 O3CG>E4"
  "T170 O2F>C>FA43 O2F>C>FB43 O2F>C>FA43 T160 O2D-A->>FA-43 O2D-A->>FB-43 O2D-A->>FA-43"
  "T150 O2CG>>EG8 O2CG>>DG8 O2CG>>EG2."

  "R1"