-- scorefiles (or data files) contain the user-specified data for particular CMIX instruments information such as the starting time of a sound, the duration, possibly some frequency parameters, etc. are all contained in these text files. Much of this article will be devoted to the structure and syntax of CMIX scorefiles.
-- soundfiles are created by CMIX instruments and are rarely (if ever) edited "by hand". This is primarily because of their size; the digital representation of sound consumes many megabytes of storage. CMIX soundfiles do contain a small amount of information other than the digitized sound data. This information is stored in the soundfile header, a 1024-byte chunk placed at the very front of a soundfile. Much of the information necessary for the operation of CMIX instruments is stored in the soundfile header, information such as the sampling rate, the number of channels (usually mono or stereo), the format of the sound data numbers (floating point or 16- bit integer), etc.
The CMIX soundfile header structure is based on work done by Robert Gross while he was at IRCAM. Soundfiles with this type of header are referred to as "bsd" soundfiles by CMIX, reflecting the Unix development background. The NeXTStep port of CMIX encapsulates the NeXT soundfile header within the "bsd" soundfile header, so that CMIX can read or write directly to/from both NeXTStep soundfiles and standard CMIX soundfiles. The file sfheader.h in the cmix/H directory contains a listing of the header information along with C macros for reading and extracting soundfile header data from within a C program.
Because CMIX needs the information in the soundfile header, the output soundfile must exist prior to the execution of a CMIX instrument. If CMIX is creating a new soundfile "from scratch" rather than adding sound to an existing soundfile, then a soundfile header must be pre-created on the disk. This header-only soundfile is in essence a soundfile of 0 length; a soundfile containing no sound. The CMIX command sfcreate will accomplish this task. Like many Unix commands, sfcreate uses a set of flags to specify the data to be written into the soundfile header. Executing sfcreate with no options will display a list of the options for sfcreate:
sfcreate
usage: "sfcreate -r [s. rate] -c [# chans] -[i=int; f=float] <-w
As an example, the command:
sfcreate -r 44100 -c 2 -i fun.snd
will create a soundfile header for the file "fun.snd" with a sampling rate of 44100 samples/second, 2 channels (stereo), 16-bit integer format. Until this newly-create soundfile has any digitized sound data written into it, it will exist only as a 1024-byte long soundfile header.
Two other commands in the cmix/head directory are useful for dealing with soundfile headers. sfprint will print all of the header information, and sfhedit can change the parameters stored in the header. Note that sfhedit ONLY changes the header information -- changing the sampling- rate parameter in the header will not do a sampling-rate conversion on the file; it will only change the way CMIX interprets the sound sample numbers in the file.
- executable files,
the third type of CMIX file, come in two forms. The first form are commands (such as sfprint, sfcreate, etc.) designed to do utility chores and 'global' manipulation of soundfiles (sfshrink and sfextend are also examples of this type of CMIX command). Many of these utility commands have been superceded by other programs. For example, the CMIX hist command plots an ASCII representation of the time-varying amplitude of a soundfile. This job is done much more elegantly by contemporary graphics-oriented programs such as Mixview and EdSnd.
The second type of CMIX executable files are CMIX instruments, or CMIX commands designed to perform specific signal-processing or sound synthesis chores. Quite a few CMIX instruments have already been built. The file cmixinsts.tar.Z available in the pub/music directory of the princeton.edu ftp site contains a number of signal-processing and synthesis algorithms implemented as CMIX instruments.
Typing the command name of a CMIX instrument invokes the CMIX environment, which accepts input from the keyboard (the Unix standard input) and prints information to a terminal screen (the Unix standard output). Thus CMIX may be used interactively by simply typing CMIX commands to be executed, or it may be used in 'batch' mode through Unix i/o redirection. For example, a series of instructions for the CMIX fm instrument may be typed directly into the CMIX environment after invoking the fm command, or the CMIX instructions may be entered as text into a scorefile (perhaps "fm.sco") and loaded into the fm instrument by saying:
fm < fm.sco
Generally, the use of scorefiles is preferred to typing instructions directly into the CMIX environment because CMIX has no real text-editing capabilities. Entering a long and complex set of score commands into CMIX only to discover that a single character was mistyped can be extremely frustrating.
In addition to reading the standard input and writing the standard output, CMIX also (of course!) reads and writes soundfiles. Soundfile names are specified in the scorefile.
Next Section: Structure of the CMIX Scorefile
What is CMIX? - Index -
Cmix Home Page