You are on page 1of 1

Interlude A - Programming w ith Max/MSP IA

a constant, and "bye" is a constant string. W hen given a number at the input,
the first two arguments ('i' and 'f') w ill convert it into an integer and a fl oati ng
point number (the integer wi ll be tru ncated, as we see where 3.33 becomes 3),
w hile th e other three arguments are changed into a bang, a constant number
5, and a constant string "bye". Note that to be able to display the st ring "bye "
wi t hin the message box, we have connected the t rigger o utlet to the right inlet
of the message box, not the lef t ! The left inlet is reserved for some comma nds
that we wi ll encounter later on in th is interlude.9
So t he trigger object, as you can see, does more than order messages: it can
also change the type of a message or transform it into a constant. This charac-
teristi c is very useful, for example, w hen we want to obta in a result when send-
ing a message to an operator's "co ld" inlet, as seen in f igure IA.46 .

Fig. IA.46 Another way to make a cold inlet hot

W ith this approach, every time t hat we update the float number box on th e right,
th e trigger f irst sends the numbe r on its right outlet, fol low ed by a bang on
its left out let wh ich fo rces t he + object t o perform its calculatio n . Try using t his
technique in t he "dru nk-betwe en" patcher in file IA_06_ random_wa lk.maxpat,
substituting trigger for the button , and verify that t he patch's f unction
doesn' t change.
In more complex patches, it is often difficu lt to set the order of execution
between elements based solely on the posit ions of the objects in their patcher.
In these cases, trigger is an invaluable object. Return, for example, to the
patch in fig ure IA.4, in Secti on IA 1, where the incorrectly positioned button
caused an erroneous result. By using a t rigg er w it h the arguments "bi" , we
could have ensured t hat th e bang to th e left inlet wou ld have arrived after t he
numeric value on the right .
In conclusion, here is a recap of t he various arguments for t he t r ig ger object,
as we ll as a few more that we have not yet encountered:

i integer
f f loatin g point number
b bang
I list (a message composed of elements, discussed in Section 1.3 and IA.7)
s symbol (also known as a string -fo r example "ope n" , "close" , "johnny" etc.)

9 This is clearly an exception to the rule t hat the "hot" inlet of an object is on the left . The right
inlet of message box was added in Version 5 of Max, t o make it easier to use. In earlier versions, it
was necessary to use the left inlet to carry out a mor e comp licated operation in order t o display a
message in a message box, whi ch we will discuss fully in Section IA.8.
159

You might also like