MUSIC 4C (M4C), A Music Synthesis Program for the UNIX Environment

Music 4C was orginally written in 1985 as an enhanced translation of Music 4BF, a music program created at Princeton University in the late 1960's. Whereas 4BF was written entirely in Fortran and employs instrument definitions written in Fortran, M4C is written entirely in C for the Unix environment and employs instrument definitions written in C. Since 1985 the language has been developed extensively to make it more flexible and easy to use.

M4C produces sequences of sounds organized according to specified start times, durations, and timbral qualities, and with any desired degree of accuracy. There is practically no limit on the number of different timbres that can be generated, and any instrument can play against itself as many times as we please. There may be practical limits, but these would be due to the particular computer being used, not by the program. Moreover, any timbral voice scheme can be programmed (in the C language).

Like C Sound and C Music, Music 4C uses a score file which is an "event list", a series of "instrument statements" which designate start time, duration, pitch, amplitude, and other instrument parameters. Unlike C Sound, instruments and parameters are known by their names, although only the instrument names appear explicitly within instrument statements. A typical instrument statement could look like:


/* name  start_time duration oct.pitch amplitude attack decay  */
I(trumpet  0           1)    {8.09      20000     .03    .06}

Note that C-style comments can also be used.

The parameters inside the parentheses () are always 'instrument name', 'start time' (in seconds), and 'duration' (in seconds).

The parameters inside the braces ({ }) are defined in an instrument definition file for the 'trumpet' using:


.scorecard
oct.pitch, amplitude, attack, decay

The first two parameters are usually oct.pitch and amplitude, but not always.

An auxiliary program that comes with the M4C package, notepro, can be used to process scores that are alpha-numeric translations of ordinary musical notation into event lists. A simple 'notepro score' might look like this:


'trumpet' C D E/ F#/ G. A/ Bo

which translates into


I(trumpet, 0.000, 1.000) { 8.0000,   1024}
I(trumpet, 1.000, 1.000) { 8.0200,   1024}
I(trumpet, 2.000, 0.500) { 8.0400,   1024}
I(trumpet, 2.500, 0.500) { 8.0600,   1024}
I(trumpet, 3.000, 1.500) { 8.0700,   1024}
I(trumpet, 4.500, 0.500) { 8.0900,   1024}
I(trumpet, 5.000, 2.000) { 8.1100,   1024}

Notepro does not handle parameters other than instrument name, start time, duration, pitch, and amplitude. Other parameters must be edited in by hand or by a program, such as the 'scorpro' program provided with the M4C package.

A number of instruments have been coded for immediate use. For example, the theory and use of ten instruments in the 'Class Orchestra' are described by a tutorial manual, the Music 4C Introduction. Several other instruments, such as the Sample Instrument and the Additive Synthesis Instrument, are also included in the M4C package, although they are not discussed in the tutorial.

Sound synthesis code can be written by the user directly in the C language. The tutorial manual explains how to design instruments and compose orchestras from individual instruments.

Since M4C is a software synthesis language, music is not produced in real time. The time required to produce a piece depends on the length of a piece, its complexity, the amount of other activity on the computer, and the speed of the computer. It runs on a variety of machines which employ the Unix operating system. As one moves to faster machines, the turn-around time to compute a piece becomes shorter and shorter.

M4C is distributed in C source code for Unix, and then the M4C library and some pre-designed orchestras must be compiled on your machine. Assuming that a C compiler is installed and your compilation is successful, you will be ready to follow the M4C Introduction tutorial, which can be printed from within the package or downloaded from this site, and then to actually make music. Output is normally in the form of snd sound files (monaural or stereo), but aiff and wave are also available.

For an HTML Introduction to Music 4C tutorial click here:
M4C HTML Manual.
Thanks to Art Green for putting this together!

To download a PDF version of the Introduction to Music 4C tutorial click here:
M4C PDF Manual.

If you wish to obtain a source file copy of M4C, please register by sending the following information to James Beauchamp using the email link given below.


Example of what to send:
     Name:        John W. Jones
     Affiliation: University of Canterbury at Kent
     Address:     2136 Ornithology Bldg., 1114 W. Aviary, Kent, AB3 6ZP UK
     Phone:       +44-1344-330730
     Email:       jwjones@ucant.uk
     Computer:    Pentium II Intel PC 
     Op. Sys.:    Linux (Redhat 8.0)
     Software Requested: Music 4C
     What is your application? bird song synthesis
     How did you hear about Music 4C? from the C Sound list

You will then receive instructions for downloading the software from a web site.

James Beauchamp Homepage

University of Illinois at Urbana-Champaign Homepage

JB's email link

last edited: 9/20/04