ArticleslgStudy

computer science

Music Macro Language

Music Macro Language is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Music Macro Language rather than just read about it. In short: 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.

Music Macro Language — main illustration
Music Macro Language — illustration

Key takeaways

  • Music Macro Language belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Music Macro Language to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Music Macro Language from memory before moving on to harder problems.

Reference excerpt

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.

Worked examples

Example 1 — a first encounter with Music Macro Language

Start with the simplest possible case. Write down what Music Macro Language claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Music Macro Language before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Music Macro Language ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Music Macro Language

In research
Music Macro Language appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Music Macro Language in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Music Macro Language is common in secondary-school and first-year university syllabi. It links to neighbouring topics Audio programming languages, Electronic music software, Free audio software, so understanding it makes those chapters shorter.
In everyday life
Look for Music Macro Language outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Music Macro Language” →

How to study Music Macro Language in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Music Macro Language means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Music Macro Language out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Music Macro Language in simple terms?

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 har…

Why does Music Macro Language matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Music Macro Language?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Music Macro Language.

Tags

  • Audio programming languages
  • Electronic music software
  • Free audio software
  • Music notation file formats
  • Video game music file formats
  • Video game music technology

Keep exploring