2.1. ELEMENTARY CSOUND FUNCTIONS
ESSENTIAL SCORE STATEMENTS FOR THE SCORE FILE
f Statement (Function Table Generator)
The f statement generates wavetables and lookup arrays used by oscillators and envelopes:
p1: Table number (positive integer).p2: Time at which the table is generated (usually 0).p3: Table size (must be a power of two, or power of two plus one, e.g. 512, 1024, 4096).p4: GEN routine number (the algorithm used to fill the table).p5...pn: Arguments specific to the chosen GEN routine.
Common GEN routines include:
GEN10: Sum of sinusoids for harmonic additive synthesis.GEN07: Piecewise linear breakpoint envelopes.GEN05: Exponential curve segments.GEN01: Reads an external audio file into memory.
i Statement (Instrument Note Activation)
The i statement triggers note performance:
p1: Instrument number to invoke.p2: Action start time in beats or seconds.p3: Duration of note performance.p4...pn: User-defined parameters (amplitude, pitch, spatial angle, filters).
t Statement (Tempo Control)
Defines the performance tempo in beats per minute across specified time points.
s Statement (Section Separator)
Marks the end of a musical movement or section, sorting and resetting preceding events.
ESSENTIAL ORCHESTRA OPCODES
Arithmetic & Mathematical Operations
+,-,*,/: Basic arithmetic operators.sqrt(x): Square root.log(x)/log10(x): Natural and base-10 logarithms.exp(x): Exponential function.abs(x): Absolute value.int(x)/frac(x): Integer and fractional parts.
Trigonometric Functions
sin(x),cos(x),tan(x): Trigonometric ratios (angles in radians).asin(x),acos(x),atan(x),atan2(y, x): Inverse trigonometric functions.
Signal Generators and Oscillators
oscil: Classic wavetable oscillator reading from anftable.poscil: High-precision floating-point interpolated oscillator.rand/pinkish: Uniform and 1/f noise generators.linen/linseg: Linear envelope generators.expseg: Exponential envelope generator.