Ia.1 Max and The Numbers: The Binary Operators: Integer Addition

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

Interlude A - Programming w ith Max/MSP IA

In t his f irst" Inter lude" we will examine a few aspects of programm ing Max/MSP
in more dept h, so to provide useful information to you. Because of the essent ial
natu re of this informa tion, we encourage you to not skip over this section unless
you are already tru ly expert in Max/MSP. It is important that you implement all
of the tutorial patches t hat we propose in t he text, as these small efforts yield
the biggest results.

IA.1 MAX AND THE NUMBERS:


THE BINARY OPERATORS

Like any respectable prog ramming language, Max can do many things with
numbers. We wil l begin this chapte r by look ing at the simplest operators, those
for add ition, subtraction, multiplication, and division .

INTEGER ADDITION
Recreate the simple patch show n in f igure IA.1 (and make sure t hat ther e is a
space between'+' and ' S' !).

r?
+5

Fig. IA.1 Addi ti on


cb
The + object adds its argument (whi ch is, in th is case, 5) to whatever numb er it
receives on its left inlet. If we feed some numbers to t he object via the number
box above it (by selecting it, for example, in performance mode and then using
the arrow keys on the keyboard to change its value), we can track t he results of
the operat ion in the lower number box.
The right inlet of + changes the argument, and if we enter a numbe r on t his
inlet by using another number box, the number w ill be substi tuted for t he argu-
ment of the + object in the sum that wi ll be produced when new numbers are
input via t he left inlet.
Try this by adding a number box on the right, as shown in figure IA.2:

the sum is generated ONLY this number


when you provide a number replaces the
on the left Inlet argument
0 12 7

the result is the sum of the number entered on


the left inlet plus the number entered on the
right inlet (which replaces the argument)

Fig. IA2 Addition w ith a changeable argument


131

You might also like