Csound Cheat Sheet
Csound's structure in brief — the CSD file layout, the orchestra header, how instruments are written, and the score statements that drive them.
CSD file structure
<CsoundSynthesizer> <CsOptions> -odac </CsOptions> <CsInstruments> ; orchestra here </CsInstruments> <CsScore> ; score here </CsScore> </CsoundSynthesizer>A complete .csd file: options, orchestra, score
-odacOutput to the audio device (-o out.wav writes a file)Orchestra header
sr = 44100Audio sample rateksmps = 32Samples per control periodnchnls = 2Number of output channels0dbfs = 1Full-scale amplitude — makes 1.0 the maximumVariable rates (the prefix matters)
asiga-rate: audio, updated every samplekampk-rate: control, updated every ksmps samplesifni-rate: set once at note initialisationgkvalPrefix with g for a global variableInstruments
instr 1 asig oscili 0.6, 440 outs asig, asig endinAn instrument: opcode outputs on the left, inputs on the right
ares oscili xamp, xcps[, ifn, iphs]The oscili signature — interpolating oscillatorout asig / outs aL, aRSend to the output (mono / stereo)p4, p5Parameters passed in from the score's i-statementCommon opcodes
oscil, oscili, poscilTable oscillators (poscil is precise)linen, madsr, expsegEnvelopesmoogladder, butterlp, resonFiltersreverbsc, freeverbReverbsdiskin2, loscilPlay back a sound file / sampleScore statements
i 1 0 2Play instrument 1, start at 0 s, last 2 si 1 0 2 440 0.5Extra fields arrive as p4, p5 …f1 0 128 10 1Build function table 1: GEN10, a sine waveeEnd the scoret 0 120Set the tempo to 120 BPMCsound — Veteran synthesis & DSP language. · Csound in the tool directory →