Table of Contents


Preface
Preface to the Csound Manual
Copyright Notice
Acknowledgements
History of the Canonical Csound Reference Manual
Licenses
Getting Started with Csound

I. Overview
Introduction
Recent Developments
New Features in Csound 5
Features of CsoundVST
Using
CsoundVST
Real-Time Audio
Linux
Windows
Mac
Front Ends
Configuring
Windows
Unix and Linux
CsoundVST
Building Csound
Csound Links
The Csound Command
Order of Precedence
Description
Command-line Flags (Alphabetically)
Command-line Flags (by Category)
Csound Environment Variables
Unified File Format for Orchestras and Scores
Description
Structured Data File Format
Command Line Parameter File (.csoundrc)
Score File Preprocessing
The Extract Feature
Independent Pre-Processing with Scsort
Syntax of the Orchestra
Directories and Files
Nomenclature
Orchestra Statement Types
Constants and Variables
Expressions
Orchestra Header Statements
Macros
Instrument and Opcode Block Statements
Variable Initialization
Named Instruments
User Defined Opcodes (UDO)
The Standard Numeric Score
Preprocessing of Standard Scores
Carry
Tempo
Sort
N.B.
Next-P and Previous-P Symbols
Ramping
Score Macros
Multiple File Score
Evaluation of Expressions
Score Statements
Sine/Cosine Generators
Line/Exponential Segment Generators
File Access GEN Routines
Numeric Value Access GEN Routines
Window Function GEN Routines
Random Function GEN Routines
Waveshaping GEN Routines
Amplitude Scaling GEN Routines
Mixing GEN Routines
TclCsound
The Tcl interpreter: cstclsh
Cswish: the windowing shell
A Csound server
A Scripting Environment
TclCsound as a language wrapper
TclCsound Command Reference

II. Opcodes Overview
Signal Generators
Additive Synthesis/Resynthesis
Basic Oscillators
Dynamic Spectrum Oscillators
FM Synthesis
Granular Synthesis
Linear and Exponential Generators
Envelope Generators
Models and Emulations
Phasors
Random (Noise) Generators
Sample Playback
Soundfonts
Scanned Synthesis
Table Access
Wave Terrain Synthesis
Waveguide Physical Modeling
Signal Input and Output
File Input and Output
Signal Input
Signal Output
Software Bus
Printing and Display
Sound File Queries
Signal Modifiers
Amplitude Modifiers and Dynamic processing
Convolution and Morphing
Delay
Panning and Spatialization
Reverberation
Sample Level Operators
Signal Limiters
Special Effects
Standard Filters
Specialized Filters
Waveguides
Comparators and Accumulators
Instrument Control
Clock Control
Conditional Values
Duration Control Statements
Introduction to FLTK Widgets and GUI controllers
FLTK Containers
FLTK Valuators
Other FLTK Widgets
Instrument Invocation
Program Flow Control
Real-time Performance Control
Initialization and Reinitialization
Sensing and Control
Stacks
Sub-instrument Control
Time Reading
Function Table Control
Table Queries
Read/Write Operations
Table Reading with Dynamic Selection
Mathematical Operations
Amplitude Converters
Arithmetic and Logic Operations
Mathematical Functions
Opcode Equivalents of Functions
Random Functions
Trigonometric Functions
Pitch Converters
Functions
Tuning Opcodes
Real-time MIDI Support
MIDI input
MIDI Message Output
Generic Input and Output
Converters
Event Extenders
Note-on/Note-off Output
MIDI/Score Interoperability opcodes
System Realtime Messages
Slider Banks
Spectral Processing
Short-time Fourier Transform (STFT) Resynthesis
Linear Predictive Coding (LPC) Resynthesis
Non-standard Spectral Processing
Tools for Real-time Spectral Processing (pvs opcodes)
ATS Spectral Processing
Loris Opcodes
Strings
String Manipulation Opcodes
String Conversion Opcodes
Vectorial Opcodes
Tables of vectors operators
Operations Between a Vectorial and a Scalar Signal
Operations Between two Vectorial Signals
Vectorial Envelope Generators
Limiting and wrapping of vectorial control signals
Vectorial Control-rate Delay Paths
Vectorial Random Signal Generators
Zak Patch System
Plugin Hosting
DSSI and LADSPA for Csound
VST for Csound
OSC and Network
OSC
Network

Mixer Opcodes
Python Opcodes
Introduction
Orchestra Syntax

III. Reference
Orchestra Opcodes and Operators
!=
#define
#include
#undef
#ifdef
#ifndef
$NAME
%
&&
>
>=
<
<=
*
+
-
/
=
==
^
round
||
0dbfs
&
|
¬
#
A
a
abetarand
abexprnd
abs
acauchy
active
adsr
adsyn
adsynt
adsynt2
aexprand
aftouch
agauss
agogobel
alinrand
alpass
ampdb
ampdbfs
ampmidi
apcauchy
apoisson
apow
areson
aresonk
atone
atonek
atonex
atrirand
ATSadd
ATSaddnz
ATSbufread
ATScross
ATSinfo
ATSinterpread
ATSread
ATSreadnz
ATSpartialtap
ATSsinnoi
aunirand
aweibull
B
babo
balance
bamboo
barmodel
bbcutm
bbcuts
betarand
bexprnd
bformenc
bformdec
binit
biquad
biquada
birnd
bqrez
butbp
butbr
buthp
butlp
butterbp
butterbr
butterhp
butterlp
button
buzz
C
cabasa
cauchy
ceil
cent
cggoto
chanctrl
changed
chani
chano
checkbox
chn
chnclear
chnexport
chnget
chnmix
chnparams
chnset
cigoto
ckgoto
clear
clfilt
clip
clock
clockoff
clockon
cngoto
comb
compress
control
convle
convolve
cos
cosh
cosinv
cps2pch
cpsmidi
cpsmidib
cpsoct
cpspch
cpstmid
cpstun
cpstuni
cpsxpch
cpuprc
cross2
crunch
ctrl14
ctrl21
ctrl7
ctrlinit
cuserrnd
D
dam
db
dbamp
dbfsamp
dcblock
dconv
delay
delay1
delayk
delayr
delayw
deltap
deltap3
deltapi
deltapn
deltapx
deltapxw
denorm
diff
diskin
diskin2
dispfft
display
distort
distort1
divz
downsamp
dripwater
dssiactivate
dssiaudio
dssictls
dssiinit
dssilist
dumpk
dumpk2
dumpk3
dumpk4
duserrnd
E
else
elseif
endif
endin
endop
envlpx
envlpxr
event
event_i
exitnow
exp
expcurve
expon
exprand
expseg
expsega
expsegr
F
ficlose
filelen
filenchnls
filepeak
filesr
filter2
fin
fini
fink
fiopen
flanger
flashtxt
FLbox
FLbutBank
FLbutton
FLcolor
FLcolor2
FLcount
FLgetsnap
FLgroup
FLgroupEnd
FLgroupEnd
FLhide
FLjoy
FLkeyb
FLknob
FLlabel
FLloadsnap
flooper
flooper2
floor
FLpack
FLpackEnd
FLpack_end
FLpanel
FLpanelEnd
FLpanel_end
FLprintk
FLprintk2
FLroller
FLrun
FLsavesnap
FLscroll
FLscrollEnd
FLscroll_end
FLsetAlign
FLsetBox
FLsetColor
FLsetColor2
FLsetFont
FLsetPosition
FLsetSize
FLsetsnap
FLsetText
FLsetTextColor
FLsetTextSize
FLsetTextType
FLsetVal_i
FLsetVal
FLshow
FLslidBnk
FLslider
FLtabs
FLtabsEnd
FLtabs_end
FLtext
FLupdate
fluidAllOut
fluidCCi
fluidCCk
fluidControl
fluidEngine
fluidLoad
fluidNote
fluidOut
fluidProgramSelect
FLvalue
fmb3
fmbell
fmmetal
fmpercfl
fmrhode
fmvoice
fmwurlie
fof
fof2
fofilter
fog
fold
follow
follow2
foscil
foscili
fout
fouti
foutir
foutk
fprintks
fprints
frac
freeverb
ftchnls
ftconv
ftfree
ftgen
ftgentmp
ftlen
ftload
ftloadk
ftlptim
ftmorf
ftsave
ftsavek
ftsr
G
gain
gainslider
gauss
gbuzz
getcfg
gogobel
goto
grain
grain2
grain3
granule
guiro
H
harmon
harmon2
hilbert
hrtfer
hsboscil
I
i
ibetarand
ibexprnd
icauchy
ictrl14
ictrl21
ictrl7
iexprand
if
igauss
igoto
ihold
ilinrand
imidic14
imidic21
imidic7
in
in32
inch
inh
init
initc14
initc21
initc7
ino
inq
ins
instimek
instimes
instr
int
integ
interp
invalue
inx
inz
ioff
ion
iondur
iondur2
ioutat
ioutc
ioutc14
ioutpat
ioutpb
ioutpc
ipcauchy
ipoisson
ipow
is16b14
is32b14
islider16
islider32
islider64
islider8
itablecopy
itablegpw
itablemix
itablew
itrirand
iunirand
iweibull
J
jitter
jitter2
jspline
K
k
kbetarand
kbexprnd
kcauchy
kdump
kdump2
kdump3
kdump4
kexprand
kfilter2
kgauss
kgoto
klinrand
kon
koutat
koutc
koutc14
koutpat
koutpb
koutpc
kpcauchy
kpoisson
kpow
kr
kread
kread2
kread3
kread4
ksmps
ktableseg
ktrirand
kunirand
kweibull
L
lfo
limit
line
linen
linenr
lineto
linrand
linseg
linsegr
locsend
locsig
log
log10
logbtwo
logcurve
loop_ge
loop_gt
loop_le
loop_lt
loopseg
loopsegp
lorenz
lorisread
lorismorph
lorisplay
loscil
loscil3
loscilx
lowpass2
lowres
lowresx
lpf18
lpfreson
lphasor
lpinterp
lposcil
lposcil3
lpread
lpreson
lpshold
lpsholdp
lpslot
M
mac
maca
madsr
mandel
mandol
marimba
massign
max
maxabs
maxabsaccum
maxaccum
maxalloc
max_k
mclock
mdelay
metro
midic14
midic21
midic7
midichannelaftertouch
midichn
midicontrolchange
midictrl
mididefault
midiin
midinoteoff
midinoteoncps
midinoteonkey
midinoteonoct
midinoteonpch
midion
midion2
midiout
midipitchbend
midipolyaftertouch
midiprogramchange
miditempo
min
minabs
minabsaccum
minaccum
mirror
MixerSetLevel
MixerGetLevel
MixerSend
MixerReceive
MixerClear
mode
monitor
moog
moogladder
moogvcf
moogvcf2
moscil
mpulse
mrtmsg
multitap
mute
mxadsr
N
nchnls
nestedap
nlfilt
noise
noteoff
noteon
noteondur
noteondur2
notnum
nreverb
nrpn
nsamp
nstrnum
ntrpol
O
octave
octcps
octmidi
octmidib
octpch
opcode
OSCsend
OSCinit
OSClisten
oscbnk
oscil
oscil1
oscil1i
oscil3
oscili
oscilikt
osciliktp
oscilikts
osciln
oscils
oscilx
out
out32
outc
outch
outh
outiat
outic
outic14
outipat
outipb
outipc
outkat
outkc
outkc14
outkpat
outkpb
outkpc
outo
outq
outq1
outq2
outq3
outq4
outs
outs1
outs2
outvalue
outx
outz
P
p
pan
pareq
partials
pcauchy
pchbend
pchmidi
pchmidib
pchoct
pconvolve
peak
peakk
pgmassign
phaser1
phaser2
phasor
phasorbnk
pinkish
pitch
pitchamdf
planet
pluck
poisson
polyaft
pop
pop_f
port
portk
poscil
poscil3
pow
powoftwo
prealloc
print
printf
printk
printk2
printks
prints
product
pset
puts
push
push_f
pvadd
pvbufread
pvcross
pvinterp
pvoc
pvread
pvsadsyn
pvsanal
pvsarp
pvscross
pvscent
pvsdemix
pvsfread
pvsfreeze
pvsftr
pvsftw
pvsifd
pvsinfo
pvsinit
pvsin
pvsout
pvsbin
pvsdisp
pvspitch
pvsosc
pvsfwrite
pvsmaska
pvsynth
pvscale
pvshift
pvsmix
pvsmooth
pvsfilter
pvsblur
pvstencil
pvsvoc
pyassign Opcodes
pycall Opcodes
pyeval Opcodes
pyexec Opcodes
pyinit Opcodes
pyrun Opcodes
R
rand
randh
randi
random
randomh
randomi
rbjeq
readclock
readk
readk2
readk3
readk4
reinit
release
remove
repluck
reson
resonk
resonr
resonx
resonxk
resony
resonz
resyn
reverb
reverb2
reverbsc
rezzy
rigoto
rireturn
rms
rnd
rnd31
rspline
rtclock
S
s16b14
s32b14
scale
samphold
sandpaper
scanhammer
scans
scantable
scanu
schedkwhen
schedkwhennamed
schedule
schedwhen
seed
sekere
semitone
sense
sensekey
seqtime
seqtime2
setctrl
setksmps
sfilist
sfinstr
sfinstr3
sfinstr3m
sfinstrm
sfload
sfpassign
sfplay
sfplay3
sfplay3m
sfplaym
sfplist
sfpreset
shaker
sin
sinh
sininv
sinsyn
sleighbells
slider16
slider16f
slider32
slider32f
slider64
slider64f
slider8
slider8f
sndload
sndloop
sndwarp
sndwarpst
socksend
sockrecv
soundin
soundout
soundouts
space
spat3d
spat3di
spat3dt
spdist
specaddm
specdiff
specdisp
specfilt
spechist
specptrk
specscal
specsum
spectrum
splitrig
spsend
sprintf
sqrt
sr
stack
statevar
stix
strchar
strchark
strcpy
strcpyk
strcat
strcatk
strcmp
strcmpk
streson
strget
strindex
strindexk
strlen
strlenk
strlower
strlowerk
strrindex
strrindexk
strset
strsub
strsubk
strtod
strtodk
strtol
strtolk
strupper
strupperk
subinstr
subinstrinit
sum
svfilter
syncgrain
syncloop
T
timedseq
tb
tab
tabrec
table
table3
tablecopy
tablegpw
tablei
tableicopy
tableigpw
tableikt
tableimix
tableiw
tablekt
tablemix
tableng
tablera
tableseg
tablew
tablewa
tablewkt
tablexkt
tablexseg
tabplay
tambourine
tan
tanh
taninv
taninv2
tbvcf
tempest
tempo
tempoval
tigoto
timeinstk
timeinsts
timek
times
timout
tival
tlineto
tone
tonek
tonex
tradsyn
transeg
trcross
trfilter
trhighest
trigger
trigseq
trirand
trlowest
trmix
trscale
trshift
trsplit
turnoff
turnoff2
turnon
U
unirand
upsamp
urd
V
vadd
vadd_i
vaddv
vaddv_i
vaget
valpass
vaset
vbap16
vbap16move
vbap4
vbap4move
vbap8
vbap8move
vbaplsinit
vbapz
vbapzmove
vcella
vco
vco2
vco2ft
vco2ift
vco2init
vcomb
vcopy
vcopy_i
vdelay
vdelay3
vdelayx
vdelayxq
vdelayxs
vdelayxw
vdelayxwq
vdelayxws
vdivv
vdivv_i
vdelayk
vecdelay
veloc
vexp
vexp_i
vexpseg
vexpv
vexpv_i
vibes
vibr
vibrato
vincr
vlimit
vlinseg
vlowres
vmap
vmirror
vmult
vmult_i
vmultv
vmultv_i
voice
vport
vpow
vpow_i
vpowv
vpowv_i
vpvoc
vrandh
vrandi
vstaudio, vstaudiog
vstbankload
vstedit
vstinit
vstinfo
vstmidiout
vstnote
vstparamset,vstparamget
vstprogset
vsubv
vsubv_i
vtablei
vtablek
vtablea
vtablewi
vtablewk
vtablewa
vtabi
vtabk
vtaba
vtabwi
vtabwk
vtabwa
vwrap
W
waveset
weibull
wgbow
wgbowedbar
wgbrass
wgclar
wgflute
wgpluck
wgpluck2
wguide1
wguide2
wrap
wterrain
X
xadsr
xin
xout
xscanmap
xscansmap
xscans
xscanu
xtratim
xyin
Z
zacl
zakinit
zamod
zar
zarg
zaw
zawm
zfilter2
zir
ziw
ziwm
zkcl
zkmod
zkr
zkw
zkwm
Score Statements and GEN Routines
Score Statements
GEN Routines
The Utility Programs
Directories.
Soundfile Formats.
Analysis File Generation (ATSA, CVANAL, HETRO, LPANAL, PVANAL)
File Queries (SNDINFO)
File Conversion (DNOISE, HET_IMPORT, HET_EXPORT, PVLOOK, PV_EXPORT, PV_IMPORT, SDIF2AD, SRCONV)
Other Csound Utilities (CS, ENVEXT, EXTRACTOR, MAKECSD, MIXER, SCALE)
Cscore
Events, Lists, and Operations
Writing a Main Program
More Advanced Examples
Compiling a Cscore Program
Extending Csound
Adding Unit Generators
Creating a Builtin Unit Generator
Adding a Plugin Unit Generator
OENTRY Reference
A. Pitch Conversion
B. Sound Intensity Values
C. Formant Values
D. Window Functions
E. SoundFont2 File Format
F. Csound64
G. Quick Reference

Glossary