Music Macro Language (MML) is a music description language used for sequencing music on computers and video game systems. Music is written as strings of letters and numbers representing notes, durations and control parameters, which are then interpreted or compiled for the target system's sound hardware. The designation is documented in print by May 1982, in a description of the OKI if-800. Microsoft source code from 1983 labels the BASIC PLAY implementation "MUSIC MACRO LANGUAGE", and NEC documentation from 1986 describes the channel strings of CMD PLAY as "MML (Music Macro Language)".
History
Origins of the term The designation Music Macro Language (MML) is documented in published sources by May 1982. In that month's issue of BYTE, an article on Japanese personal computers described the OKI if-800 using the term for its music-string syntax. The article states that "another sublanguage called MML (Music Macro Language) is used". Microsoft documentation for GW-BASIC later described the syntax used by the PLAY statement as "a music macro language" embedded in a string expression. The notation is treated as a non-MIDI music code in Beyond MIDI: The Handbook of Musical Codes. Music-string notation itself predates GW-BASIC. Contemporaneous BASIC documentation, such as the OKI BASIC manual, describes the PLAY statement for musical sequences but does not use the term "Music Macro Language".
Microsoft BASIC and NEC documentation Microsoft's 1983 GW-BASIC source code labels the PLAY implementation "PLAY - MUSIC MACRO LANGUAGE". The implementation supplies a table of music commands to a shared macro-language driver, which the source identifies as supporting the Microsoft graphics and sound macro languages. By 1986, NEC's PC-8801mkIIMR N88-BASIC / N88-日本語BASIC Reference Manual documented the extended CMD PLAY statement and called its channel strings "MML (Music Macro Language)". The manual gives command tables and explanations for notes, duration, octave, tempo, rests, volume, articulation, timbre selection and FM/SSG-related parameters. Neither the originator of the term nor any direct relationship between the OKI if-800 implementation and the Microsoft implementation is identified in these sources.
Dedicated music drivers and compilers During the 1980s MML was also used as input to dedicated music-development systems, and not only as an argument to a BASIC statement. Tanaka describes the PC-8801 sound system SPLIT in connection with MML-based music development and compilation, and states that general distribution of SPLIT began at the summer Comic Market on 14 August 1988 and that twelve releases followed through 1991. The same source discusses FMP and PMD within the history of MML-based Japanese personal computer music systems.
Background Early automatic music generation functions were used in arcade video games. Early examples of arcade video game music include Gun Fight (1975) and Circus (1977). The appearance of Space Invaders by Taito in Japanese amusement arcades in 1978 marked a considerable expansion of the domestic video game market. Music in these systems was generally implemented as proprietary game software. The Intel 8253 programmable interval timer, released by Intel in 1978, provided one hardware approach to programmable tone generation; its Mode 3 square-wave generator was used for music in the kit computer MZ-40K (Microcomputer Doctor (マイコン博士, Maikon Hakase)) by Sharp Corporation, manufactured in Japan in May 1978. Another microcomputer, the Hitachi BASIC MASTER MB-6880 (ベーシックマスター, Bēshikku Masutā), used a 5-bit digital-to-analog converter for automated music reference signals, together with methods of generating music under BASIC software control. That machine was assembled by Hitachi and made in Japan in September 1978. The MZ-40K documentation included program sources for some software routines.
Music-string notation and MML syntax
Sharp MZ BASIC music-string notation On the MZ-80K and related Sharp MZ systems, music-string facilities were provided through the SP-1002 monitor IOCS routine and the SP-5001 BASIC operating system, using the BASIC statements MUSIC, TEMPO and BEEP. The MZ-80K was an 8-bit machine with a Z80 processor, made by Sharp Corporation in Japan in 1978, and it used Intel 8253 hardware with memory-mapped I/O.
Syntax
The music string is supplied to the MUSIC statement. Notes are specified within a three-octave range, and a piece is a sequence of single monophonic tones. "+" (or, in some older code, " ̄") indicates the upper octave, and "−" (or, in some older code, "_") the lower octave. The characters C, D, E, F, G, A and B correspond to the degrees of the scale. A semitone is indicated by following the note with a "#" character. Note names are followed by a tone length, given as a number from 0 to 9; R indicates a rest and is likewise followed by a number from 0 to 9. The resulting duration is the internal value multiplied by the TEMPO value. Tone length 0 corresponds to a demisemiquaver (SP-1002 internal value 1) and 9 to a whole note (SP-1002 internal value 32). Music is played by a call to the routine at address $0030 of the SP-1002 IOCS.
The statement TEMPO n accepts values from 1 to 9, 1 being the slowest; TEMPO 4 corresponds approximately to T = 120.
Example The following is a transcription of the Japanese song "tōryanse" in the MUSIC-statement notation of the MZ-731 with SHARP S-BASIC 1Z-007B (upward compatible with SP-5001).
… excerpt ends here. Continue reading the full article.
