- Music Macro Language
-
Not to be confused with the XML-based Music Markup Language, though Music Macro Language is sometimes erroneously called by this name.
Music Macro Language (MML) is a music description language used in sequencing music on a number of computer and video game system platforms.
MML is also sometimes known as Music Markup Language, by conflation with the XML musical notation markup language of that name. For instance, what the video game Mabinogi refers to as "Music Markup Language" is actually a typical implementation of Music Macro Language.
Contents
History
MML originally appeared in Microsoft BASIC and was common in the early 1970s and 1980s on 8-bit and 16-bit era Japanese personal computers.The NEC PC-6001 installed on the Microsoft BASIC and hardware included the Programmable Sound Generator, made to 1981. The MML was especially popular on NEC's personal computers, such as the NEC PC-8801.[1] With the 2001 release of the mck (Music Creation Kit) software for compiling MML to play music on the Nintendo Entertainment System[2], awareness and use of MML has seen some revitalization.[3] MML is presently popular among Japanese electronic musicians[1] and musicians who create chiptunes[4] as a way to write music for the Nintendo Entertainment System.
Syntax
MML originated as a sub-language of BASIC, then generally included in ROM on micro-computers. A
PLAY
statement uses an argument to define a string of tones that the sound-chip played. MML code has a simple text format whereby letters and numbers are used to describe the musical notes to be played.[1] In addition, various implementations of MML add system extensions allowing parameters of audio synthesis to be altered with specialized commands or to simplify the entry of common musical figures such as arpeggios.Though many platforms feature custom extensions to MML, and letter case requirements and other minor syntactical features vary slightly in some implementations, the fundamental set of syntax rules, commands, and features which defines MML and is present in whole or in part in all implementations is as follows:[1][5]
cdefgab
— The lettersa
tog
correspond to the musical 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 note.r
— A rest. The length of the rest is specified in the same manner as the length of a note — for example,r1
produces a whole 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 the volume of the instrument. The range of values allowed is dependent upon the specific sound hardware being used. Some implementations also allow an ADSR envelope to be applied to the amplitude of each note.t
— Followed by a number, sets the tempo in beats 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.
Languages, platforms and software
Among others, MML appears in the following programming languages, platforms, and software applications:
- Microsoft's QBASIC, BASICA, and GW-BASIC all feature a
PLAY
statement which takes a string argument in the MML format.[6][7][8] 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."[9] 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. - 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.[1][10] - The mck, pmck, and ppmck utilities for creating Nintendo Entertainment System music, and a number of other tools for creating music for other hardware, such as the Bandai WonderSwan, the TurboGrafx-16, and the Sega Genesis.[3]
- The xpmck utility for creating music for various systems, including the Sega Master System, Sega Game Gear, Sega Genesis, Nintendo Gameboy and Commodore 64.
- Some cellular phones utilize MML as a ringtone format.[11] The RTTTL ringtone 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.[12]
- On MSX computer system 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.
- OpenBSD and MirOS BSD offer /dev/speaker[13] in a GW-BASIC-compatible format
See also
References
- ^ a b c d e Selfridge-Field, Eleanor (1997). Beyond Midi: The Handbook of Musical Codes. Cambridge: MIT Press. ISBN 0262193949.
- ^ "VORC Internet Chiptune Encyclopedia - mck". Archived from the original on 2008-01-03. http://web.archive.org/web/20080103010234/http://www.vorc.org/en/info=mck. Retrieved 2008-02-13.
- ^ a b "VORC Internet Chiptune Encyclopedia - MML". Archived from the original on 2007-11-23. http://web.archive.org/web/20071123185143/http://www.vorc.org/en/info=MML. Retrieved 2008-02-13.
- ^ "VORC: VGM or Chiptune of The Year 2001". 2001-12-31. http://www.vorc.org/en/columns/hally/2001best10e.html.
- ^ Johnson, Jeremiah. "MCK/MML Beginners Guide". http://www.nullsleep.com/treasure/mck_guide/. Retrieved 2008-02-13.
- ^ QBasic manual. Microsoft Corporation. 1991
- ^ IBM Personal Computer BASIC manual. IBM Corporation. 1982
- ^ BASICA manual. Microsoft Corporation. 1982
- ^ GW-BASIC manual. Microsoft Corporation. 1987
- ^ Koshiro, Yūzō. Interview with Kikizo Games. http://games.kikizo.com/features/yuzo_koshiro_iv_oct05_p2.asp. Retrieved 2008-02-13.
- ^ "着信メロディは再び自分で作る時代に?──MIDIファイルやWAVファイルを着メロに変換". ITmedia, Inc.. 2001-04-03. http://plusd.itmedia.co.jp/mobile/0104/03/music.html. Retrieved 2008-02-13.
- ^ "ANSI Music - The Technical Details". http://artscene.textfiles.com/ansimusic/information/ansimtech.txt. Retrieved 2009-01-16.
- ^ speaker(4) manual page
External links
- Mabinogi Web Composer is an example of use of MML, from Nexon's MMORPG, Mabinogi.
- mck compiler utility, which turns MML into Nintendo Entertainment System assembly language which can then be assembled into an NES program
- (Japanese) ppmck, an advanced patched version of mck with added features
- xpmck compiler utility, which turns MML into assembly language which can then be assembled into programs for various video game consoles. It can also convert MML directly to VGM files with support for the SN79489 and YM2612.
- (Japanese) mml2mid, a utility for converting MML to MIDI sequences
- Ultimate PPMCK MML Reference
Categories:- Music notation file formats
- Video game music
- Video game music file formats
- Audio programming languages
- Free audio software
- Electronic music
Wikimedia Foundation. 2010.