Music Macro Language

From Wikipedia, the free encyclopedia
Jump to: navigation, search







The boom in Japanese video games was heralded in 1978 by the appearance in Japanese game centers (Amusement arcades) of Space Invaders by TAITO Corporation.[1] The Yellow Magic Orchestra used more sampling music motif in their games. Their sound has been reproduced on Moog synthesizers. Others were mostly played by acoustic instruments. The Circus and Space Invaders's music is both hard circuit music and sounds.





Classical MML[edit]






The sound length
Value Length
0 1/32
1 1/16
2 dotted 1/16
3 1/8
4 dotted 1/8
5 1/4
6 dotted 1/4
7 1/2
8 dotted 1/2
9 1




 10 TEMPO 4
 20 A$="E5R1E3R0D3R0E3R0E1R0D1R0-G4R1"
 30 B$="F3R0F1R0F1R0A3R0F1R0E1R0D1R0D1R0E5R0"
 50 D$="E1R0E1R0E1R0E1R0E1R0E1R0D1R0E1R0E1R0E1R0D1R0-A1R0-A1R0B3R1"
 60 E$="-A1R0-B1R0C1R0D1R0E1R0F1R0E1R0F3R1A3R1B1R0A1R0F3R0E3R0E1R0E4R0"
 100 MUSIC A$+B$+B$
 110 MUSIC C$+C$+B$
 120 MUSIC C$+D$+E$

Modern MML[edit]





  • p — A pause or rest. Sometimes also r, although the original IBM and Microsoft BASIC used p,[15] as do all clones (e.g. the Linux and BSD speaker devices).[16] The length of the rest is specified in the same manner as the length of a note — for example, r1 produces a whole rest.


Example 1[edit]

This example can be played using mml2mp3, a Web-based MML to MIDI / MP3 conversion system.[17]

#timebase 480
#title "The M.GAKKOU KOUKA"
A t160
A o3l4 V12
A @1 ed8ce8 gg8er8 aa8>c<a8 g2r
A aa8ga8 >cc8d<r8 ee8de8 c2r
A dd8dd8 dd8dr8 ed8ef8 g2r
A aa8ga8 >cc8<ar8 >dc8de8 d2<r
A >ee8dc8< ab8>cc8< gg8ea8 g2r
A >cc8<ge8 cd8ea8 gg8de8 c2r

Example 2[edit]

This was originally compiled on a Sharp PC-E500S Pocket computer using Ryu. T. Kobayashi's PLAY3.[18] After the NEC PC-9801 freeware games BGM Arranged,Appear the MML2MID MIDI version to[19]

#timebase 48

$g k100
$h k100

T C12 BT4,4 t150

G C1
H C2
I C3

GHI  r8 H0,0@45  r8   o3 l8   ; Melody 1
G p64 v110
H p80 v60
I p32 v60

H <
I >

G [rrrr rrrr rrrr rrrr
HI [cgcg cgcg cgcg cgcg

G rrrr rrrr rrrr rrrr
HI cgcg cgcg cgcg >c<ceg


G >e<rrr rrrr rrrr rrrr >e<rrr


G rrrr rrrr rrrr brrr

G rrbg+ rarb r>crd erfr
G erd+
HI e<e>d+

GHI k32,2[d32]24
G $g
HI $h

G <ab>c c+<rrr

G rb>cc+ d<rrr r>def g
GHI H0,0 @44
H <
I >
GHI <<gb>c
GHI gfed fedc edc<b
GHI l16abababab abababab gagagaga gagagaga
GHI g2
GHI r8
H >
I <
GHI @45
GHI l8>gab]2
GHI k110,-5,0

G rrrr rrrr rrrr rrrr
HI cgcg cgcg cgcg cgcg

G rrrr rrrr rrrr rrrr
HI cgcg cgcg cgcg >c<ceg

Example 3[edit]

Now an example for “Modern MML”: “Alle meine Entchen”, a popular German beginner/children's tune.

o2l4t120 cdefg2g2 aaaag2 aaaag2 ffffe2e2 ddddc1

Example 4[edit]

This example (under The MirOS Licence) can be played, and converted to MusicXML, by MMLlib. Individual tracks can also be output to /dev/speaker on BSD. The extended file format is, besides comment lines: one track per line; an empty line is like a line wrap in a score, any subsequent lines are appended to the previous tracks. Bars are used for synchronisation (not strictly necessary in MML but for Floppi-Music) and for MusicXML export.

# Title: Loreley
# Composer: Ph. Friedrich Silcher (1789–1860), 1837
# Lyrics: Heinrich Heine (1797–1856), 1824
# Arranger: Klavier: August Linder; MML: mirabilos
# Encoder: mirabilos, 2016
# Copyright: MML encoding & arrangement © 2016 mirabilos, published under The MirOS Licence; copyright for text, music, and piano arrangement has expired
# Source: Linder, August (Hrsg.): Deutsche Weisen : Die beliebtesten Volks- und geistlichen Lieder. Stuttgart: Albert Auer’s Musikverlag, n.d., c. 1900.
# Instruments: Piano, Voice
# MML Tracks: 4 (5)
# Verses: 3
# Language: German
# Tempo: Andante
# Time Signature: 6/8
# Key Signature: C Major
# Pickup Measure: 1/8
# Measures: 16

## Structure:
# Track 1: voice track
# Text embedded here, as comments (not exported) – roughly note-aligned
# Track 2: usually lowest voice double, except in bar 12
# Track 3: occasional helper
# Track 4: bass background

o2t76l8 g | mlg.   mna16 g ml>c<  mnb   a |   g4.            f4         f |
# 1.  Ich   weiß  nicht, was soll  es  be-    deu-           ten,     daß
# 2.  Die   schön-______ ste Jung-___frau     si-            tzet    dort
# 3.  Den   Schif-______ fer im  klei-nen     Schif-         fe       er-
o2t76l8 p | mle.   mnf16 e mlf    mnf   f |   e4.            d4         d |
o1t76l8 p | p2.                           | p2.                           |
o1t76l8 p | mlc16g16>c<mng mlc16a16>d<mnb | mlc16g16>c<mng ml<f16>f16amnf |

   e.    e16 e mldmnc d  | mle4. mnep g | mlg.   mna16 g ml>c<  mnb   a |
#  ich______ so trau-_rig  bin?_____  Ein Mähr-  chen  aus  al-____ ten
#  o-_______ ben wun-_der- bar,_____  ihr gold’- nes   Ge-  schmei-_ de
#  greift es mit wil-_dem  Weh,_____  er  schaut nicht die  Fel-___ sen-
   c.    c16 c<mlbmna b> | mlc4. mncp p | mle.   mnf16 e mlf    mnf   f |
p4.              g4   g  | mlg ppmnp4 p | p2.                           |
ml<g16>e16gmne  <g4   g> | mlc<gemnc4>p | mlc16g16>c<mng mlc16a16>d<mnb |

  g4.            f4         f | e.   e16 e   g     f   d  | mlc4. mncp e |
# Zei-           ten,     das kommt_____ mir nicht aus dem Sinn._____  Die
# bli-           tzet,    sie kämmt_____ ihr gol-  de- nes Haar._____  Sie
# rif-           fe,       er schaut nur hin-auf   in  die Höh’._____  Ich
  e4.            d4         d | c.   c16 c  <b     b   b  | p2.          |
p2.                           | p   p    p   d     d   f  | mle ppmnp4 p |
mlc16g16>c<mng ml<f16>f16amnf |<g>  g    c  <g     g   g> | mlc<egmnc4 p |

mld.  mne16  d   g    d   d  |   b4.      a4   a |    g4   g mlf#mng   a   |
# Luft_____  ist kühl und es     dun-   kelt und      ru-hig fließt___ der
# kämmt es   mit gol- de- nem    Kam-     me und   singt ein Lied_____ da-
# glau- be,  die Wel- len ver-   schlin- gen  am      En- de Schif-fer und
mlb.> mnc16< b   b    b   b  |  >d4.      c4   c |   <b4   p mlamn b>  c<< |
  p   p      p  >d    p   p  |   g4.      e4   e |    d4   d<d4        d   |
mlg>  d    mng<mlg>   d mng< | mlg>dmng<mlc>emna | ml<d>dmnb p4        f#  |

# The next measure missed an o1g as last eighth, to fit on four tracks
# (but it’s doubled by the o2g in the vocals, so it’s okay musically)
mlg4.mng4  g  |   g.     a16 g>mlc<mn   b   a |
# Rhein;__ der    Gi-   pfel des Ber-____ ges
# bei;____ das    hat     ei-ne wun-_____ der-
# Kahn,___ und    das    hat mit ih-_____ rem
mlgb>cdc<mnb  | >>e.     f16 e mlfmn    f   f |
mld4.mnd4> f< | p2.                           |
mlb>defe mnd< | mlc16g16>c<mng mlc16a16>d<mnb | l16

mlg4mn>   e     d4       d  |    c.     c16c ml<b mna b | ml>c4.mncp ||
# fun-______    kelt     im      A-_______ bend-son-_ nen-schein.__
# sa-_______    me,      ge-     wal-   ti-ge   Me-__ lo- dei._____
# Sin-______    gen     die      Lo-______ re-_ ley__ ge- than.____
mle4mn    g     f4       f  |    e.     e16e ml f mnf f | ml e4.mnep ||
p2.                         |    p     p   p    g   g g | ml gppmnpp ||
mlcg>mnc<pp8 ml<f>a>mnd<pp8 | ml<g>g>mncpl8p    d   c d | ml<cegmncp ||

Standard Musical Expression (SMX)[edit]

SMX is similar to modern MML. In SMX, note length is specified via an L command (e.g. L4) rather[clarification needed] than by writing a number after the note.[20] This code was used by QBasic's PLAY command.[21]

Languages, platforms and software[edit]

  • Microsoft's QBASIC, BASICA, and GW-BASIC all feature a PLAY statement which takes a string argument in the SMX format.[22][23][24] The name "Music Macro Language" may originate with GW-BASIC, which provided a facility "to play music by embedding a music macro language into the string data type."[25] The SBasic compiler from the German magazine DOS Extra, produced by DMV Widuch, offers the same PLAY command, and a few-line BASIC programme could be compiled into a small (few KiB) tool to play any MML files (often called *.PLY) given on the command line.
  • Some cellular phones utilize MML as a ringtone format.[29] The RTTTL ringtone language exhibits many of the characteristics of MML.
  • OpenBSD and MirOS BSD offer /dev/speaker[31] in a GW-BASIC-compatible format
  • Macrotune is a free MML editor available for Windows and OS X while also offering Shared libraries for software/game developers.
  • Floppi-Music uses an extended format with a file header with metadata (such as Author, Title, etc.), a newline, and then one line for each staff, supporting multiple instruments, with bar lines. It’s designed to output to up to eight 3½″ floppy disc drives on Raspberry Pi GPIO ports. It also contains a standalone MML parser and MusicXML exporter library and utility, tested with MuseScore, allowing easy debugging of especially mass-parallel MML files, score sheet printing (ideally after some minimal postprocessing, but the defaults are usually legible), etc. – Floppi-Music and MMLlib is Free Software written in pure Python.

See also[edit]


  5. ^ CPU is Z-80 Zilog Licensed Secondary source
  6. ^ Nobuaki Ohishi (2012-09-20). "Nibbles lab.SHARP Museum,MZ-80K Photo and Catalog.". 
  15. ^ IBM BASIC manual, Second Edition (May 1982), Version 1.10
  16. ^ MirBSD speaker device documentation
  21. ^ see
  22. ^ "QBasic manual". Microsoft Corporation. 1991. 
  23. ^ "IBM Personal Computer BASIC manual". IBM Corporation. 1982. 
  24. ^ "BASICA manual". Microsoft Corporation. 1982. 
  25. ^ "GW-BASIC manual". Microsoft Corporation. 1987. 
  26. ^ Koshiro, Yūzō. (Interview). Interview with Kikizo Games Retrieved 2008-02-13.  Missing or empty |title= (help)
  31. ^ speaker(4) manual page

External links[edit]