Tools for Sound Processing
145
orchestra
p-fields
score
audio-rate
control-rate
block-oriented computation
sample-oriented
computation
frame
frame rate
initialization
Csound, and realizations in CLM and SAOL are presented for comparison.
B.2.1
Unit generator
The UGs are primitive modules that produce, modify, or acquire audio or con-
trol signals. For audio signal production, particularly important primitives are
those that read tables (table) and run an oscillator (oscil), while for producing
control signals the envelope generators (line) are important. For sound modi-
fication, there are UGs for digital filters (reson) and time-domain processing,
such as delays (delay). For sound acquisition, there are special UGs (soundin).
According to the Music-V tradition, several UGs can be connected to form
complex instruments. The connections are realized by means of variables. In
Csound the instruments are collected in a file called orchestra. The instrument
parameters can be initialized by arguments passed at invocation time, called
p-fields. Invocations of events on single instruments are considered to be notes,
and they are collected in a second file, called score. The dichotomy between
orchestra and score, as well as the subdivision of the orchestra into autonomous
non-interacting entities called instruments, are design choices derived from a
rather traditional view of music composition. We have already mentioned how
certain kinds of operation with synthesis instruments do not fit well in this view.
The way the control and communication variables are handled in instruments
made of several UGs is another crucial aspect to understand the effectiveness
of a computer-music language. In Csound, variables are classified as: audio-rate
variables and control-rate variables. The former can vary at audio rate, the latter
are usually band-limited to a lower rate. In this way it is possible to update the
control variables at a lower rate, thus saving some computations. Following
the treatment of Roads [78], such run-time organization is called block-oriented
computation, as opposed to sample-oriented computation. This is not to say
that block-oriented computation are vectorized, or intrinsically parallel on data
blocks, but rather that control variables are not loaded in the machine registers
at each audio cycle.
The split of variables between audio rate and control rate does not offer any
semantic benefit for the composer, but it is only a way to reach higher compu-
tation speeds. Vice versa, sometimes the sound designer is forced to choose a
control rate equal to the audio rate in order to avoid some artifacts. Namely,
this occurs in computational structures with delayed feedback loops
other hand, vectorized computations are an alternative way to arrange the op-
erations, that in many cases can lead to compact and efficient code, as it was
shown in the smoothing example of section B.1.
In the languages that we are considering there are UGs for time-frequency
processing that operate on a frame basis. Typically, the operations on a single
frame can be vectorized and we can have block-oriented computations when the
control rate coincides with the frame rate.
Csound also presents a third family of variables, the initialization variables,
whose value is computed only when a note starts in the score. In order to
partially overcome the problems of articulation between different notes, Csound
9
Consider the case, pointed out to my attention by Gianantonio Patella, of a CSound
instrument with a feedback delay line. Since the UG delay is iterated seamlessly for a number
of times equal to the ratio between sample rate and control rate, the effective length of the
delay turns out to be extended by such number of samples.