Specifications

57
CHAPTER 6
Shaping sound
The signal generators we’ve seen so far are the phasor, cosinusoidal oscillator,
and noise source. While these alone seem limited they may be combined using
shaping oper ations to produce a great many new signals. We are going to make
transformations on waveforms, pushing them a little this way or that, moulding
them into new things. This subject is dealt with in two sections, amplitude
dependent shaping where the output depends only on current input values, and
time dependent signal shaping where the output is a function of current and
past signal values .
SECTION 6.1
Amplitude dependent signal shaping
Simple signal arithmetic
Arithmetic is at the foundation of signal processing. Examine many patches
and you will find, on average, the mos t common object is the humble multiply,
followed closely by addition. Just as all mathematics builds on a few simple
arithmetic axioms complex DSP ope rations can be reduced to adds and mul-
tiplies. While it’s rarely of practical use, it’s worth noting that multiplication
can be seen as repeated addition, so to multiply a signal by two we can connect
it to both inlets of
+~
and it will be added to itself, which is the same as mul-
tiplying by two. The opposite of addition is subtractio n. If you are s ubtr acting
a constant value from a signa l it’s okay to use
+~
but ex press the subtracted
amount as a negative number, as with
+~ -0.5
, though of cour se there is a
-~
unit too. Addition and multiplication a re commutative (symmetrical) opera-
tors, so it doesn’t matter which way round you connect two signals to a unit.
On the other hand, subtraction and division have ordered arguments, the right
value is subtracted from, or is the divisor of, the left one. It is common to divide
by a constant and so
*~
is generally used with an argument that’s the reciprocal
of the required divisor. For example, instea d of dividing by two, multiply by
half. There are two reasons for this. Firstly, divides were traditionally more
expensive so many programmers are entrenched in the habit of avo iding divides
where a multiply will do. Secondly, an accidental divide by zero traditionally
causes problems, even crashing the program. Neither of these things are actually
true of Pd running on a modern processor, but because of such legacies you’ll
find many a lgorithms written accordingly. Reserve divides for when you need
to divide by a va riable signal and multiply by decimal fractions everywhere else