Music Macro Language
Music Macro Language (MML) is a
Background
Early automatic music generation functions were used in arcade games, which used many computer sounds. An example of an early popular Arcade game with music is The Circus from Exidy Corporation in 1977.
The boom in Japanese video games was heralded in 1978 by the appearance in Japanese game centers (Amusement arcades) of Space Invaders by Taito.[1]
The music was all proprietary (
The MZ-40K featured an
Versions
Classical MML
The first commands for classical MML appeared in the internal architecture of the SP-1002 MONITOR
Syntax
Classical MML as used in BASIC is described here. "MML Commands" are supplied to the MUSIC statement. Notes are specified in a three-octave range. A song is a sequence of mono single tones.
"+" (or in some old code, " ̄") indicates upper octave, "- " (or in some old code, "_") indicates the lower octave. The characters "CDEFGAB" correspond to a scale ("Doremi Faso Lassi"). A semitone is indicated by following the note with a '#' character. The note names are followed by a tone length, indicated by a number from 0–9. Similarly, R indicates a rest, and is also followed by a number from 0-9 indicating length. Sound length Internal value × TEMPO values.Tone length Demisemiquaver is 0 (SP-1002 Internal value is 1)- Whole note is 9 (SP-1002 Internal value is 32). Music played on Call to $0030 SP-1002
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 |
Statements TEMPO n is 1–9, the slowest 1.TEMPO 4 is similar T=120.
Example
Below is the popular Japanese song "tōryanse" written using MML in MZ-731 SHARP S-BASIC 1Z-007B (SP-5001 Upper compatible).[9]
10 TEMPO 4
20 A$="E5R1E3R0D3R0E3R0E1R0D1R0-G4R1"
30 B$="F3R0F1R0F1R0A3R0F1R0E1R0D1R0D1R0E5R0"
40 C$="C3R0C1R0C1R0E3R0C1R0-B1R0C1R0-B1R0-A1R0-A1-B5R0"
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
Modern MML originally appeared in
Syntax
Modern MML originated as a sub-language of
Though many platforms feature custom extensions and letter case requirements and other minor syntactical features vary slightly in some implementations, the fundamental syntax rules, commands and features that define MML and are present in whole or in part in all implementations are as follows:[10][14]
cdefgab
— The lettersa
tog
correspond to themusical pitches and cause the corresponding note to be played. Sharp notes are produced by appending a.+
or#
, and flat notes by appending a-
. The length of a note is specified by appending a number representing its length as a fraction of a whole note — for example,c8
represents a C eighth note, andf+2
an F♯ half notep
— Awhole rest.o
— Followed by a number,o
selects the octave the instrument will play in.>
,<
— Used to step up or down one octave.l
— Followed by a number, specifies the default length used by notes or rests which do not explicitly define one. For example,l8 g a b g l16 g a b g
produces a series of four eighth notes followed by a series of four sixteenth notes.v
— Followed by a number, sets theADSR envelopeto be applied to the amplitude of each note.t
— Followed by a number, sets thebeats per minute. On hardware with more than one sound channel, it is often possible to set each channel to a different tempo.
In addition to these, most implementations add their own keywords and symbols for system-specific enhancements or extensions.
Example
Below is a Modern MML transcription of Dance of the Cuckoos (with white-space for clarity, though some MML interpreters will require this to be stripped before playing).
t104 l4 > c16f16 a>c8<a c16f16 a>c8<a c8 b-8>c8<b-8 g c8 a8>c8<a8 f c16f16 a>c8<a c16f16 a>c8<a c8 b-8>c8<b-8 g >c8 <f2
SMX
Standard Musical eXpression (SMX) is a variant of Modern MML provided by Microsoft in
Languages, platforms and software
- PC Speaker
- string argument in the SMX format.[19][20][21] 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."[22]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.
- BSD operating systems.[18]
- The NEC PC-8801's BASIC dialect, N88-BASIC, used MML in its
PLAY
statement, as did several other implementations of BASIC produced or sold by NEC.[10][24]- Bare Knuckle Games."[25]
- Various MML utilities were written for the NEC PC-9801 family of computers, including PMD (Professional Music Driver)[12] by game composer Masahiro Kajihara (most commonly known as KAJA),[26] which was used by composer Ryu Umemoto for games like EVE Burst Error and Grounseed, as well as by game developer ZUN for most of his first five Touhou Projectgames.
- The mck, pmck, and ppmck utilities for creating Sega Mega Drive.[12]
- The xpmck utility for creating music for various systems, including the
- Some RTTTLringtone language exhibits many of the characteristics of MML.
- An escape sequence was defined to allow terminal programs play music encoded in MML. Because of this music in MML is sometimes called ANSI Music.[30]
- On the MSX computer system, the built-in MSX BASIC also uses MML with PLAY-command. Comma separated strings represent separate voice channels. Music hardware expansions such as MSX-Music, MSX-Audio and MSX-MIDI expand PLAY-command so that also FM-chips and external MIDI devices can be controlled through MML.
- Sharp Pocket computer music routine PLAYX - MyArchive.Nihongo -> ja:ポケットコンピュータの製品一覧.
- Macrotune is a free MML editor available for Windows and OS X while also offering Shared librariesfor software/game developers.
- FlopPI-Music (archived old documentation page) 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.
- Petit Computer and SmileBASIC both offer
BGMPLAY
functions, which can either take a preset MML track or one provided as a string. - An MMO called Mabinogi allows players to type MML code onto in-game music score scrolls which can then be played for everyone nearby to hear using an equipped instrument. Due to that social aspect, users often made their own MML versions of popular songs and uploaded them to fan sites. The game also teaches users the syntax via skill books, which doubled as a way to unlock a higher size limit when writing the code. ArcheAge MMO provides the same features.
- A , allowing the user to write, optimize, and test MML code for different instruments.
See also
References
- ^ Compiled by "Tomohiro Nishikado" (西角友宏/にしかどともひろ) worked in the Pacific Industrial Co., Ltd. All compiled alone.
- ^ PDF file;Micro Computer BASIC MASTER MB-6880 Music method[permanent dead link] - Kunihiko (圀彦), Nagai (長井); Teruhiro (輝洋), Takezawa (竹澤); Kazuma (一馬), Yoshimura (吉村); KaTsutoshi (活利), Tajima (田島) (26 April 1979). "Hitachi Hyoron April 1979 Special Features:A micro-computer, the application method". digital.hitachihyoron. HITACHI. Archived from the original on 8 May 2015. Retrieved 26 August 2013.
- ^ Remains Apple Open technology by Steve Wozniak in 1977 like Apple Red book Apple Computers.
- ^ "SHARP MZ.org MZ-80K monitor sub $0030". 2012-09-20. Archived from the original on 2015-09-26. Retrieved 2012-09-19.
- Z-80 ZilogLicensed Secondary source
- ^ Nobuaki Ohishi (2012-09-20). "Nibbles lab.SHARP Museum,MZ-80K Photo and Catalog".
- ^
SHARP Corporation; nagusa_kei (1978). MZ-80 BASIC SP-5030 マニュアル. SHARP Corporation. p. 110.-Document(validation) Upper Version SP-5030 "twitter oec_Nibbleslab". 2012-09-22.-
"twitter PlayTrueName". 2012-09-22. Retrieved 2012-09-22."twitter(twilog) PlayTrueName". 2012-09-22. Retrieved 2012-12-28. SHARP Corporation (1978). MZ-80 BASIC マニュアル. SHARP Corporation. p. 110. - ^ "SHARP MZ.org MZ-80K monitor sub $0030". 2012-09-20. Archived from the original on 2015-09-26. Retrieved 2012-09-19./"SHARP MZ.org MZ-700 monitor sub $0030". 2012-09-20. Archived from the original on 2015-05-09. Retrieved 2012-09-19.
- ^ Motoi, Kenkichi. "Viewpoint of the eye. She said "you playing" I'm crying/Awamomo Office". Archived from the original on 2013-02-18. Retrieved 2012-09-20.
Programmed and arranged by
Motoi, Kenkichi. "Twitter @PlayTrueName Σ:D『So long time wake up to the◎Programming to sound of music". Retrieved 2012-09-22.
Licensed #AAAP(Including Creative Commons CC-BY-SA and Text of GNU Free Documentation License.).
- ^ ISBN 0-262-19394-9.
- ^ a b "VORC Internet Chiptune Encyclopedia - mck". Archived from the original on 2008-01-03. Retrieved 2008-02-13.
- ^ a b c "VORC Internet Chiptune Encyclopedia - MML". Archived from the original on 2007-11-23. Retrieved 2008-02-13.
- ^ "VORC: VGM or Chiptune of The Year 2001". 2001-12-31.
- ^ Johnson, Jeremiah. "MCK/MML Beginners Guide". Archived from the original on 2007-12-14. Retrieved 2008-02-13.
- ^ "IBM BASIC manual, Second Edition (May 1982), Version 1.10" (PDF). Archived from the original (PDF) on 2015-06-15. Retrieved 2016-03-26.
- ^ MirBSD speaker device documentation
- ^ FreeBSD speaker(4) manual page
- ^ a b speaker(4) manual page
- ^ "QBasic manual". Microsoft Corporation. 1991.
{{cite journal}}
: Cite journal requires|journal=
(help) - ^ "IBM Personal Computer BASIC manual". IBM Corporation. 1982.
{{cite journal}}
: Cite journal requires|journal=
(help) - ^ "BASICA manual". Microsoft Corporation. 1982.
{{cite journal}}
: Cite journal requires|journal=
(help) - ^ "GW-BASIC manual". Microsoft Corporation. 1987.
{{cite journal}}
: Cite journal requires|journal=
(help) - ^ Raymond, Eric (7 May 1995). "Eric Raymond's Open-Source Works". Eric S. Raymond's Home Page. Retrieved 3 July 2020.
- ^ Koshiro, Yūzō. "Yuzo Koshiro Interview" (Interview). Interviewed by Kikizo Games. Retrieved 2008-02-13.
- ^ Szczepaniak, John. "Retro Japanese Computers: Gaming's Final Frontier". Hardcore Gaming 101. Retrieved 2011-03-29. Reprinted from Retro Gamer, 2009
- ^ "ツールのお部屋" (in Japanese). Retrieved 2019-12-01.
- ^ "VORC Internet Chiptune Encyclopedia - ppmck". Archived from the original on 2006-10-12.
- ^ Swimm, Peter (December 21, 2009). "XPMCK - Cross Platform Music Compiler Kit updated". True Chip Till Death. Retrieved December 29, 2011.
- ^ "着信メロディは再び自分で作る時代に?──MIDIファイルやWAVファイルを着メロに変換". ITmedia, Inc. 2001-04-03. Retrieved 2008-02-13.
- ^ "ANSI Music - The Technical Details". Retrieved 2009-01-16.