Specifications

3.2 Working with time and events 23
the currently stored value with a new float and immediately output that. This
gives us a way to both set and query the object contents.
Int objects
Although we have noted that integers don’t really exist in Pd, not in a way that
a prog rammer would understa nd, whole numbers certainly do.
int
stores a float
as if it were an integer in that it provides a rounding (truncation) function of
any extra decimal places. Thus 1.6789 becomes 1.0000, equa l to 1, when passed
to
int
.
Symbol and list objects
As for numbers there are likewise object b oxes to store lists and symbols in a
temporary loca tion. Both work just like their numerical counterparts. A list
can be given to the right inlet of
list
and recalled by banging the left inlet.
Similarly
symbol
can s tore a single symbol until it is needed.
Merging message connections
When several message connections are all connected to the same inlet that’s
fine. The object will pr ocess each of them as they a rrive, though it’s up to you
to ensur e that they arrive in the right order to do what you expect. Be aware
of r ace ha z ards when the sequence is important.
11
10
f
11 12
fig 3.5: Messages to
same inlet
Messages arriving from different sources at the same hot
inlet have no effect on each another, they remain separate
and are simply interleaved in the order they arrive, each
producing output. But be mindful that where several
connections are made to a cold inlet only the last one
to arrive will be relevant. Each of the number boxes in
Fig. 3.5 connects to the same cold inlet of the float box
f
and a bang button to the hot inlet. Whenever the bang button is pressed
the output will be whatever is currently stored in
f
, which will b e the last
number box changed. Which number box was updated last in Fig. 3.5? It was
the middle one with a value o f 11.
SECTION 3.2
Working with time and events
With our simple knowledge of objects we can now begin making patches that
work on functions of time, the ba sis of all sound and music.
Metronome
Perhaps the most important primitive operatio n is to get a beat or timebase.
To get a regular series of bang events
metro
provides a clock. Tempo is g iven
as a period in milliseconds rather than beats per minute (as is usual with most
music programs).