You are on page 1of 1

Interlude A - Prog ramming w ith Max/MSP IA

See fig ure IA.10 for examples:

input [{5 ~ input ~

,. 10. 1/ l .

ITD [To.2s
)

Fig. IA. 10 Operato rs that contain t he exclamat io n po int

In the fir st case, the value being input (1.5) is subtracted fr om the argume nt
(10), and th e result is 8.5 (10 - 1.5). In the second case, th e argument (1) is
divided by t he value being input, wh ich results in 0.2 5, since 1/4 = 0.25.
The operands are reversed with respect to th e norma l order for subtractio n and
division. Build th is patc h and compa re these operat ions w ith thei r analogs t hat
lack an exclamation po int. We already encountered the ! - operator in action in
Section 1.6, in the patch O1_ 17_pan.maxpat.

Al l of t hese operator s also exist in MSP versions that generates a sig nal (+- ,
-- , *-, /- ), wh ich we have already used a few ti mes in t he previous chapter.
MSP ope rator s require a signal to be present on one of t he two inlets (usually
the left) , and can receive either a signal or numeric values on the ir other inlet.
(They can also use a sing le value provided as an argument.) Fo r more info rma-
ti on about operato rs and objects, remember that <Alt -Click> w ill bring up help
patc hes when in edit mode.

THE INT AND FLOAT OBJECTS


Two objects exist t hat allow you to store values and recall these values later
using a bang. They are int (fo r t he sto rage of integers) and float (fo r float -
ing po int numbers).
In fig ure IA.11, we see th at these objects possesstwo inlets; if a value is sent to
t he "hot" left inlet, th e value is both stored and also immed iately transm itted
on the out let, wh ile if a value is sent to the "cold" right inlet, it is stored but
not transm itted . To retri eve the stored value at any t ime from either of t hese
o bjects, a bang can be sent to the ir left inlet, wh ich wi ll cause the value to be
transm itted . In bot h cases, incom ing values are copied into the object's memory
(and can the refore be recalled w ith a bang whenever we'd like) unti l new values
take thei r place.

a number on the left inlet saves a number on the right inlet saves
the value and transmits it the value but doe sn't transmit it

~ li3~
int float
1

brfu=J
Fig. IA. 11 The in t and float objects
137

You might also like