Csound

From Free net encyclopedia

(Redirected from CSound)

Csound is a computer programming language for dealing with sound. It is called Csound because it is written in the C programming language, as opposed to some of its predecessors. Csound was written at MIT by Barry Vercoe, based on an earlier language called Music360, developed by Max Matthews at Bell Labs. It is free software, available under the LGPL.

In a simple usage, the programmer supplies Csound with two specially formatted text files as input: the orchestra describing the nature of the instruments and the score describing notes and other parameters along a timeline. Csound then processes the instructions in these files and renders an audio file or real-time audio stream as output.

It has been developed over many years and currently has a vast amount of opcodes (modules). One of its greatest strengths is that it is completely modular and expandable by the user.

The orchestra and score files may be unified into a single structured file using XML tags. Here is a very simple example of a unified Csound data file which produces a wave file containing a one second sine wave tone of 1 kHz at a sample rate of 44.1 kHz:

<CsoundSynthesizer>;
  
  <CsOptions>
    csound -W -d -o tone.wav 
  </CsOptions>
  
  <CsInstruments>
    sr     = 44100           ; Sample rate.
    kr     = 4410            ; Control signal rate.
    ksmps  = 10              ; Samples pr. control signal.
    nchnls = 1               ; Number of output channels.

    instr 1 
    a1     oscil p4, p5, 1   ; Simple oscillator. 
           out a1            ; Output.
    endin
  </CsInstruments>

  <CsScore>
    f1 0 8192 10 1           ; Table containing a sine wave.
    i1 0 1 20000 1000        ; Play one second of one kHz tone.
    e
  </CsScore>

</CsoundSynthesizer>

As with many other programming languages, writing long programs in Csound can be eased by using an integrated environment for editing, previewing, testing, and debugging. Such environments are available.

Csound is closely related to the underlying language for the Structured Audio extensions to MPEG-4, SAOL.

Csound5 is the latest version of the software, currently available in binary for Linux, Windows and MacOSX. It is a much improved and expanded version of the original software, available also in the form of a library and API, which can be used by other software. In addition to the basic C API, there are also Python, Java, LISP, Tcl and C++ APIs.

See also

External links

  • Official website contains FAQs, manuals, programming examples, other front end programs, and misc other goodies. The mailing list archive is also a good place to find detailed information.
  • Project site at Sourceforge
  • Csound Editor is an integrated programming environment for CSound.