AN INTRODUCTION TO MAX/MSP

jabgoldfishAI and Robotics

Oct 19, 2013 (3 years and 9 months ago)

78 views

AN INTRODUCTION TO MAX/MSP

Medialogy, Aalborg University Copenhagen.
Niels Böttcher, nib@imi.aau.dk


Medialogy, Aalborg University Copenhagen.
Niels Böttcher, nib@imi.aau.dk


WHAT IS MAX?






-

A graphical programming language.

-

Originated from Puredate (pd)


Medialogy, Aalborg University Copenhagen.
Niels Böttcher, nib@imi.aau.dk


What can you do with it?






-

Good for testing complex solutions fast (not like c++)

-

Exelent for prototyping

-

Exelent for working with sensors

-

Great together with Flash


Medialogy, Aalborg University Copenhagen.
Niels Böttcher, nib@imi.aau.dk


MAX

MSP
?






Max

is the core of the graphical programming language

Msp

is the sound/signal processing part of Max (
~
)



Medialogy, Aalborg University Copenhagen.
Niels Böttcher, nib@imi.aau.dk


MAX/MSP

&

JITTER
?






Jitter

is the image processing part to Max (.jit)


Medialogy, Aalborg University Copenhagen.
Niels Böttcher, nib@imi.aau.dk


THE KEY ELEMENTS IN MAX






Many

similarities to programming languages and scripting


-

Variables

-

Functions

-

Boolean

-

Expressions

-

Conditionals

...

Medialogy, Aalborg University Copenhagen.
Niels Böttcher, nib@imi.aau.dk


VARIABLES & FUNCTIONS






Variables

(values that can change)


Functions/Object boxes

(perform a function)

Different inlets


Effect the function inside the object in different ways

Outlets
-

pass on the information from the object to something else

All objects behave individual and have a different amount of inlets and
outlets.

This can be integers or floats for instance

Right click on the number boxes

to make a minimum and maximum
value

Medialogy, Aalborg University Copenhagen.
Niels Böttcher, nib@imi.aau.dk


INLETS & OUTLETS?






How do you know what ot put in the inlets?


You right click and press help!


-

or mouse
-
over

Medialogy, Aalborg University Copenhagen.
Niels Böttcher, nib@imi.aau.dk


WIRES






You send data from one object to another through the wires


-

A thin black wire is data (like numbers, matrices or bangs)

-

A yellow wire means that you are sending a signal (sound)

-

A green wire means that you are sending a matrix (graphics)


Medialogy, Aalborg University Copenhagen.
Niels Böttcher, nib@imi.aau.dk


OR WITHOUT WIRES






How can you avoid the wires?

Send


Is sending the data somewhere else (can also be written as s)

Remember to give the data you are sending a name

Receive


Receives data from somewhere (can also be written as r)

Remember to tell what you are receiving refering to the name above

Medialogy, Aalborg University Copenhagen.
Niels Böttcher, nib@imi.aau.dk


CONDITIONALS






Two examples of how to make a conditional

Medialogy, Aalborg University Copenhagen.
Niels Böttcher, nib@imi.aau.dk


DIFFERENT IMPORTANT OBJECTS






Toggle

(on/off switch
-

send sustained 1 or 0)

Turn sound on and off for instance

Bang

(”Do it machine!”)

Is for instance useful when you want to pass on data.

Play a tone on an instrument

Metro

(metronome sending a constant flow of
bangs in a certain tempo (set in Ms))


Needs an on/off to start!

Medialogy, Aalborg University Copenhagen.
Niels Böttcher, nib@imi.aau.dk


THE LOCKED & UNLOCKED MODE






Unlocked mode:

When the patch is unlocked you can rewire, make new
objects and build the patch.

Locked mode:

This is the mode where you run the program. You can’t
rewire or build the patch anymore, only change values
on the variables.

Ctrl+E or command+E to lock

Or click anywhere in the patch outside an object, while
pressing ctrl or command.

Medialogy, Aalborg University Copenhagen.
Niels Böttcher, nib@imi.aau.dk


THE MAX WINDOW






(Like when you trace in Flash/actionscript)

Press control + M to see the max window (cmd + M )

It is a debugging window.

Good for showing errors

You can print to the window the check values


use the ”print”
-
object

Medialogy, Aalborg University Copenhagen.
Niels Böttcher, nib@imi.aau.dk


WHAT HAPPENS WHEN YOU
HAVE A VERY LARGE PATCH?






Medialogy, Aalborg University Copenhagen.
Niels Böttcher, nib@imi.aau.dk


PATCHERS AND SUB
-
PATCHERS






A patch inside a patch


A nice function when you get a bigger patch


Can be done very simple by choosing the objects

Edit


encapsulate (remember to give a name)


Create you own inlets and outlets to the patcher

Medialogy, Aalborg University Copenhagen.
Niels Böttcher, nib@imi.aau.dk


ESSENTIAL SOUND OBJECTS

Sound/Msp:

Dac~

(digital to analogue conversion


the loudspeaker)

Adc~

(analogue to digital conversion


to use the
microphone)

Cycle~

(a sinusoid/sine wave



most synthesized sounds is based on sine waves
)

Noise~

(noise


random frequencies)

sfplay~

(something similar to a sampler



playback sound in different speeds, reverse and more
)

*~

(The amplifier. It multiplies the signal. Sometimes you
need to turn it down. Then write *~0.2 for instance
-
)



Medialogy, Aalborg University Copenhagen.
Niels Böttcher, nib@imi.aau.dk


A VERY SIMPLE SYNTHESIZER








Cycle~ is a sinusoid/sine wave



*~ is to turn up the amplitude of the sound



The loudspeaker (same as a dac~) turns on the sound.


A digital to analogue convertion

Medialogy, Aalborg University Copenhagen.
Niels Böttcher, nib@imi.aau.dk


HOW TO LEARN IT YOURSELF?








Go through the tutorials in the documentation


they are exelent



Use the right
-
click help function as much as possible


best tip!!



Copy paste as much as you can and try to understand from there



The forum on cycling74 is very good for all kinds of qustions



Additional links:


http://www.maxobjects.com


-

a lot of new objects and description


http://www.cycling74.com


-

the software and many other things






Medialogy, Aalborg University Copenhagen.
Niels Böttcher, nib@imi.aau.dk


WHAT CAN YOU DO WITH

MAX/MSP/JITTER?








Send and receive midi or open sound control data



Analyse sound (amplitude, pitch …)


Analyze images



Implement sensors and map them to motion, sound, graphics,
colors..



Send and receive information to flash or other programs and
control


animations, movieclips, 3D engines or similar



Record sound or synthesize sound



Play video, webcam



Computer vision (motion tracking, color tracking...)



Computer graphics, 3D, Stereo …


Everything is possible!

Medialogy, Aalborg University Copenhagen.
Niels Böttcher, nib@imi.aau.dk


WHAT IF YOU CAN'T FIND THE
RIGHT BOX?







Then you can just program it yourself!


This is done in either c++ or javascript



Since it is a programming language you can do almost anything!!