2. The Components of Csound


The Compiler
Csound runs on a command-line interface, in the following form:

X:\> Csound [-flags] foo.orc foo.sco

Enter this on the command line. Some important flags are:

  -d     to suppress all graphical displays 
  -A     to create an .aiff output file 
  -W     to create a  .wav  output file 
  -o foo to name the output file instead of the default "test.xxx" 

If you have gui front end, e.g. winsound specify the orchestra and score files, the output filename, file format, size, graph display, etc. and click on render. Some front ends include a sound player from where you can hear the output. On winsound tap the space-bar to start the test. Otherwise, use the sound player of your choice to hear your composition.

Orchestra and Score file (or other performing files)


Csound requires two separate files: an orchestra file, foo.orc, which contains the header and instrument definitions, and a score file, foo.sco, which contain the function tables and the notes which the instruments are called to play.

The orchestra files have an extension of '.orc', and score files are labeled '.sco'. Each file has two sections. The orchestra file has a header, which establishes the various sampling rates and number of output channels. This rarely varies between orchestra files, at least for a beginner. Instrument definitions, explained in greater detail in the next section, end in comma separated arrays of very meaningful numbers. Similar arrays of numbers in the score file have no commas.

Both sections of the score files are strongly interrelated to the orchestra file (duh! ... who would play a score without an orchestra?) The function lines create the wave-tables for the instruments to play. The note lines are really data strings for the instrument code. Each place, after the initial "i", referred to as "p1 p2 p3 ..." passes a value to the instrument code. The first three are always the same: instrument number, start time, and duration. The rest are much more complicated. Read on!

Recently, Csound has been made to accept a unified orchestra/score file format, with the extension '.csd'. The format uses html-ish flags to separate orchestra and score material. Using the winsound compiler, it is more prone to crash than using two files according to my personal experience.

Output sound (.aiff, .wav, real-time audio, MIDI)


Csound is a sound renderer; it take the information from the orchestra and score files and produces a digital audio clip in raw, .wav, .aiff, or IRCAM formats. For the Widows Soundplayer use .wav. For Quicktime, use .aiff.

On fast machines, Csound also runs in real-time. It creates audio samples and plays them through the DAC of the sound card. The composer can input the data by keyboard or mouse, or by the means of a MIDI controlling device, such as a keyboard or wind controller. (But I'm not going to tell you how to do that here. It's "advanced".)


Return to Table of Contents.