Specifications

12 Starting with Pure Data
create an object which always adds 3 to its input. Uninitialised values generally
resort to zero so the default behaviour of
+
would be to add 0 to its input,
which is the same as doing nothing. C ontrast this to the default behaviour of
*
which always gives zero.
Modifying object s
You can also change the contents of any object box to alter the name a nd
function, or to a dd parameters.
* 5
+ 3
fig 2.8: Chang-
ing objects
In Fig. 2.8 the objects have been changed to give them initial
parameters. The multiply object is given a parameter of 5,
which means it multiplies its input by 5 no matter what comes
in. If the input is 4 then the output will be 20. To change the
contents of an object click on the middle of the box where the
name is and type the new text. Alternatively click once, and
then again at the end of the text to append new stuff, such
as adding 5 and 3 to the o bjects shown in Fig. 2.8
Number input and output
10
53
* 5
+ 3
fig 2.9: Number
boxes
One of the easiest ways to create and view numerical data
is to use number boxes. These can a ct as input devices to
generate numbers, or as displays to show you the data on a
wire. Create one by choosing PutNumber from the canvas
menu, or use CTRL+3, a nd place it above the
*
object. Wire
it to the left inlet. Place another below the
+
object and
wire the object outlet to the top of the number box as shown
in Fig. 2.9.
Toggling edit mode
Pressing CTRL+E on the keyboard will also enter edit mode. This key combina-
tion toggles modes, so hitting CTRL+E again exits edit mode. Exit edit mode
now by hitting CTRL+E or selecting EditEdit mode from the ca nva s menu.
The mouse cursor will change and you will no longer be able to move or modify
object boxes. However, in this mode you can operate the patch components
such as buttons and sliders normally. Place the mouse in the top number box,
click and hold and move it upwards. This input number va lue will change, and
it will send messages to the objects be low it. You will see the second number
box change too as the patch computes the e quation y = 5x + 3. To re-enter edit
mode hit CTRL+E again or place a new object.
More edit operations
Other familiar editing operations are available while in edit mode. You can cut
or copy objects to a buffer or paste them back into the canvas, or to ano ther
canvas opened with the same instance of P d. Take care with pasting objects
in the buffer because they will appear directly on top of the last object copied.
To select a group of objects you can drag a box ar ound them with the mouse.