Wherein we present Stk's PitShift Node to shift the pitch of audio signals.
Right-click to copy examples to your workspace
PitShift is a built-in UGen that was derived from the original Synthesis Toolkit and documented here. It describes itself as a simple pitch shifter effect implemented using delay lines. More technical details on this approach may be found here.
Here's the graph for our example, pitshift.chg
. For graph cleaniless, be
aware that you can hide the PitShift
and ShiftGen
nodes inside
Chan0
as part of its effects chain. For didactic reasons,
we leave these nodes exposed.
The PitShift node is quite simple to operate. There are two primary controls.
Mix
combines the shifted and non-shifted signals. At 1.0 you'll get pure
pitch shift and at 0, pure original signal. In this example we mix a small
amount of the original signal with the shifted result. This is what provides
the "harmonious" result.
Shift
represents the shift amount. The value is logarithmic.
Values in [0, 1] represent a downward shift. Values above 1 shift the
pitch upward.
ShiftInterval
is an alternate means to control the shift parameter.
Values in [-12, 12] represent semitones above or below the no-shift point.
A value of 7 represents a major 5th upward shift and a value of -5 represents
a major 4th downward shift.
In this example, rather than mung
the Shift
parameter manually we generate a value using the CCGenerator
node. Our goal is to slowly vary the Shift over a "reasonable" range. Here are
the settings we chose:
Generator
is set to Sine
because it smoothely and predictablly moves from
a minimum to a maximum.
Oversample
was selected manually to deliver a pleasant Shift-rate
frequency. This value is coupled to the Rate
parameter below.
This value can produce very amusing results.
CC Name
is set toe Shift
because that's the paramter in PitShift
that
we wish to automate.
OutputMin/Max
contains the range of outputs for our sinusoidal signal.
Rate
was set to 10::ms
which means we update the Shift
value 100 times
each second.