You are on page 1of 1

Inte rlude A - Program ming wit h Max/M SP IA

The two message boxes contain th e numbers 1 and 0, whic h serve respectively
to activat e and stop t he met ronome. The arg ument of the metro is " 500",
w hich means that the object w ill prod uce a bang every half second (500
milliseconds). The button connected to t he object gives us an easy way to act u-
ally see the generated sequence of bangs. If you wou ld like to change the ti me
betwee n events, connect a number box to t he right inlet of the metr o . To start
and stop t he met ronome, we can use a toggle object (w hich we f irst encoun-
tered in f ile 0 1_ 14_audiofile .maxpat); t he toggle object can be found at th e
f ifth slot on the palett e. immediate ly after but ton . Every t ime that it receives a
click, toggle alternates betwee n a 1 and a 0, w hich is very usefu l in cases such
as the current start/ stop scenario . To try t hese changes out, mod ify the preced-
ing pat ch in th e manner shown in f ig ure IA.21 and then click o n the toggle .

time interval in
toggle millisecond s

~~ metro 500

T
Fig. IA. 21 Varying t he t ime interval for a metro

We can use the metro object to generate a sequence of random notes, by


app lying it to th e example patc h tha t w e imp lemented in f igure IA. 19 . (The
mod if ications can be seen in fig ure IA. 22.)

MIDI note
toggle maximum minimum number

n
T r-' ~ ~.' " '
f,oool ~
~'1m,m
,re,"' ):'.'~
'I

~randomI '• ......



-
I startwindow
+L____ _, ~:~

Fig. IA. 22 A str eam of random notes

Add th e metro to the patch as show n in the fig ure, and you can use it to gen-
erate str eams of notes at various speeds. You w ill not ice a f law in the patch:
clicks are generated if t he metro rate is less th an 1000 milliseconds. This
happens because the envelope generated by l ine - (which is defin ed as being
1000 milliseconds long) doesn't get eno ug h ti me to term inate properly w hen
t he rate of th e metro is less t han 1000, and consequent ly th e envelope j umps
sudden ly to 0 at the beginning of each new note. This can be heard as a click
143

You might also like