Control Rate and Audio Rate
Like many other audio programming environments, PD makes a difference between control signals and audio signals. They run at different rates and can not be combined, unless converted. Audio operations require the DSP to be activated, whereas control rate signal work at any time. Objects define whether an outlet gets or outputs control or audio rate signals. Objects with audio inputs or outputs are usually named with a ~
. Control rate connections are thinner than audio rate signals.
The example rates.pd simply shows
an audio and a control rate connection, with audio connections being thicker:
The example also introduces the osc~
oject, which generates a sine wave at 1234 Hz
.
The message on the bottom of the patch is a patch-based way of activating the DSP, which can be very
helpful when working with automated and background processes.
Audio to Control
Converting audio signals to control rate signals can be achieved with the snapshot~
object,
as done in the example audio-to-control.pd. A possible application is an envelope follower.
This object needs to be triggered to grab a snapshot, which is done with a metro
object at 100 Hz in this example.
The output is a level indicator for the LFO at 0.1 Hz:
Control to Audio
Usually, control signals can be connected to audio inlets.
The conversion shown in the example audio-to-control.pd is thus less frequent.
However, in some cases it might be necessary to convert control signals to audio rate. This is done with the sig~
object: