Chapter Four: Synthesis

14. A Digital Synthesis Language Sampler | Page 9

MUSIC V

History

While it is well-documented that computers had been programmed to produce sound, even music, prior to the first dedicated digital synthesis language, Max Mathews is credited with creating the first high-level music programming environment with his MUSIC (later referred to as MUSIC I) program in 1957 while working for Bell Labs. MUSIC was a direct digital synthesis language, in that it produced a sequence of digital PCM samples, output and recorded onto magnetic tape, that could be played back and converted into audible sound through the digital-to-analog (D-to-A) converters that Mathews had also developed.

In 1957, MUSIC (I) was written in the low-level assembly language for the IBM 704 computer at Bell Labs.  Newman Guttman composed The Silver Scale (1957) (listen) with it, which is often considered the first direct digital synthesis language composition.  MUSIC had one voice, one triangle waveform, a square envelope and no control of timbre. In Mathews’ own words, “MUSIC I sounded terrible… .” Each subsequent incarnation of MUSIC, through MUSIC IV added voice, timbre, wavetable capability, along with the orchestra/score division mentioned earlier.  Even though MUSIC IV (completed with Joan Miller) was still written in assembly language for the newer IBM 7094, intrepid composer/technicians Hubert Howe and Godfrey Winham rewrote it for MUSIC 4B and then MUSIC IVBF (F for Fortran), and Barry Vercoe ported it to the IBM 360 for his MUSIC 360 (the early lineage of csound). Mathews composed the piano-like accompaniment for Daisy Bell using the 7094 in 1961, with the vocoded vocals programmed by John Kelly and Carol Lockbaum, and made famous by Stanley Kubrick's 2001: A Space Odyssey in 1968 as HAL loses his mind.

The huge development for the dissemination of direct digital synthesis came with MUSIC V, written by Mathews in 1967-8 in the recent higher-level language Fortran (FORmula TRANslator), which could be compiled on other computer types, though some of the inner loops were still written in assembly language and needed some TLC for each different type of processor.   MUSIC V’s source code was made available to the world as a box of 3500 punch cards.  In 1962, Decca released Music from Mathematics with works by Mathews, James Tenney, J.R. Pierce and others (listen).  Jean-Claude Risset, mentioned earlier, composed Mutations, with includes the Shepard-Risset endless glissando, with MUSIC V in 1969 (listen). That same year Mathews, in collaboration with Miller, F.R. Moore, Pierce and Risset published The Technology of Computer Music, essentially the user manual for MUSIC V.

Features

 

Sample Code with Explanation

We will build a simple instrument using the primary Music V ugens mentioned early and add in wavetable functions for the envelope and the signal (carrier) oscillator.

Naming conventions:
P names (P1, P2, etc.) are parameter fields that take specific data from the score notes to plug into the orchestra instrument arguments. P1-P4 are reserved. P1 is for score instruction type (NOT, GEN, TER). For NOT's (notes), P2 is start time, P3 is instrument #, and P4 is duration.
F names refer to function tables (wavetables) defined in the score
B names are "I/O blocks" used for connections between ugens–these are the "patch cords." Signals sent to the reserved name B1 (B1 and B2 if stereo) are written to the tape or file output for D-to-A conversion. B1 signals are summed with other B1 signals from other instruments
INS instrument definition #, first argument is time (in seconds) instrument is created, second argument is the instrument # itself that can be referenced in the score
END end of a particular instrument definition
TER score time (in seconds) piece is terminated
GEN function table generating routine. There are three GEN routines described in Mathews' book (see pg. 169) beginning with GEN 1, straight line segments (alternating value, index#), GEN2 sum of sines, GEN3 a list of integers values that will be equally spaced over table size. The Risset catalog added several more GEN's later on. Default table size is 512 (0-511)

Below is a review of the two main ugens used here and their arguments:

OSC (oscillator) arguments in order:

  • Amplitude
  • Frequency (here without the CONVT subroutine, so specified as table size/sampling rate * desired Hz)
  • Output bus
  • Function table providing the waveform “Vacant note” temporary holding variable for OSC’s first sample (can be omitted, but should be unique to each OSC).

OUT takes an input and outputs it to the program output in blocks of samples. Its arguments in order are:

  • Input bus (B2 or higher, B3 or higher if stereo)
  • Final output bus (always B1) to be summed with other instrument outputs and written to magtape (later on, a file)

We will recreate an instrument with score that plays two notes with a pulse-like waveform and a slowed attack and decay envelope to avoid clicks (this is taken from The Technology of Computer Music, p. 54).  Annotated descriptions of what each line means appear below, but these would not be included in the actual MUSIC V code. The frequencies calculated here represent a table size of 511 and a sampling rate of 20,000. A "record #" column has been included, as MUSIC V punch cards began with a record number, equivalent to a line number, for the computer to order during its first pass, even if the cards were read out of order (for instance if the box of cards was dropped (happened to me)).

I have annotated Mathews’ schematic for this instrument here, along with his images of the function tables generated by the score below:

MUSIC_V_patchF1F2
Rec
#
Code Explanation
Score
1 INS 0 1 ; Define Instrument 1 at time 0
2 OSC P5 P6 B2 Fl ; Define oscillator for envelope generation: P5 osc amp, P6 osc freq, B2 osc output, use F1 function table waveform defined below in score (we are omitting the optional vacant note parameter)
3 OSC B2 P7 B2 F2 ; Define carrier oscillator: B2 amp input value from envelope osc above, P7 carrier freq, B2 osc output (overwrites previous B2), use F2 function table waveform defined below in score
4 OUT B2 Bl ; Take B2 signal from OSC above and output it to tape or file on B1
5 END ; End Instrument 1 definition, define further instruments below if desired
Orchestra
6 GEN 0 1 1 0 0 .99 20 .99 491 0 511 ; Beginning of score section. At score time 0, use GEN1 routine (straight line segments) to create function table F1, alternating value, index#, value, index# through 511 indices. F1 is used for amplitude envelope in the patch above
7 GEN 0 1 2 0 0 .99 50 .99 205 -.99 306 -.99 461 0 511 At score time 0, use GEN1 routine to create function table F2. F2 is used for the carrier waveform. Same value, index# order as above
8 N0T 0 1 2 1000 .0128 6.70 ; Play a note at time 0 seconds (P2), using Instrument 1 (P3), for 2 seconds (P4) with an amplitude of 1000 (P5). .0128 (P6) gives the envelope osc one cycle for the duration of the note so the envelop only plays once (~.02555*0.5), and 6.70 (P7) is the frequency of the carrier oscillator in MUSIC V's native frequency formula (.02555 * desired frequency) mentioned earlier (so will actually play ~262 Hz)
9 N0T 2 1 1 1000 .0256 8.44 ; Play a second note beginning at 2 seconds, using Instrument 1 for 1 second with an amplitude of 1000, but a faster P6 for the envelope's shorter note duration ~.02555*1), with a frequency of 8.44 (so will play ~330 Hz)
10 TER 3 ; End the piece at second 3

Resources

As mentioned, MUSIC V is presented here primarily for historical reasons, as well as its pioneering the paradigm for many of the typing languages to come. However, if the reader is determined to try out MUSIC V on a modern computer, the intrepid reader may still be able to find the resources to do so on Github. It would involve not only finding the MUSIC V source code, but also a Fortran compiler for your particular processor (links here may be transitory).

Max Mathews' The Technology of Computer Music (MIT Press, 1969), which includes the MUSIC V manual is out of print, but the reader may be able to find pdf's on the web (legally or not).

The Risset “An Introductory Catalog of Computer Synthesized Sounds” catalog, also adds several GEN routines and explains the CONVT routines in better detail.

If the "style" of MUSIC V appeals, then its modern, fully functioning and greatly expanded equivalent, as well as direct descendant is csound, discussed on the next page.