Specifications

2.3 Message data and GUI boxes 15
one. A bevelled top rig ht corner like this
0
denotes that this object is a
number box. Numbers received on the inlet are displayed and passed dir ec tly to
the outlet. To input a number click and hold the mouse over the value field and
move the mouse up or down. You ca n also type in numbers. Click on a number
box, type the number and hit RETURN. Number boxes are a compact replacement
for faders. By default it will display up to five digits including a sig n if negative,
-9999 to 99999, but you can change this by editing its properties. Holding SHIFT
while moving the mouse allows a ner degree of control. It is also possible to
set an upper and lower limit from the properties dialog.
Toggle box
Another object that works with floats is a toggle box. Like a checkbox on any
standard GUI or web form, this has only two states, on or off. When clicked
a cross appears in the box like
and it sends out a number 1, clicking again
causes it to send out a number 0 and removes the cross so it looks like this
.
It also has an inlet which sets the value, so it can be used to display a binary
state. Sending a bang to the inlet o f a toggle box does not cause the current
value to be output, instead it flips the toggle to the opposite state and outputs
this value. Editing properties also allows you to send numbers other than 1
for the active state.
Sliders and other numerical GUI elements
GUI elements for ho rizontal and vertical sliders can be used as input and display
elements. Their default range is 0 to 127, nice for MIDI controllers, but like
all other GUI objects this can be changed in their properties window. Unlike
those found in some other GUI systems, Pd sliders do not have a step value.
Shown in Fig . 2.10 are some GUI objects at their standard sizes. They can be
<-99
-50
-30
-20
-12
-6
-2
-0dB
+2
+6
>+12
B
A
C
D
E
fig 2.10: GUI Objects A: Horizontal slider B: Horizontal radio box C: Vertical radio box D:
Vertical slider E: VU meter
ornamented with labels or created in any colour. Resizing the slider to make it
bigger will increase the step resolution. A ra dio box provides a set of mutually
exclusive buttons which output a number starting at zero. Again, they work
equally well as indicators or input elements. A better way to visually display
an audio level is to use a VU meter. This is set up to indicate decibels, so has a
rather strange scale from 99.0 to +12.0. Audio signals that range from 1.0