You are on page 1of 1

Inter lude A - Prog ramming w ith Max/MSP IA

In this style of patch, the "co ld" inlet of the add it ion object behaves as though
it we re a "hot" inlet. Try build ing it, and verifying th at the number box on the
right triggers a result every ti me that its value is changed.

It is essential that th e positions of the objects in your patch are absolute ly the
same as the posit io ns in the f igure. Placing the button to the right of the
+ object, for example, w ill produce undesired results, since t he bang wi ll f ire
before t he new value is stored, causing th e addition object to use t he old value
th at had been copied into the internal variable previously in its calculation rather
than the new value (as shown in f igure IA.4).

if the bang is on
the right, you'll
+5 have some
T. surprises!

OD
Fig. IA.4 Buggy results produced by an error in the order of execution

Delete t he two numbe r boxes above the + object and connect a message box to
its left inlet. After t his is done, type two numbers (separated by a space) inside
the message box, as in f igure IA.S:

93
[_
+5

ck
Fig. IA. 5 Summing a list

If you now click on the message box in performanc e mode, t he + object w ill
sum its values; th e operator behaves as t houg h it had received t he second
number on th e right inlet (and, as usual, the argument 5 inside t he object box
is replaced by t hat new value). This behavior (t he ability to accept lists of two o r
more elements on t heir left inlet and t hen route th e individual list items t o the
ot her inlets) is also a common featu re of many Max objects, and wor ks not only
with binary operators, but of ten wi th objects t hat have t hree or more inlets.

To see a simple musical application of Max's addition object, open the fi le


IA_01_transposition.maxpat (seen in figure IA.6). Every time a key is pressed
on th e kslider object in th is patc h, two not es are generated, the second of
whi ch is 7 semitones above the f irst - the musical distance of a fifth . Every time
that we press a key on the kslider , the value of the correspond ing M IDI note
number (a C in figure IA.6, fo r examp le) is sent to the mtof object on t he left,
w hich converts it into a freq uency value. At t he same ti me, t he note number
is also sent to a + object that adds 7 (prod ucing t he MIDI note number fo r a G
133

You might also like