Specifications

5.6 Common abstraction techniques 53
my-tabosc2 640 0 my-tabosc2 1280 1 my-tabosc2 1920 0
pd grapha
B
pd grapha
C
pd grapha
A
fig 5.11: Three different wavefor ms and frequencies from the same table oscillator abstraction
SECTION 5.6
Common abstraction techniques
Here are a few tricks r e gularly used with abstrac tions and subpatches. With
these you can create neat a nd tidy patches and manage large projects made of
reusable ge neral components.
Graph On Parent
It’s easy to build nice looking interfaces in Pd using GUI components like sliders
and buttons. As a rule it is best to collect all interfa c e components for an
application together in one place and send the values to where they are needed
deeper within subpatches. At some point it’s necessary to expose the interface
to the user, so that when an object is created it a ppea rs with a selection of GUI
components laid out in a nea t way.
Clobber
Ooomph
Knarleyness
pd hardsynth
inlet midi note
fig 5.12: Graph on parent synth
“Graph on Parent” (or GOP) is a proper ty of
the canvas which lets you see inside from out-
side the object box. Normal objects like os-
cillators are not visible, but GUI components,
including graphs are. GOP abstractions can be
nested, so that controls exposed in one abstrac-
tion are visible in a hig her abstraction if it is
also set to be GOP. In Fig. 5.12 we see a subpatch which is a MIDI synthesiser
with three controls. We have added three slider s and connected them to the
synth. Now we want to make this abstraction, called GOP-hardsynth, into a
GOP abstraction that reveals the controls. Click anywhere on a blank part of
the canvas, choose properties and activa te the GOP toggle button. A frame
will appear in the middle of the canvas. In the canvas properties box, set the
size to width = 140 and height = 80, which will nicely frame thre e standard size
sliders with a little border. Move the sliders into the frame, save the abstraction
and exit.