Specifications

58 Shaping sound
unless you need irrational numbers with high accura c y. This habit highlights
the importance of the function and makes your patches easier to understand.
Arithmetic opera tions are used to scale, shift and invert signals as the following
examples illustrate.
s~ A
osc~ 640
*~ 0.5
s~ B
pd grapha
B
pd grapha
A
fig 6.1: Scaling a signal
A signal is sca led simply by multiplying it by
a fixe d amount, which changes the differe nce
between the lowest and highest values and
thus the peak to peak amplitude. This is seen
in Fig. 6.1 where the signal from the oscillator
is halved in amplitude.
s~ A
osc~ 640
*~ 0.5
s~ B
pd grapha
B
pd grapha
A
+~ 0.5
fig 6.2: Shifting a signal
Shifting involves moving a signal up or down
in level by a constant. This affects the abso-
lute amplitude in one direction only, so it is
possible to distort a signal by pushing it out-
side the limits of the system, but it does not
affect its peak to peak amplitude or appar-
ent loudness since we cannot hear a constant
(DC) offset. Shifting is normally used to place signals into the correct range
for a s ubse quent operation, or, if the r esult of an operation yields a signal that
isn’t c e ntered prope rly to correct it, so it swings about zero again. In Fig. 6.2
the cosine signal is shifted upwards by adding 0.5.
s~ A
osc~ 640
s~ B
*~ -1
pd grapha
B
pd grapha
A
fig 6.3: Inverting a signal
In Fig. 6.3 a signal is inverted, reflecting it
around the zero line, by multiplying by −1.0.
It still crosses zero at the same places but its
direction and magnitude is the opposite ev-
erywhere. Inverting a signal changes its phase
by π, 180
◦
or 0.5 in rotation normalised form,
but that has no e ffect on how it sounds since
we cannot hear a bsolute phase.
s~ A
s~ B
-~
sig~ 1
phasor~ 640
pd grapha
B
pd grapha
A
fig 6.4: Signal complement
The complement of a signal a in the range
0.0 to 1.0 is defined a s 1 −a . As the phasor
in Fig. 6.4 moves upwards the complement
moves downwards mirroring its move ment.
This is different from the inverse, it has the
same direction a s the inverse but retains
the sign and is only defined for the positive
range between 0.0 and 1.0. It is used frequently to obtain a control signal for
amplitude or filter cutoff that moves in the opposite direction to another control
signal.