LJ Archive

CSound in a Nutshell

Csound is sometimes referred to as a waveform compiler, so it requires two types of source files, orc and sco. An orc file designs a Csound instrument, which might be anything from an FM oscillator (foscil) to a sample playback engine (loscil or soundin). The orc file may internally hard-wire its necessary parameter values, or it may receive them from the sco file. An sco file specifies event start times and durations and any required stored-function tables. The finished orc/sco files are then compiled by the csound command. In the following example, they are compiled to a WAV format sound file:

csound -o foo.wav -W foo.orc foo.sco
When running Csound in an X session, a small window will pop up with a graphic display of the function tables in the sco file. Clicking over the window will allow compilation to begin and a series of messages will appear in the starting xterm. If no errors are reported, a new sound file was created and it is now available for further processing in Csound or one of the many Csound utilities.

By the way, beginners are often surprised to learn that despite its name, Csound presents itself in an archaic syntax more like assembler or FORTRAN than C. The “C” part of the name refers to the fact that the Csound source code is written in C.

LJ Archive