1o1o1o1o1

1o1o1o1o1 > Physical Computing and Interaction > Arduino > Arduino VS Max/MSP

Arduino VS Max/MSP

SimpleMessageSystem

To use Arduino with Max/MSP and indeed any other device it needs to have the appropriate program running on it that understand the whats going to happen.

The facility for making Max/MSP communicate with Ardunio is in two parts. The Arduino code to flash to the Arduino board and the Max/MSP patch that sends it information.

The files have been provided by ??? but when i used it there was a bug so i got in contact with him and we worked it out. It was only a little typo but thats all it takes.

You can download all the necessary files from here >

http://ciam.dyndns.org/~vitamin/danslchamp/mrtof/code.htm#ascii4pd

or from his home page >

http://ciam.dyndns.org/~vitamin/danslchamp/mrtof/code.htm

You have to copy some files into the Arduino directory and some into the Max/MSP directory.

Steps;
  • Copy all files in to the right places according to the readme file in the zip
  • Plug in Arduino and open up the Arduino program.
  • Open the file SimpleMessageSystem.example1 and flash to Arduino board
  • Close the Arduino program and start Max/MSP
  • Open the SimpleMessageSystem patch. it should like below


I wrote a patch that is a bit easier to understand and includes a PWM [which this didn't] if you have all the rest of the files installed you can get my patch from my HERE. it looks like below



I have labeled it so it reasonably obvious. If you put LEDs in to the PWM you can see the difference between the PWM rotary dials and the Digital ON /OFF toggle buttons. I must admit the PWM out object is not very good and also the reading values back is not as accurate or fast as Teleo but it is cheap and it does work, i think its the objects fault not Arduino's.


Arduino2Max

Arduino2Max is a simple max patch and accompanying Arduino code that reads the Arduino's 12 digital and 6 analog pins into Max/MSP/Jitter. To use it, you'll need to:

  • download the SimpleMessageSystem described above and
  • program the Arduino with the code included in the Arduino2Max zip archive (link below).

Once you have the programmed Arduino, the Max patch allows you to get the pin data by simply making a receive object for the particular pin. Using it in Max/MSP/Jitter is simple. Here's the main patch that collects the data from the Arduino:

Once the above is started, you can get the pin's value by simply making a named receive object. Here's an example of reading the analog pins:

... and here is how to read the digital pins:

Arduino2Max only reads the Arduino's inputs at the moment, although serial writes are possible. Feel free to improve on what you find here and repost it with a higher version number.

You'll need MAX 4.5 or higher to run the included MAX patch.

Arduino2Max, Version .10 Nov 8th, 2006 download


 

TOP
ui
 
hj