Music Macro Language

Last updated

Music Macro Language (MML) is a music description language used in sequencing music on computer and video game systems.

Contents

Background

Early automatic music generation functions were used in arcade video 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 (closed source). The 1978 release of the Programmable interval timer by Intel was significant. The Intel 8253 Mode 3 Square Wave generator was used for music, in the Kit computer MZ-40K (Microcomputer Doctor (マイコン博士/まいこんはかせ, Maikon Hakase)) by SHARP Corporation, made in Japan at May 1978. Another Micro computer BASIC MASTER MB-6880(ja) BASIC Master (ベーシックマスター, BASIC Master) used a 5Bit D/A converter music automated reference signal. Also important was the development of a method to generate using BASIC software. [2] The machine was assembled by Hitachi and made in Japan in September 1978. The MZ-40K used an open architecture and program sources, was therefore a kind of open source software.

Versions

Classical MML

The first commands for classical MML appeared in the internal architecture of the SP-1002 MONITOR IOCS [3] and SP-5001 BASIC Operating Systems on the MZ-80K 8-bit [4] computer. Made by SHARP Corporation at 1978 in Japan. [5] It incorporated Intel 8253 hardware and memory mapped I/O. The sound-related BASIC Statements were MUSIC, TEMPO, and BEEP. [6]

Syntax

An open-sourced scan of page 110 of Sharp Corporation's 1987 MZ-80 BASIC Manual, describing the origins of the MML syntax. The Graffitied SharpCorporation MZ-80 BASIC Manuals Document copy.jpg
An open-sourced scan of page 110 of Sharp Corporation's 1987 MZ-80 BASIC Manual, describing the origins of the MML 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 IOCS program routine. [7]

The sound length
ValueLength
01/32
11/16
2dotted 1/16
31/8
4dotted 1/8
51/4
6dotted 1/4
71/2
8dotted 1/2
91

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). [8]

10TEMPO420A$="E5R1E3R0D3R0E3R0E1R0D1R0-B4R1"30B$="F3R0F1R0F1R0A3R0F1R0E1R0F1R0E1R0D1R0D1R0E4R1"40C$="C3R0C1R0C1R0E3R0C1R0-B1R0C1R0-B1R0-A1R0-A1R0-B4R1"50D$="E1R0E1R0E1R0E1R0E1R0E1R0D1R0E1R0E1R0E1R0D1R0-A1R0-A1R0-B4R1"60E$="-A1R0-B1R0C1R0D1R0E1R0F1R0E1R0F3R1A3R1B1R0A1R0F3R0E3R0E1R0D1R0E4R1"100MUSICA$+B$+B$110MUSICC$+C$+B$120MUSICC$+D$+E$

Modern MML

Modern 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 included Microsoft BASIC and the Programmable Sound Generator in 1981. The MML was especially popular on NEC's personal computers, such as the NEC PC-8801. [9] With the 2001 release of the mck (Music Creation Kit) software for compiling MML to play music on the Nintendo Entertainment System, [10] awareness and use of MML increased. [11] MML is presently popular among Japanese electronic musicians [9] and musicians who create chiptunes [12] as a way to write music for the Nintendo Entertainment System.

Syntax

Modern 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. [9] 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 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: [9] [13]

  • cdefgab — The letters a to g 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, and f+2 an F♯ half note.
  • p — A pause or rest. Sometimes also r, although the original IBM and Microsoft BASIC used p, [14] as do all clones (e.g. the Linux and BSD speaker devices). [15] 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.

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 

Below is the popular Japanese song "tōryanse" written using MML in PC-6001( NEC PC-6000_series ) N60-BASIC.It is listed for comparison with Classical MML. [16]

10A$="o4e2r32e4r32d4r32e4r32e8r32d8r32o3b2r16"20B$="o4f4r32f8r32f8r32a4r32f8r32e8r32f8r32e8r32d8r32d8r32e2r16"30C$="o4c4r32c8r32c8r32e4r32c8r32o3b8r32o4c8r32o3b8r32a8r32a8r32b2r16"40D$="o4e8r32e8r32e8r32e8r32e8r32e8r32d8r32"50E$="o4e8r32e8r32e8r32d8r32o3a8r32a8r32b2r16"60F$="o3a8r32b8r32o4c8r32d8r32e8r32f8r32e8r32"70G$="o4f4r32a4r32b8r32a8r32f4r32"80H$="e4r32e8r32d8r32e2r16"100PLAY"t120"110PLAYA$120PLAYB$130PLAYB$140PLAYC$150PLAYC$160PLAYB$170PLAYC$180PLAYD$190PLAYE$200PLAYF$210PLAYG$220PLAYH$

SMX

Standard Musical eXpression (SMX) is a variant of Modern MML provided by Microsoft in QBASIC, BASICA, and GW-BASIC's PLAY statement. [9] The version used by GW-BASIC is part of the modern BSDs, FreeBSD, [17] NetBSD, OpenBSD, and MirOS; see speaker(4) for the language. [18]

Languages, platforms and software

See also

Related Research Articles

Z88DK is a Small-C-derived cross compiler for a long list of Z80 based computers. The name derives from the fact that it was originally developed to target the Cambridge Z88. Z88DK is a collection of software development tools that targets the 8080 and Z80 family of machines. It allows development of programs in C, assembly language or any mixture of the two. What makes z88dk unique is its ease of use, built-in support for many Z80 machines and its extensive set of assembly language library subroutines implementing the C standard and extensions.

Microsoft BASIC is the foundation software product of the Microsoft company and evolved into a line of BASIC interpreters and compiler(s) adapted for many different microcomputers. It first appeared in 1975 as Altair BASIC, which was the first version of BASIC published by Microsoft as well as the first high-level programming language available for the Altair 8800 microcomputer.

<span class="mw-page-title-main">MSX</span> Family of standardized home computer architectures released between 1983 and 1992

MSX is a standardized home computer architecture, announced by ASCII Corporation on June 16, 1983. It was initially conceived by Microsoft as a product for the Eastern sector, and jointly marketed by Kazuhiko Nishi, the director at ASCII Corporation. Microsoft and Nishi conceived the project as an attempt to create unified standards among various home computing system manufacturers of the period, in the same fashion as the VHS standard for home video tape machines. The first MSX computer sold to the public was a Mitsubishi ML-8000, released on October 21, 1983, thus marking its official release date.

MSX BASIC is a dialect of the BASIC programming language. It is an extended version of Microsoft's MBASIC Version 4.5, adding support for graphic, music, and various peripherals attached to MSX microcomputers. Generally, MSX BASIC is designed to follow GW-BASIC, released the same year for IBM PCs and clones. During the creation of MSX BASIC, effort was made to make the system flexible and expandable.

<span class="mw-page-title-main">PC-8800 series</span> Series of computers sold in Japan by NEC

The PC-8800 series, commonly shortened to PC-88, are a brand of Zilog Z80-based 8-bit home computers released by Nippon Electric Company (NEC) in 1981 and primarily sold in Japan.

<span class="mw-page-title-main">PC-98</span> Series of PCs by NEC, sold primarily in Japan

The PC-9800 series, commonly shortened to PC-98 or 98, is a lineup of Japanese 16-bit and 32-bit personal computers manufactured by NEC from 1982 to 2003. While based on Intel processors, it uses an in-house architecture making it incompatible with IBM clones; some PC-98 computers used NEC's own V30 processor. The platform established NEC's dominance in the Japanese personal computer market, and, by 1999, more than 18 million units had been sold. While NEC did not market these specific machines in the West, it sold the NEC APC series, which had similar hardware to early PC-98 models.

<i>Bomberman</i> (1983 video game) 1983 video game

Bomberman is a maze video game developed and published by Hudson Soft. The original home computer game Bomber Man was released in July 1983 for the NEC PC-8801, NEC PC-6001 mkII, Fujitsu FM-7, Sharp MZ-700, Sharp MZ-2000, Sharp X1 and MSX in Japan, and a graphically modified version for the MSX and ZX Spectrum in Europe as Eric and the Floaters. A sequel, 3-D Bomberman, was produced. In 1985, Bomberman was released for the Nintendo Entertainment System. It spawned the Bomberman series with many installments building on its basic gameplay.

<span class="mw-page-title-main">Sharp X1</span> Series of home computers

The X1, sometimes called the Sharp X1 or CZ-800C, is a series of home computers released by Sharp Corporation from 1982 to 1988. It is based on a Zilog Z80 CPU.

<i>Bokosuka Wars</i> 1983 video game

Bokosuka Wars (ボコスカウォーズ) is a 1983 action-strategy role-playing video game developed by Kōji Sumii (住井浩司) and released by ASCII for the Sharp X1 computer, followed by ports to the MSX, FM-7, NEC PC-6001, NEC PC-8801 and NEC PC-9801 computer platforms, as well as an altered version released for the Family Computer console and later the Virtual Console service. It revolves around a leader who must lead an army in phalanx formation across a battlefield in real-time against overwhelming enemy forces while freeing and recruiting soldiers along the way, with each unit able to gain experience and level up through battle. The player must make sure that the leader stays alive, until the army reaches the enemy castle to defeat the leader of the opposing forces.

Music of the <i>Streets of Rage</i> series Video game discography

The music of the Streets of Rage series of beat 'em up games, released in the early 1990s, was primarily produced by Yuzo Koshiro.

<i>Binary Land</i> 1983 video game

Binary Land is a puzzle video game developed by Hudson Soft in 1983 for the MSX, FM-7, PC-6001mkII, NEC PC-8801, Sharp MZ-2200, Sharp MZ-5500, Sharp X1 and in 1985 for the Famicom. The MSX version saw release in Japan by Hudson Soft and in Europe by Kuma Computers Ltd in 1984.

<i>Hydlide</i> 1984 video game

Hydlide is an action role-playing game developed and published by T&E Soft. It was originally released for the NEC PC-6001 and PC-8801 computers in 1984, in Japan only; ports for the MSX, MSX2, FM-7 and NEC PC-9801 were released the following year. A Nintendo Switch port based on the PC-8801 version was released on December 21, 2023 by D4 Enterprise.

Moonsound is a sound card released for the MSX home-computer system at the Tilburg Computer Fair in 1995. It was designed by electronic engineer Henrik Gilvad and produced by Sunrise Swiss on a semi-hobby basis.

<i>Flappy</i> 1983 puzzle video game

Flappy is a puzzle video game by dB-Soft in the same vein as the Eggerland series and Sokoban that is obscure outside Japan. It stars Flappy, a somewhat mole-like character who must complete each level by pushing a blue stone from its starting place to the blue tile destination.

<span class="mw-page-title-main">PC-8000 series</span> NEC personal computer line

The PC-8000 series is a line of personal computers developed for the Japanese market by NEC. The PC-8001 model was also sold in the United States and Canada as the PC-8001A.

BSAVE and BLOAD are commands in many varieties of the BASIC programming language. BSAVE copies RAM to a binary file, and BLOAD copies the contents of the file to RAM. The term "BSAVE image" could mean any of various raw image formats of video display controllers, or more generally any file containing the raw contents of a section of memory.

<span class="mw-page-title-main">PC Open Architecture Developers' Group</span>

PC Open Architecture Developers' Group is a consortium of the major Japanese personal computer manufacturers. Sponsored by IBM during the 1990s, it successfully guided Japan's personal computer manufacturing companies at that time into standardising to an IBM PC-compatible and open architecture.

Arsys Software (アルシスソフトウェア), later known as Cyberhead (サイバーヘッド), was a Japanese video game software development company active from 1985 to 2001.

References

  1. Compiled by " Tomohiro Nishikado " (西角友宏/にしかどともひろ) worked in the Pacific Industrial Co., Ltd. All compiled alone.
  2. 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". Hitachi. Archived from the original on 8 May 2015. Retrieved 26 August 2013.
  3. "SHARP MZ.org MZ-80K monitor sub $0030". 2012-09-20. Archived from the original on 2015-09-26. Retrieved 2012-09-19.
  4. CPU is Z-80 Zilog Licensed Secondary source
  5. Nobuaki Ohishi (2012-09-20). "Nibbles lab.SHARP Museum,MZ-80K Photo and Catalog".
  6. 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.
  7. "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.
  8. 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.).
  9. 1 2 3 4 5 6 Selfridge-Field, Eleanor (1997). Beyond Midi: The Handbook of Musical Codes. Cambridge: MIT Press. ISBN   0-262-19394-9.
  10. 1 2 "VORC Internet Chiptune Encyclopedia - mck". Archived from the original on 2008-01-03. Retrieved 2008-02-13.
  11. 1 2 3 "VORC Internet Chiptune Encyclopedia - MML". Archived from the original on 2007-11-23. Retrieved 2008-02-13.
  12. "VORC: VGM or Chiptune of The Year 2001". 2001-12-31.
  13. Johnson, Jeremiah. "MCK/MML Beginners Guide". Archived from the original on 2007-12-14. Retrieved 2008-02-13.
  14. "IBM BASIC manual, Second Edition (May 1982), Version 1.10" (PDF). Archived from the original (PDF) on 2015-06-15. Retrieved 2016-03-26.
  15. MirBSD speaker device documentation
  16. Programmed by MOTOI_Kenkichi November,11 2024.Licensed #AAAP(Including Creative Commons CC-BY-SA and Text of GNU Free Documentation License.).
  17. FreeBSD speaker(4) manual page
  18. 1 2 speaker(4) manual page
  19. "QBasic manual". Microsoft Corporation. 1991.{{cite journal}}: Cite journal requires |journal= (help)
  20. "IBM Personal Computer BASIC manual". IBM Corporation. 1982.{{cite journal}}: Cite journal requires |journal= (help)
  21. "BASICA manual". Microsoft Corporation. 1982.{{cite journal}}: Cite journal requires |journal= (help)
  22. "GW-BASIC manual". Microsoft Corporation. 1987.{{cite journal}}: Cite journal requires |journal= (help)
  23. Raymond, Eric (7 May 1995). "Eric Raymond's Open-Source Works". Eric S. Raymond's Home Page. Retrieved 3 July 2020.
  24. Koshiro, Yūzō. "Yuzo Koshiro Interview" (Interview). Interviewed by Kikizo Games. Retrieved 2008-02-13.
  25. Szczepaniak, John. "Retro Japanese Computers: Gaming's Final Frontier". Hardcore Gaming 101. Retrieved 2011-03-29. Reprinted from Retro Gamer , 2009
  26. "ツールのお部屋" (in Japanese). Retrieved 2019-12-01.
  27. "VORC Internet Chiptune Encyclopedia - ppmck". Archived from the original on 2006-10-12.
  28. Swimm, Peter (December 21, 2009). "XPMCK - Cross Platform Music Compiler Kit updated". True Chip Till Death. Retrieved December 29, 2011.
  29. "着信メロディは再び自分で作る時代に?──MIDIファイルやWAVファイルを着メロに変換". ITmedia, Inc. 2001-04-03. Retrieved 2008-02-13.
  30. "ANSI Music - The Technical Details" . Retrieved 2009-01-16.