Professional Documents
Culture Documents
Later Tutorials Max
Later Tutorials Max
19th, 2006
MAX REVIEW
Some Operators
==Compare two numbers. Output 1 if equal, otherwise, 0.
% - divide two numbers, output the remainder. The right inlet is the divisor (the
smaller) and the left is the number to be divided.
/ - same as above, except does not output the remainder, puts out result instead.
! - reverses the order of an operator - Usually division/subtraction, etc. The right
inlet contains the number that is initially stored and the left inlet works on that. !=
compares two numbers and outputs 1 if they are not equal.
<= - is less than or equal to, comparison of two numbers.
>= - greater than or equal to comparison of two numbers.
&& - output a 1 if both numbers are non zero.
Tutorial 30
Iter object receives a list of numbers in its inlet and breaks the list up into
individual elements and send the numbers out in sequential order rather than all
at the same time. (Its as if Iter puts commas between the elements).
Unpack when a list received, each element of the list is sent out a different
outlet. Outlets determined by number of arguments. By default, unpack has 2
outlets, both with an initial value of 0. If there are extraneous elements, unpack
just ignores them.
Pack packs a list and the initial values stored by each one.
Swap reverses the sequential order of elements it receives. But it sends the
received number out its right outlet first then send the number that was received
earlier in the right inlet out its left outlet.
Tutorial 31
(NB Remember timer?)
Clocker instead of sending out a bang, clocker sends out time. This info can
cause values to change in some manner correlated with passing time.
1
Capture stores a list of all the numbers it receives. You can view the list in a
text window by double-clicking on the capture object and copy the contents of
that text window into a table window. The capture object is useful for viewing any
stream of numbers when you want to figure out what numbers are coming out of
an outlet.
Sysexin receives system exclusive messages, but to send , you need to
formate them yourself and use Midiout. This is were we use Sxformat.
Examples of Sysex Message: Status byte of any sysex message is always 240,
second byte is the Manufacturer ID, (each major synth manufact. has one), and
always ends with byte 247.
Note offs 1) note-off message with a release (key-up) velocity and the other is
a note-on message with a key-down velocity.
Xnotein (sensitive to key up velocities).
Tutorial 35
Seq records and plays back raw MIDI data in conjunction with midiin and
midiout. It understands messages stop, start, record, etc. Output of seq can be
transmitted directly to the synth, or Max (Midiparse) for further processing. Seq
is basically a sequencer of raw MIDI bytes. The speed of playback can be
controlled, read and write from files, and record from live MIDI input.
Flush (turns off held notes!)
Follow similar to seq, except in its ability to record MIDI data. Follow can
record a sequence of single numbers that are not in the form of complete MIDI
messages, (such as the pitches from MIDI note-ons). Follow stores recorded
MIDI data and then uses that as a sequence for a musical score. When provided
with argument, follow looks for it. When it is received, follow sends that pitch out
its right outlet and the index out its left. Using the index numbers from the left
outlet of follow as addresses of a table or some other array object like funbuff,
the indexes trigger some other values.
Tutorial 36
Mtr Maxs most versatile sequencer. Record and play up to 32 different
tracks of messages: numbers, lists or symbols. Tracks can be recorded and
played back either separately or all together. You can play back information from
sliders and dials this way. # of tracks specified by an argument. The leftmost
inlet is a control inlet for receiving command messages and the others are for
4
messages you want to record. Stop, Play, etc are applied to all tracks, unless
they include an argument, specifying a unique track to which the message
applies. A mute message it continues to play, but suppresses the actual
output. You can step through the messages using next instead of playing them
back at their original speed.
Tutorial 37
Coll the most versatile data structure in max (short for colletion). Stores a
collection of many different messages, of any type and length and can give each
message either a number address or a symbol address. If coll receives a list in
its inlet, it uses the first number in the list as an address, and stores the
remaining items in the list at that address. (Remember, list is any spaceseparated set of items). If the message begins with store coll uses the first item
after the word store as its address and stores the rest of the message at that
address.
Thresh Like iter in reverse. Numbers which are received within a certain
threshold of time are packed together in order. The threshold is the maximum
number of ms between any given number and the previous one. When no new
number is received, the numbers are sent out as a list.
Menu used to create pop-up menu in a Patcher window. Evaluate text item
menu sends the text of the item out the right outlet. (Provides an easy way of
doing message boxes).
Preset If the left outlet of preset is connected to the inlet of other user interface
objects, it stores and recalls the settings of only those objects. If the right outlet
of preset is connected to the inlet of other objects, preset stores and recalls the
settings of all user interface objects in the window except those objects. If
nothing is connected, preset stores all user interface objects on the page. To
clear a preset, you must hook up clear or to store, store or recall etc.
Expr arguments to expr make up a mathematical expression (formula) in a
format similar to C programming language.
If (In Pascal, this is expressed as IF condition THEN statement ELSE
statement) ie, if a certain condition is met, do one thing. Otherwise, do
something else. If uses an if/then/else format. If the comparison in the
arguments is true, (does not = 0) the message after the word then is sent out,
otherwise, the message after the optional word else is sent out.
Tutorial 39
Mousefilter Helps you see the exact value that will be sent out a slider or dial
before it actually is sent out. Receives the numbers in the inlet, but passes them
on only when the mouse button is up.
Mousesate When mousestate receives a bang in its inlet, it reports the current
horizontal and vertical location of the mouse out its left-middle and middle
outlets. If mousestate receives a 0 message, it interprets this as the new
starting point. It also reports the status of the mouse button 0 and 1 (off and on
correspondingly).
Tutorial 40
Loadbang sends a bang once when the Patcher that contains it is opened
(loaded into memory). This allows one to trigger certain actions immediately
when a patcher is loaded. Loadbang can be used to open gate and switch
objects (which are closed when a patch is opened), start timing objects such as
metro, or supply initial number values to an object such as number box.
Closebang counterpart to loadbang which is used to trigger actions such as
turning off metro or resetting the contents of a table.
Pcontrol When pcontrol receives an open or close message in its inlet, it
opens or closes the window of any subpatch objects connected to its outlet.
Led similar to toggle, except that led outputs only 0 or 1, indicating the
zero/non-zero status of the number is receives. When led receives a bang, it
flashes and outputs 1.
Active Automatic control object. Enables objects to run if the window is active.
If the window is active, it sends out a 1. If not, it sends out a 0.
Extraneous Tutorials
Abs - absolute value of input. Float and int version.
Append - Add one or more items to the end of a list or message. [append 20 30
40]. Append adds these to a message. Set changes the items that are
appended.
Bangbang - Outputs bangs from right-to-left. Argument gives the number of
outlets, (default two). It takes in any message in the inlet and sends 'bang' out its
outlets, right to left. Also can be abbreviated "b".
Borax - Reports information about note-ons and note-offs. Useful for recording
note information for sequencers and arpeggiators. Inlets pitch and velocity, and
bang in right-most inlet. Resets, sending out all currently held down notes with
velocities of 0.
Buddy - Synchronize input from different sources. Buddy takes an int argument
for the number of inlets and outlets. The default (and minimum) is 2, and there
is no set maximum. Buddy accepts ints, floats or symbols. Buddy is useful for
ensuring that two values (sent from send objects for example) come out in a
specified order (right to left!). Buddy only sends its input when all inputs have
been received. All inputs are cleared after.
Funnel - Map an integer into a list identified by inlet number. Funnel makes lists
that identify the source of a number. It can be used to store numbers into a table
or coll based on their source. It can be used in conjunction with env and spray.
If - Conditionally sends messages. Used in conjunction with 'then' and 'else'.
For instance, if $1 < $2 then set $1 else set $2.
IncDec - a simple increment/decrement object for number boxes. Only works
with ints!
Midiin - Outputs incoming MIDI bytes. Midiin produces MIDI messages as a
series of individual bytes.
Midiout - Send intergers as raw MIDI data. For example, 144, 60, 60 - start a
note. 144, 60, 0 - stop. Switch ports - send message "port b" or just "b".
Pack - makes numbers or symbols into a list. Number in left inlet sets a value
and outputs the list. A bang in this inlet will also output a list. Arguments set the
types and initial values of the list items. (Remember, unpack sends list elements
out separate outlets - with 0s as arguments).
Slider - Somewhat outdated graphical slider.
Uslider - graphical slider.
Speedlim - Limit the speed of messages passing through. Optional argument
initializes the speed. Int in left repeats to outlet at a possibly reduced rate, int in
right inlet sets speed in ms.
Pcontrol - remote control of patcher windows. Receives messages in left inlet
and processes accordingly.
the sample. Play~ can be typically used with line, but can be used with any
signal that generates a changing position value.
Sig~ - Output a constant value as signal. This object converts and int or float
into a signal. It also accepts a signal in which it ignores.
Selector~ - Switch output among several input signals. Version of Max switch
object for use with signals. It takes an argument for number of inputs (one is
default) and lets you turn incoming signals on and off by sending an int to its left
inlet.
Extraneous Information
Messages without commas are interpreted as a list. For example MIDI
information contains a list of three items: pitch velocity and duration. With
commas, however, the information is interpreted as three separate messages.
Changeable arguments ($) can be used to store a message sent to it. When the
message box receives a triggering message in its inlet, each changeable
argument is replaced by the corresponding item from the triggering message.
The co-argument to the dollar sign is the #. These work in abstractions or sub
patchers that can take arguments. The # is replaced by the argument provided.
Note that a backslash before will negate the effectiveness of these objects, so
that one is free to use such symbols as the dollar sign or # and not have Max
interpret them as changeable arguments.
Semicolon: (;). When a semicolon appears in a message box, the first word
after the semicolon is interpreted as the name of a receive object. The rest of the
message (or up to the next semicolon) is sent to all receive objects with that
name, instead of coming out of the message box's own outlet.
10