Music Macro Language
Encyclopedia
Music Macro Language is a music description language used in sequencing
Music sequencer
The music sequencer is a device or computer software to record, edit, play back the music, by handling note and performance information in several forms, typically :...

 music on a number of computer and video game system platforms.

MML is also sometimes known as Music Markup Language
Music Markup Language
Music Markup Language is an XML application to describe music objects and events, using different modules and markup. MML can be delivered in different formats, such as text, block bars or piano roll, Common Western Notation or MIDI-devices. Since MML can be employed in such simple and accessible...

, by conflation with the XML
XML
Extensible Markup Language is a set of rules for encoding documents in machine-readable form. It is defined in the XML 1.0 Specification produced by the W3C, and several other related specifications, all gratis open standards....

 musical notation
Musical notation
Music notation or musical notation is any system that represents aurally perceived music, through the use of written symbols.-History:...

 markup language
Markup language
A markup language is a modern system for annotating a text in a way that is syntactically distinguishable from that text. The idea and terminology evolved from the "marking up" of manuscripts, i.e. the revision instructions by editors, traditionally written with a blue pencil on authors' manuscripts...

 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.

History

MML originally appeared in Microsoft BASIC
Microsoft BASIC
Microsoft BASIC was the foundation product of the Microsoft company. It first appeared in 1975 as Altair BASIC, which was the first BASIC, and the first high level programming language available for the MITS Altair 8800 hobbyist microcomputer....

 and was common in the early 1970s and 1980s on 8-bit
8-bit
The first widely adopted 8-bit microprocessor was the Intel 8080, being used in many hobbyist computers of the late 1970s and early 1980s, often running the CP/M operating system. The Zilog Z80 and the Motorola 6800 were also used in similar computers...

 and 16-bit
16-bit
-16-bit architecture:The HP BPC, introduced in 1975, was the world's first 16-bit microprocessor. Prominent 16-bit processors include the PDP-11, Intel 8086, Intel 80286 and the WDC 65C816. The Intel 8088 was program-compatible with the Intel 8086, and was 16-bit in that its registers were 16...

 era Japan
Japan
Japan is an island nation in East Asia. Located in the Pacific Ocean, it lies to the east of the Sea of Japan, China, North Korea, South Korea and Russia, stretching from the Sea of Okhotsk in the north to the East China Sea and Taiwan in the south...

ese personal computer
Personal computer
A personal computer is any general-purpose computer whose size, capabilities, and original sales price make it useful for individuals, and which is intended to be operated directly by an end-user with no intervening computer operator...

s.The NEC PC-6001
NEC PC-6001
The NEC PC-6001 was the first of the NEC Corporation personal computer line. There were several versions of the PC-6001, including the PC-6001 MK2, the PC-6001 MK2 SR, and the PC-6801. There was also an American version, called the NEC TREK, or NEC PC-6001A...

 installed on the Microsoft BASIC and hardware included the Programmable Sound Generator
Programmable sound generator
A Programmable Sound Generator is a sound chip that generates sound waves by synthesizing multiple basic waveforms, and often some kind of noise generator, and combining and mixing these waveforms into a complex waveform, then shaping the amplitude of the resulting waveform using...

, made to 1981. The MML was especially popular on NEC
NEC
, a Japanese multinational IT company, has its headquarters in Minato, Tokyo, Japan. NEC, part of the Sumitomo Group, provides information technology and network solutions to business enterprises, communications services providers and government....

's personal computers, such as the NEC PC-8801
NEC PC-8801
The NEC PC-8801 was an early Zilog Z80-based computer exclusively released in Japan, where it became very popular, by NEC Corporation in 1981. It was informally called the "PC-88"....

. With the 2001 release of the mck (Music Creation Kit) software for compiling MML to play music on the Nintendo Entertainment System
Nintendo Entertainment System
The Nintendo Entertainment System is an 8-bit video game console that was released by Nintendo in North America during 1985, in Europe during 1986 and Australia in 1987...

, awareness and use of MML has seen some revitalization. MML is presently popular among Japan
Japan
Japan is an island nation in East Asia. Located in the Pacific Ocean, it lies to the east of the Sea of Japan, China, North Korea, South Korea and Russia, stretching from the Sea of Okhotsk in the north to the East China Sea and Taiwan in the south...

ese electronic musicians and musicians who create chiptune
Chiptune
A chiptune, also known as chip music, is synthesized electronic music often produced with the sound chips of vintage computers and video game consoles, as well as with other methods such as emulation. In the early 1980s, personal computers became cheaper and more accessible than they had previously...

s as a way to write music for the Nintendo Entertainment System
Nintendo Entertainment System
The Nintendo Entertainment System is an 8-bit video game console that was released by Nintendo in North America during 1985, in Europe during 1986 and Australia in 1987...

.

Syntax

MML originated as a sub-language of BASIC
BASIC
BASIC is a family of general-purpose, high-level programming languages whose design philosophy emphasizes ease of use - the name is an acronym from Beginner's All-purpose Symbolic Instruction Code....

, then generally included in ROM
Read-only memory
Read-only memory is a class of storage medium used in computers and other electronic devices. Data stored in ROM cannot be modified, or can be modified only slowly or with difficulty, so it is mainly used to distribute firmware .In its strictest sense, ROM refers only...

 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. 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 arpeggio
Arpeggio
An arpeggio is a musical technique where notes in a chord are played or sung in sequence, one after the other, rather than ringing out simultaneously...

s.

Though many platforms feature custom extensions to MML, and letter case
Letter case
In orthography and typography, letter case is the distinction between the larger majuscule and smaller minuscule letters...

 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:
  • cdefgab — The letters a to g correspond to the musical pitches and cause the corresponding note
    Note
    In music, the term note has two primary meanings:#A sign used in musical notation to represent the relative duration and pitch of a sound;#A pitched sound itself....

     to be played. Sharp
    Sharp (music)
    In music, sharp, dièse , or diesis means higher in pitch and the sharp symbol raises a note by a half tone. Intonation may be flat, sharp, or both, successively or simultaneously...

     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
    Whole note
    thumb|right|250px|Figure 1. A whole note and a whole rest.In music, a whole note or semibreve is a note represented by a hollow oval note head, like a half note , and no note stem . Its length is equal to four beats in 4/4 time...

     — for example, c8 represents a C
    C (musical note)
    C or Do is the first note of the fixed-Do solfège scale. Its enharmonic is B.-Middle C:Middle C is designated C4 in scientific pitch notation because of the note's position as the fourth C key on a standard 88-key piano keyboard...

     eighth note
    Eighth note
    thumb|180px|right|Figure 1. An eighth note with stem facing up, an eighth note with stem facing down, and an eighth rest.thumb|right|180px|Figure 2. Four eighth notes beamed together....

    , and f+2 an F♯ half note
    Half note
    In music, a half note or minim is a note played for half the duration of a whole note and twice the duration of a quarter note...

    .
  • r — A rest
    Rest (music)
    A rest is an interval of silence in a piece of music, marked by a sign indicating the length of the pause. Each rest symbol corresponds with a particular note value:The quarter rest may also be found as a form in older music....

    . 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
    Octave
    In music, an octave is the interval between one musical pitch and another with half or double its frequency. The octave relationship is a natural phenomenon that has been referred to as the "basic miracle of music", the use of which is "common in most musical systems"...

     the instrument will play in.
  • >, < — Used to step up or down one octave
    Octave
    In music, an octave is the interval between one musical pitch and another with half or double its frequency. The octave relationship is a natural phenomenon that has been referred to as the "basic miracle of music", the use of which is "common in most musical systems"...

    .
  • 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 note
    Eighth note
    thumb|180px|right|Figure 1. An eighth note with stem facing up, an eighth note with stem facing down, and an eighth rest.thumb|right|180px|Figure 2. Four eighth notes beamed together....

    s followed by a series of four sixteenth note
    Sixteenth note
    thumb|right|Figure 1. A sixteenth note with stem facing up, a sixteenth note with stem facing down, and a sixteenth rest.thumb|right|Figure 2. Four sixteenth notes beamed together....

    s.
  • v — Followed by a number, sets the volume
    Amplitude
    Amplitude is the magnitude of change in the oscillating variable with each oscillation within an oscillating system. For example, sound waves in air are oscillations in atmospheric pressure and their amplitudes are proportional to the change in pressure during one oscillation...

     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
    Tempo
    In musical terminology, tempo is the speed or pace of a given piece. Tempo is a crucial element of any musical composition, as it can affect the mood and difficulty of a piece.-Measuring 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, platform
Platform (computing)
A computing platform includes some sort of hardware architecture and a software framework , where the combination allows software, particularly application software, to run...

s, and software applications:
  • Microsoft
    Microsoft
    Microsoft Corporation is an American public multinational corporation headquartered in Redmond, Washington, USA that develops, manufactures, licenses, and supports a wide range of products and services predominantly related to computing through its various product divisions...

    's QBASIC
    QBasic
    QBasic is an IDE and interpreter for a variant of the BASIC programming language which is based on QuickBASIC. Code entered into the IDE is compiled to an intermediate form, and this intermediate form is immediately interpreted on demand within the IDE. It can run under nearly all versions of DOS...

    , BASICA, and GW-BASIC
    GW-BASIC
    GW-BASIC was a dialect of the programming language BASIC developed by Microsoft from BASICA, originally for Compaq. It is compatible with Microsoft/IBM BASICA, but was disk based and did not need the ROM BASIC. It was bundled with MS-DOS operating systems on IBM PC compatibles by Microsoft...

     all feature a PLAY statement which takes a string argument in the MML format. 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." 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
    NEC PC-8801
    The NEC PC-8801 was an early Zilog Z80-based computer exclusively released in Japan, where it became very popular, by NEC Corporation in 1981. It was informally called the "PC-88"....

    's BASIC dialect, N88-BASIC, used MML in its PLAY statement, as did several other implementations of BASIC produced or sold by NEC
    NEC
    , a Japanese multinational IT company, has its headquarters in Minato, Tokyo, Japan. NEC, part of the Sumitomo Group, provides information technology and network solutions to business enterprises, communications services providers and government....

    .
  • The mck, pmck, and ppmck utilities for creating Nintendo Entertainment System
    Nintendo Entertainment System
    The Nintendo Entertainment System is an 8-bit video game console that was released by Nintendo in North America during 1985, in Europe during 1986 and Australia in 1987...

     music, and a number of other tools for creating music for other hardware, such as the Bandai WonderSwan, the TurboGrafx-16
    TurboGrafx-16
    TurboGrafx-16, fully titled as TurboGrafx-16 Entertainment SuperSystem and known in Japan as the , is a video game console developed by Hudson Soft and NEC, released in Japan on October 30, 1987, and in North America on August 29, 1989....

    , and the Sega Genesis.
  • The xpmck utility for creating music for various systems, including the Sega Master System
    Sega Master System
    The is a third-generation video game console that was manufactured and released by Sega in 1985 in Japan , 1986 in North America and 1987 in Europe....

    , Sega Game Gear
    Sega Game Gear
    The was Sega's first handheld game console. It was the third commercially available color handheld console, after the Atari Lynx and the TurboExpress....

    , Sega Genesis, Nintendo Gameboy and Commodore 64
    Commodore 64
    The Commodore 64 is an 8-bit home computer introduced by Commodore International in January 1982.Volume production started in the spring of 1982, with machines being released on to the market in August at a price of US$595...

    .
  • Some cellular phones utilize MML as a ringtone format. The RTTTL
    Ring Tone Transfer Language
    Ring Tone Text Transfer Language was developed by Nokia to be used to transfer ringtones to cellphone by Nokia.The RTTTL format is a string divided into three sections: name, default value, and data....

     ringtone language exhibits many of the characteristics of MML.
  • An escape sequence
    Escape sequence
    An escape sequence is a series of characters used to change the state of computers and their attached peripheral devices. These are also known as control sequences, reflecting their use in device control. Some control sequences are special characters that always have the same meaning...

     was defined to allow terminal programs play music encoded in MML. Because of this music in MML is sometimes called ANSI Music.
  • On MSX
    MSX
    MSX was the name of a standardized home computer architecture in the 1980s conceived by Kazuhiko Nishi, then Vice-president at Microsoft Japan and Director at ASCII Corporation...

     computer system built in MSX BASIC
    MSX BASIC
    MSX BASIC is a dialect of the BASIC programming language. It is an extended version of Microsoft Standard BASIC Version 4.5, and includes support for graphic, music, and various peripherals attached to MSX Personal Computers. Generally, MSX-BASIC is designed to follow GW-BASIC, which is one of the...

     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
    OpenBSD
    OpenBSD is a Unix-like computer operating system descended from Berkeley Software Distribution , a Unix derivative developed at the University of California, Berkeley. It was forked from NetBSD by project leader Theo de Raadt in late 1995...

     and MirOS BSD
    MirOS BSD
    MirOS BSD is a free and open source operating system, which started as a fork of OpenBSD 3.1 in August 2002. It is intended to maintain the security of OpenBSD - from which it frequently synchronises code updates - with better support for European localisation...

     offer /dev/speaker in a GW-BASIC
    GW-BASIC
    GW-BASIC was a dialect of the programming language BASIC developed by Microsoft from BASICA, originally for Compaq. It is compatible with Microsoft/IBM BASICA, but was disk based and did not need the ROM BASIC. It was bundled with MS-DOS operating systems on IBM PC compatibles by Microsoft...

    -compatible format

External links

  • Mabinogi Web Composer is an example of use of MML, from Nexon's MMORPG
    MMORPG
    Massively multiplayer online role-playing game is a genre of role-playing video games in which a very large number of players interact with one another within a virtual game world....

    , Mabinogi.
  • mck compiler utility, which turns MML into Nintendo Entertainment System
    Nintendo Entertainment System
    The Nintendo Entertainment System is an 8-bit video game console that was released by Nintendo in North America during 1985, in Europe during 1986 and Australia in 1987...

     assembly language
    Assembly language
    An assembly language is a low-level programming language for computers, microprocessors, microcontrollers, and other programmable devices. It implements a symbolic representation of the machine codes and other constants needed to program a given CPU architecture...

     which can then be assembled into an NES program ppmck, an advanced patched version of mck with added features
  • xpmck compiler utility, which turns MML into assembly language
    Assembly language
    An assembly language is a low-level programming language for computers, microprocessors, microcontrollers, and other programmable devices. It implements a symbolic representation of the machine codes and other constants needed to program a given CPU architecture...

     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. mml2mid, a utility for converting MML to MIDI sequences
  • Ultimate PPMCK MML Reference
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK