Specifications

60 Shaping sound
a squar e wave, limited to between 1.0 and 1.0 a nd crossing suddenly ha lfway
through. This method produces a waveform that isn’t band-limited, so when
used in synthesis you should keep it to a fairly low frequency range to avoid
aliasing.
A triangle wave move s up in a linear fashion just like a phasor, but when it
reaches the peak it changes direction and returns to its lowest value at the same
rate instead of jumping instantly back to zero. It is a little more complicated
to understand than the square wave. We can make a signal travel more or less
in a given time interval by multiplying it by a constant amount. If a signal is
multiplied by 2.0 it will travel twice as far in the same time as it did before, so
multiplication affects the slope of signals. Also, as we have just seen, multiplying
a signal by 1.0 inverts it. That’s another way of saying it revers e s the slope,
so the waveform now moves in the opposite directio n. One way of making a
triangle wave employs these two principles.
-~ 0.5
+~
*~ -2
-~ 0.25
phasor~ 1290
*~ 4
clip~ -0.5 0
pd grapha
A
pd grapha
D
s~ D
s~ A
s~ B
s~ C
pd grapha
C
pd grapha
B
fig 6.8: Triangle
Starting with a phasor (graph A) at the top of Fig. 6.8, and shifting it down
by 0.5 (graph B), the first half of it, from 0.0 to 0.5 is doing what we want. If
we take half and isolate it with
clip~
we can then multiply by 1.0 to change
the slope, and by 2.0 to double the amplitude, which is the same as multiplying
by 2.0. During the first half of the so urce phasor, between 0.5 and 1.0 the
right branch produces a falling waveform (graph C). When we add that back
to the other half, which is shifted down by 0.5 the sum is a triangle wave once
normalised (graph D) .
An alternative formula for a triangle wave, which may be slightly easier to
understand, uses
min~
and is shown in Fig. 6.9. Starting with a phasor again,
(graph A) and adding one to the inverse produces a negative moving phasor
with the s ame sign but opposite phase (graph B). Taking the minima of these
two signals gives us a triangle wave, positive with amplitude 0.5 (graph C).
This is re-centered and normalised (graph D).