Skip to content

Pure Data Keyword Reference

A reference for objects and commands used in Pd patches.

Basic Operations

OperationShortcut
Place an objectCmd (Ctrl) + 1
Place a messageCmd (Ctrl) + 2
Place a number boxCmd (Ctrl) + 3
Place a symbol boxCmd (Ctrl) + 4
Place a commentCmd (Ctrl) + 5
Toggle edit/run modeCmd (Ctrl) + E
Zoom inCmd (Ctrl) + Shift + ;
Temporary run modeHold Cmd (Ctrl)
Help browserCmd (Ctrl) + B
Place a bangShift + Cmd (Ctrl) + B
Place a toggleShift + Cmd (Ctrl) + T
Place a horizontal sliderShift + Cmd (Ctrl) + J
Place an arrayCmd + Shift + A
Delete an objectSelect → Backspace
Object help (usage)Right-click an object → Help
List of all objectsRight-click empty canvas → Help

Basic Concepts

TermMeaning
PatchA Pd program file
InletThe data input on the top of an object
OutletThe data output on the bottom of an object. Connecting an outlet to an inlet lets data flow between objects
ValueA number or string. Drawn as a thin line between inlet and outlet
SignalContinuous data such as audio signals. Drawn as a thick line between inlet and outlet
MessagePre-written strings or numbers. Including $1 in a message replaces it with the value received from the inlet
Number boxA GUI that displays and inputs numbers in real time
Symbol boxA GUI that displays a string
ArrayA place to store data such as audio
DSPReal-time signal processing. Starts when you enable the checkbox at the top-right of the console, or raise the audio output volume

Sound Generation

ObjectDescriptionUsage
osc~Sine wave oscillator[osc~ frequency]
phasor~Sawtooth wave[phasor~ frequency]
noise~White noise[noise~]
else/tri~Triangle wave (ELSE library)[else/tri~ frequency]
else/square~Square wave (ELSE library)[else/square~ frequency]

Audio I/O

ObjectDescriptionUsage
output~Audio outputSet volume with level value message
else/out~Audio output (with DSP on/off switch)ELSE library
dac~Digital-to-analog converter (audio output)[dac~ channel_numbers]
adc~Analog-to-digital converter (audio input)[adc~]

Volume & Envelopes

ObjectDescriptionUsage
*~Signal multiplication (used for volume control)signal x signal or number
line~Automatic value change (signal)[target_value time(ms)] message
vline~Continuous value change[value1 time1, value2 time2 start_time, ...]
delayOutput a bang after a delay[delay time(ms)]
else/asr~ASR envelopeELSE library
else/adsr~ADSR envelopeELSE library
else/envgen~Custom envelope generator[else/envgen~ -curve]

Arithmetic

ObjectDescriptionUsage
+, -, *, /Basic arithmetic (values)[+ number]
exprExpression evaluation[expr $f1 * 2 + $f2]
mtofMIDI note → frequency (Hz)Middle C = 60

Data Routing

ObjectDescriptionUsage
s (send)Send a value[s destination_name]
r (receive)Receive a value[r destination_name]
selRoute by matching values[sel value1 value2 ...] (the rightmost outlet passes through values that don't match)
routeRoute by first element[route address1 address2]
changeOutput only when the value changes[change]
t (trigger)Send values right-to-left[t f b] (f: float, b: bang, a: symbol)

Filters

ObjectDescriptionUsage
lop~Low-pass filter[lop~ cutoff_frequency]
hip~High-pass filter[hip~ cutoff_frequency]
bp~Band-pass filterCenter: cutoff, Right inlet: Q value

Filter Notes

  • Filters other than lop~ cannot accept vline~ output directly on their right inlet
  • Pay attention to the difference between value (thin) and signal (thick) lines

Delay

ObjectDescriptionUsage
delwrite~Write to a delay buffer[delwrite~ $0-delay buffer_size(ms)]
delread~Read from a delay buffer[delread~ $0-delay delay_time(ms)]
cyclone/delay~Delay (cyclone library)cyclone library

About $0

$0 is a unique ID number assigned to each Pd patch. Using it in buffer names like $0-delay prevents name collisions when duplicating patches.

Signal-Value Conversion

ObjectDescriptionUsage
sig~Value → signal conversion[sig~]
snapshot~Signal → value conversionOutputs the signal value when it receives a bang
metroPeriodic bang output[metro period(ms)]
else/s2f~Signal → value (automatic)Continuous output without needing bangs
else/f2s~Value → signalELSE library
else/numbox~Display signal valuesDisplay GUI

DSP Must Be On

Signal-related objects will not work unless DSP is turned on. Enable it via the checkbox in the top-right of the console, or raise the volume on output~.

Audio File Processing

ObjectDescriptionUsage
else/play.file~Audio file playback[else/play.file~ filename loop(0/1) autoplay(0/1)]. Control with start/stop/loop 1 messages
else/stretch.shift~Pitch shift / time stretch[else/stretch.shift~ buffer_size init_pitch init_tempo]. Pitch: 0=original, 1200=1 octave (3rd inlet); Tempo: 100=original (%) (4th inlet)
else/xselect~Crossfade selection[else/xselect~ num_channels fade_time(ms)]. Input a channel number (0, 1, 2…) to the left inlet to switch
else/xfade~CrossfadeELSE library
else/rec.file~Record to file[else/rec.file~ filename]. The file is saved in the same folder as the patch
soundfilerLoad WAV data into an arrayread filename array_name
tabplay~Play audio from an array[tabplay~ array_name]
.wavUncompressed audio file formatUsed for sample sounds, etc.

Automated Playback

ObjectDescriptionUsage
text defineDefine text data[text define -k filename]. Click it in run mode to edit and save the text (Cmd (Ctrl) + S)
text sequenceSequential text output (destination value;)[text sequence name -g], auto: automatic, bang: one step, line 0: go to start
else/drum.seqRhythm machine GUI; plays one step per bang[else/drum.seq rows columns]. Outputs value lists of the form [row_number on(1)/off(0)]
else/tempoBPM tempo output[else/tempo BPM -mul multiplier]
randomRandom integer output[random max_value]

micro:bit Integration (OSC)

ObjectDescriptionUsage
else/osc.receiveReceive OSC data[else/osc.receive port_number]
else/osc.routeRoute by OSC address[else/osc.route /address1 /address2]
netreceiveReceive data over the network[netreceive -u -b port_number] (-u: UDP, -b: binary)
oscparseParse data per the OSC protocolParses the output of netreceive; outputs an [address value] list
list trimStrip the leading selector from a listMakes the [address value] from oscparse usable by route, etc.
listBundle multiple values or symbols[list]
cyclone/scaleValue mapping[scale input_min input_max output_min output_max]
clipValue clipping[clip lower_limit upper_limit]
else/smooth~Smoothing (signal)ELSE library

GUI

ObjectDescriptionOperation
bangTrigger outputClick to send
toggle0/1 switchClick to toggle
Number boxNumeric display/inputDrag to change value
Horizontal sliderContinuous value inputRight-click → Properties to set upper/lower limits
V. RadioVertical radio button group. Clicking outputs the selected index (0 to number of buttons − 1). The number of buttons can be changed from Options on the right side of the screenPlace via Put > New > V. Radio. Change the number of buttons from Options while selected

Miscellaneous

ObjectDescriptionUsage
printPrint to consoleFor debugging
comportSerial communication[comport device_number baud_rate]
pd subpatch_nameSubpatchCreate a subpatch within a patch
clone patch_nameClone a patchGenerate multiple copies of the same patch

Useful Facts

Weber-Fechner Law

Human subjective perception of intensity is proportional to the logarithm of the physical stimulus. To make volume changes feel natural, raise the volume value to the 4th power.

Structure of Musical Tones

Instrument-like sounds consist of a fundamental frequency (the lowest tone) combined with harmonics at integer multiples. By combining multiple osc~ objects, you can create a variety of timbres (additive synthesis).