Since the upgrade of Firmata v2, it has been difficult communicating between Max/MSP and the Arduino board. However, thanks to Christopher Coleman, who updated the Max patch of Marius Schebella, it’s working again. Thank you Chris!

Download the latest Maxuino here.

This is a basic tutorial on how to set up communication between Arduino and Max/MSP

This tutorial is for Mac OS X. If you are on an other platform, you can find instructions on the Arduino site to get your Arduino up and running.

    -Download the latest Arduino software .

    -When it’s done, open the folder and make sure to keep the structure the same.

    -If you are using Arduino Duemilanove or a similar board that runs off USB you’ll have to install the USB drivers. You can find them in the Arduino folder you just downloaded.
    USB Drivers

    -When that is done, launch the Arduino Software. Arduino icon

    -Go to: Tools –> Board –> and choose your board.
    board choice

    -Make sure to pick the right serial port: Tools–> Serial Port –> it should be something like /dev/tty.usbserial-…
    Serial Port

    -If you have an LED, connect the positive (longer leg) to digital pin 13 and the negative (shorter leg) to ground (GND) so you can have easy visual feedback when testing it. If you don’t have one, there is a tiny light that blinks the same way, it is marked ‘L’ directly below ground and pin 13 (in the picture).
    Arduino LED

    Update: make sure you download the latest Firmata. Thanks Hans-Christoph Steiner!

    -Open Standard Firmata: File –> Sketchbook –> Examples –> Library-Firmata –> StandardFirmata.
    Standard Firmata

    -Upload the standard Firmata onto your Arduino by hitting Com + U(Command + U). As it is uploading, keep an eye on your board, you should see the LED blinking a few times sporadically, that’s a good sign.

    -You should now see at the bottom of the sketch’s window ‘done uploading’ and the size in byte.
    Done Uploading

    -If you only want to work with Max/MSP you won’t need to touch the Arduino software again, but if you upload anything else onto your board, it will delete the Firmata and you’ll have upload it again.

    Now on the Max side of things:

    -Firstly, make sure to close the Arduino software.

    -If you haven’t already, go download Maxuino-005.

    -The heart of it all is the arduino.maxpat file, so you have to put it into your Max search path. If you have the older version of Maxuino, delete it so that Max doesn’t find multiple files.

    -Open up Max/MSP and launch arduino_test.maxpat.
    arduino_test

    -Make sure that the right port is selected, it should be the usbserial-… port we chose earlier.
    Serial Port Max

    -Test to see if your Arduino and Max/MSP are talking by switching on the toggle above the metro in ‘digital Pin output’, you should see the LED on the Arduino blinking the same as in Max/MSP.
    Digital Pin Output Test

Now you should be able to send messages to Arduino from Max/MSP and vice-versa. Usually you will want to control Max/MSP from your Arduino board using switches, potentiometers and other goodies. The next tutorial will cover that.

If you’re on a roll, go to the Arduino site to find information on how to connect the circuits up. Don’t upload the Arduino code, instead keep the Standard Firmata and use Max/MSP as the brain.


98 Responses to “How to Set Up Arduino with Max/MSP { sound + tutorial }”  

  1. 1 Dik

    Great tutorial. Exactly what I needed.
    Thanks so much for sharing this.
    Looking forward to your next one.

  2. 2 Andrew

    Hi Dik, I’m glad it helped. Have fun with it!

  3. 3 jimmy

    Where do I look if I’m still using Max/MSP 4.6?

  4. 4 Andrew

    It might actually work, have you tried opening the patch? Otherwise I have no idea where you can find for 4.6.

  5. 5 jimmy

    Max 5 patches don’t open in 4 at all. I’ll just try to find someone to open it and give me screenshots so I can remake it. Thanks though.

  6. 6 Adrian

    Hello Andrew,
    Great explanation, thanx a lot!
    It was very clear and on the basic level that I had been looking for; how to get the information between Arduino and Max with the least amount of fuss.
    Looking forward to your next tutorial…..in the meantime I’m gonna start hooking things up to the Arduino!
    :) Adrian

  7. 7 Andrew Spitz

    Hi Adrian, thanks for the comment. Good to hear that it got you hooked up and ready. I hope to get the next tutorial out sooner than later…

  8. 8 Mani

    Awesome Tutorial Andrew.
    By any chance do you know anything about Motor Shields on Arduino ?
    I’m trying to control a few multi directional DC motors via : ardiuino with a motor shield attachment: (this is the link to the shield’s website)
    http://www.ladyada.net/make/mshield/use.html

    I will be waiting for your future tutorials.
    mani

  9. 9 Andrew Spitz

    Thanks Mani.
    I’m sorry but I don’t know about the motor shields themselves, but controlling them from Max/MSP shouldn’t be too hard. Is that what you want to do? If it’s just to get it working then I’m of no use to you. Sorry :-)

  10. 10 sarah nicolls

    thanks for this – it really sped up our learning process and is very kind of you! :)

  11. 11 Andrew Spitz

    Hi Sarah, I’m happy that it helped you out. Thanks for the comment.

  12. 12 Todd

    thank you so much, this tutorial is nice and concise!

  13. 13 Greg

    I purchased Max MSP today and was a bit disappointed to see that the serial communication tutorial did not work with my arduino. Well, this patch did. Awesome, thanks!

  14. 14 Andrew Spitz

    Hi Greg, I’m glad it worked for you! Thanks for the comment.

  15. 15 Toby

    helpful tutorial, the LED flashes for me, but I can’t read the analog inputs. Any ideas how to do this, I need to use a variable resistor to control a max patch, but am confused by every other tutorial out there (new to max and arduino). Anyone got any ideas?

  16. 16 Andrew Spitz

    Hi Toby, I really should do another tutorial (time, arg!).

    On the arduino side: connect one side of your variable resistor to arduino’s 5v input, the other far side of your resistor to ground and the middle one to any analogue input. Check here for a picture and details (don’t upload the code) http://arduino.cc/en/Tutorial/AnalogInput.

    On Max/MSP’s side: open arduino_test patch and in “analogue Pins on/off” switch on the toggle that is the same number as the analogue input you used on the arduino. Then you should see in “analogue Pins Input” the appropriate number box reacting. A very useful object for making sure that the inputs are in the right range is [scale]. Very useful indeed!

    I don’t have time to check it but that should do it. Good luck!

  17. 17 anna

    I think I need more. It is very usefull. My led is working. And now?

  18. 18 Andrew Spitz

    I will try put together another tutorial. Until then you can check out http://arduino.cc/en/Tutorial/ to see how to connect things up. You can also read the previous comment to get a basic idea.

  19. 19 Toby

    Awesome, have got it working, does anybody know how I could extend this to use all 16 inputs on an arduino mega. Also, anna, what is it that you want to do, if it is using the analog inputs I may be able to help you, my knowledge is very limited but i’d be happy to pass on what I do know. Cheers!

  20. 20 Andrew Spitz

    Hey Toby. Great you got it working!

    I don’t have a mega, but could you not just add more input inside [p enable-analog-ins] & [p display-analog-ins] subpatches of arduino_test.maxpat. That might work. So just double click inside the subpatches and continue what is already done till 16… Let me know how you go on.

  21. 21 Toby

    Will do, thanks very much for your help Andrew. It’s working pretty nicely, with a bit of playing around with resistors and different scalings it’s nice and responsive to normal sort of light levels too. Have just emailed you about your sound designers telephone game, I have some cool thoughts for it I think, it’s a great idea.

  22. 22 Chad Eby

    Has anyone back-translated this to Max/MSP 4.x? Would be super helpful…

  23. 23 Jonathan

    Thanks for the tutorial Toby! I’m trying to replicate in the arduino_test patch the tutorial for AnalogInput. How do I get the digitalWrite and delay(sensorvalue) part going? I’m reading the potentiometer input OK.

  24. 24 Andrew Spitz

    It’s a pleasure. (I’m Andrew by the way ;-)) I don’t have anything on me at the moment so I can’t really check, but did you switch on the appropriate toggles in the Digital Pin mode section of the patch (ie. turn them into inputs)?

  25. 25 Tim Devine

    Hey i just tried this with Arduino_17 and it did not work, tried Arduino_13 and it seems to work, if anyone else has the same problem. A great help Andrew, Thanks!

  26. 26 Andrew Spitz

    Hi Tim, I haven’t tried with the new update, sorry I can’t help that front. Have you tried the Arduino or Max forums?

  27. 27 Tobias

    Hello, I have similar problems like Toby had: I tried to connect a potentiometer (5kOhm) but I can’t read the analog inputs in the arduino_test.maxpat. Trying other codes (not Firmata) like the simple “Analog Input” from the arduino site everything’s working well with the potentiometer connected…
    Any idea what could be wrong?

    Thanks for help!!!

  28. 28 Andrew Spitz

    Hi Tobias, so you’re able to control the Arduino board from Max but not Max from the Arduino board? Just to check, are you on Arduino 17?

  29. 29 Tobias

    Hello Andrew, that’s exactly the problem: I’m able to control the Arduino board from Max but not Max from the Arduino board. I’m on Arduino 17.

  30. 30 Andrew Spitz

    I’m not sure exactly what’s going on with 17, and I won’t be able to check for some time. But people are having issues with 17. Did you try on an older version to see if it’s the problem is from the update or maybe from your connections?

  31. 31 Tobias

    I tried older versions (12,13,14,16) but I always got a java error message. I’m on Mac OS 10.5.7. Looking on the net I found some Infos, but they couldn’t solve the problem.
    (Checking the “Open in 32 Bit Mode” checkbox in the App-Info-Window gives me another java error…)
    Oh my god!

  32. 32 Andrew Spitz

    Sorry, I have know idea. Seems like there is a conflict of some sort. Did you try get rid of the older ones? You should try post the error message you get on the Arduino forums, I’m sure the people on there will be able to help you.

  33. 33 Tobias

    Hallo Andrew, thank you very much for your help! After deleting the Arduino 17 preferences the communication with MAX/MSP is working using Arduino 16.

    Best wishes!
    Tobias

  34. 34 Andrew Spitz

    Good to hear Tobias! Good luck with your projects.

  35. 35 Antonino

    hi Andrew,
    the Arduino 0017 is not working also for me… I tried to use the previous versions (13-15-16) but the app doesn’t start: “cannot launch java application”. I’m under 10.5.8, I tried to delete the arduino preferences, but nothing… on another computer (older OS) I suceeded in uploading firmata standard firmware from Arduino 0016, but when I launch on my computer the arduino_test max patch I get a warning message in the max window:
    INCOMPATIBLE FIRMWARE VERSION, Message 0.
    Arduino_Firmata_Version, Message 02.
    even if the sensor and the patch itself seem to work fine.
    I’m stucked… any suggestion?
    Thank you so much
    Antonino

  36. 36 Andrew Spitz

    Hi Antonio, sorry for the late reply… my computer is broken and have hardly no online access. I can’t help for the time being, sorry. Hope you sort it out.

  37. 37 Jelle

    Hi Andrew (and others)

    Thanks for this Tutorial its been really useful!
    However it does not work with my mac (yet).
    No LEDs are flashing

    Im working with snow leopard and arduino 17 (older versions dont work on snow)
    In arduino there are two different usb ports: tty.usbserial and cu.usbserial mine works on tty.

    When I press the serial port the max output window gives the following error:
    Specified port not available. (http://img16.imageshack.us/img16/4150/screenshot20090924at120d.png)
    When I click on the error it opens arduino.maxpat and flashes “serial 0 115200″

    Do you have any idea what is wrong with my settings?

    Kind regards,
    Jelle

  38. 38 Andrew Spitz

    Hi Jelle, everything has gone bonkers since the Arduino updates. I don’t have a computer (and Max/MSP) at the moment so can’t check out anything. Have you checked out the Arduino or Max forums?

    Just to check, when you say “when I press the serial port” are you pressing only on the message box or are you first selecting using the Umenu? Or maybe try rebuild manually the serial object with a different port number, maybe 1 or 2 instead (serial 1 115200) instead of (serial 0 115200)?

  39. 39 Hans-Christoph Steiner

    The StandardFirmata in 0017 turned out to be kind of buggy, unfortunately. We have things mostly fixed in SVN, but would love to have more testing and bug reports! So here’s a new release. I fixed all bugs that I knew about, including the one where analog pins sometimes acted like they had a log curve on them.

    http://at.or.at/hans/pd/objects.html#pduino

    Just download the Firmata.zip and then install the StandardFirmata included in that. I tested this on a Diecimila, I hear there are troubles with the Arduino Pro and others, but I only have the older ones, so testing and bug reports on those are very helpful.

    .hc

  40. 40 Andrew Spitz

    Cheers for that Hans-Christoph! It’s very nice of you to update it and let us know. Seems like I will finally get a computer this week or early next week so will be able to check it out. I will send you the bug reports your way as they happen.

  41. 41 jorge lozano

    ThANKS for the tutorial it worked fine. Howeever I have a question, I HAVE CONNECTED A BUTTON/SENSOR AND IT WORKS ON ARDUINO. HOW DO I CONNECT MAX AND ARDUINO TO TRIGGER A VIDEO WHEN I TOCUH THE SENSOR???

    saludos

    jorge

  42. 42 Eiður Árnason

    Great tutorial. just wanted to give my grats

    I am new to both arduino and max msp but I am wondering if the idea is that I use the test patch and build my max msp synth around that or if the other patches would be more suitable.

    All the best. Eiður

  43. 43 Andrew Spitz

    Thanks Eiður. Yeah, the test patch is perfect. Just open it, save it as a new file and then delete the sections that you’re not gonna use. Have fun!

  44. 44 Andrew Spitz

    Hey Jorge, glad it’s working. Now to trigger a video in Max you can just connect a button to the Arduino (which you said you did), check out this tutorial just in case http://arduino.cc/en/Tutorial/Button just don’t copy the code at the bottom, Max/MSP should read the button input fine. You can see if it works in “Digital Pins Input” from the test patch you should receive a bang when pressing the button on your Arduino board, and connect that bang to the switch for your video. The actual patching to trigger a video can be found here http://www.cycling74.com/docs/max5/tutorials/jit-tut/jitterchapter01.html
    Make sense?

  45. 45 Jack

    Hi,

    Where do I find the Max search path, i’m using snow leopard.

    Thanks,
    Jack

  46. 46 Andrew Spitz

    Hey Jack. To put stuff in your search path go to Applications –> Max5 –> and inside is your search path where you can drop the new files/folders that need to be in. You can use the current folders there to help organise or create new ones… it doesn’t matter.

    Another way is the create your own search path. After launching Max/MSP, go to Options –> File Preferences –> Click the add button (+) –> and then pick the folder you want to be added to your search path.

    Hope this helps.

  47. 47 Alexander

    Hi there,

    I’m trying to work on an arduino board for a project in my first year of uni- basically using a LDR to control a sine wave in MAXMSP 5.1. I’ve connected the LDR to the 5V output on the board and then into analog input 0, and put the appropiate code onto the Arduino. This has worked on a Mac, but unfortunately in on a PC running windows vista, and although the USB drivers will let me send data and detect the arduino, Max isnt having any of it- it will see the port that the arduino is running in (COM9) but when i select it in Arduino2Max it just wont work :(
    im really new to this whole thing, which isnt ideal :P

  48. 48 Andrew Spitz

    Hi Alexander, sorry you’re having issues. I’m not on Windows so I can’t really help you. Maybe you should check the Cycling ’74 forums or the Arduino forums.

    Andrew Benson has come up with another Max patch and Arduino code that you could maybe check out: http://pixlpa.com/blog/arduino-sensorbox-firmware

    Or else, maybe try see if one of these work: http://arduino.cc/en/Tutorial/PhysicalPixel or the other Communication tutorials that include Max.

    Hope this helps and that you kind find a solution to your problem!

  49. 49 Andrea Dio

    Hi….
    I’m trying to send to maxmsp the EZ0 “ultrasonic range finder” values
    with no success!!
    I think I’m getting something wrong… (first of all i’ve to say that i’m new to both of them Arduino and Max)
    I uploaded the firmata stuff…. but than how do I upload the EZ0 code?
    Can anyone help me?
    Tks a lot

  50. 50 Andrew Spitz

    Hi Andrea,
    The idea behind the Firmata is that it’s the only code you need to upload it onto your Arduino, and it communicates with Max/MSP where you do your programming. if you add other code to your Arduino board, you’ll wipe the Firmata and will not be able to communicate with Max/MSP.

    In Max, using the Maxuino patch, you can receive the values from the EZ0 or any other analogue actuator by switching on the toggle of the analogue pin you’re using for your range finder in the section called “analog Pins On/Off”, and the values should be displayed below in the section called “analog Pins Input”.

    Hope you get it working. Please let me know if you don’t.

  51. 51 Andrea Dio

    Hi Andrew tks for the super fast answer!!
    I see!
    I’m using the digital PWM pins
    (cose it has been suggested on forums, remember I just started)
    with this code

    //ULTRASOUND SETUP
    unsigned long echo = 0;
    int ultraSoundSignal = 5; // Ultrasound signal pin
    unsigned long ultrasoundValue = 0;
    //ULTRASOUND END

    //SMOOTHING SETUP
    // Define the number of samples to keep track of. The higher the number,
    // the more the readings will be smoothed, but the slower the output will
    // respond to the input. Using a constant rather than a normal variable lets
    // use this value to determine the size of the readings array.
    const int numReadings = 15;
    int readings[numReadings]; // the readings from the analog input
    int index = 0; // the index of the current reading
    int total = 0; // the running total
    int average = 0; // the average
    //SMOOTHING END

    void setup()
    {
    Serial.begin(9600);
    pinMode(ultraSoundSignal,OUTPUT);
    for (int thisReading = 0; thisReading = numReadings)
    // …wrap around to the beginning:
    index = 0;
    // calculate the average:
    average = total / numReadings;
    // send it to the computer (as ASCII digits)
    Serial.println(average, DEC);
    delay(250); //delay 1/4 seconds.
    }

    I uploaded the firmata opened Max done the Maxuino thing….
    Done the digital stuff…. but I can’t get any values!
    What I’m I doing wrong?

    Adio

  52. 52 Andrew Spitz

    I’ve never used sonic range finders, but the first thing I’d do (I’m no expert though, bare that in mind) would be to use an analog pin instead of the digital (pwm) pin and see how it responds, I’m sure it’s more noisy. You can read this if you want: http://bit.ly/5xXbYR number 8 and 9 talk about analog vs. pwm and a little trick in the circuit (capacitor + resistor) to make it less noisy. You can also make it less noisy programmatically in Max/MSP.

    I don’t know how precise you need it (and if its a relative distance or a precise distance in cm/mm), but here’s the basic process I’d try just to get started:

    1. Upload the firmata (not the other code you posted)
    2. build your circuit (connect it all up to your Arduino)
    3. open up the arduino_test patch and make sure it works with the blinking led
    4. In Max, switch on the toggle of the analog pin you’re using in “analog Pins On/Off”
    5. Then look below in “analog Pins Input”, you should be receiving values.
    6. Then see the closest value but putting something at the closest distance you’ll want it to read; do the same for the farthest. Take note of the highest and lowest value you get. That’s your range you’ll be working with.
    7. Then I’d set up a [scale] object under the number box reading the analog values to go from the min to max value (from the step before) to the lowest and highest value you want in Max.
    * So if for example: Let’s say the lowest value you get is 0., and the highest 5., and you want to change the pitch of a synth from middle C (261.626 Hz) to two octaves above (1046.502 Hz), you could have the scale object like this [scale 0. 5. 261.626 1046.502].

    I know how overwhelming it can be at first, but I really hope this gets you going with your project. Just get it working, and then work on perfecting it.

  53. 53 Andrea Dio

    Hi Andrew
    Tks for the reply… so:
    I’m going analogue…. i get some sort of values always on pin 0, so i decided to use it!
    The values are 15.8 3.75 31.7 always the same ones! and it look very slow to refresh the values so I can’t actually understand which is which (close or far from the sensor)…. I’ll try to figure it !
    So I guess the range I’ve to work with is between 3.75 and 31.7….
    I think i’m connecting the right pins…. 5v on the 5v on Arduino, same for the ground and than pin 0.
    When I was digital with my code I could receive a sort of more understandable values and definitely more than just three.
    What I actually need to do with those values is just increase the volume of an audio file and to apply a blur filter on a video.
    Do u think is doable?
    All the best
    Bye now

  54. 54 Andrew Spitz

    Doable, for sure. Once we get the correct values into max, the rest is easy :-)
    Maybe we should move this to email. Send me a message to andrew [at] soundplusdesign [dot] com

  55. 55 Pipe P

    Great tutorial. While I’m not using Maxuino or Firmata, I am using a controller I built to send serial data to a max patch I created. Initially everything works fine. However Max keeps crashing on me (can’t even force quit!) whenever I go back and update my Arduino code. I always close Arduino before opening Max, and vice versa. I am using the Duemilanove ATMEGA168. Any insight would be appreciated. Having to restart my mac every time is killing me!

  56. 56 Andrew Spitz

    I had a similar problem a while back. But in my case, it was the circuit’s fault. I was working with some solenoids and I can’t remember really what I was doing, but I also had to force quit my mac all the time. Very frustrating. Not sure what you could do. You say you’re closing everything every time? Maybe try plugging the Arduino after your Max patch has loaded? Or maybe try pressing the reset button on the Ardunio before uploading the code? Not sure. Sorry.

  57. 57 yayaya

    hello there poeple of the forum .
    lately ive been using the arduino duemilanove , i know max msp pretty well .
    since im a musician and dont want to bring my computer everytime i perform i was wondering if there is any way to flash a max msp patch staight to the arduino so that i could control all the values on max using potentiometers and buttons?

    i thought that since the arduino programing environment and max msp are both based on c there might be a way to compile max patches and flash them to the atmega chip .

    is there any option or software that can do that?

    thank you in advance

  58. 58 Andrew Spitz

    Hi Yayaya,
    I would be really surprised if that could be done. Even if it where possible to get the code on there somehow, the amount of ram available on the Arduino is tiny, I think the code runs on something like 1KB. Maybe double check on the Arduino or Max forums in case anyone says otherwise. If it can, then definitely let me know!

  59. 59 AndyJ

    Hi Andrew,
    Thanks for this tutorial. I’m new to Arduino and Max but I’ve used your tutorial to get digital inputs into max working – great start as I failed with several other tutorials! Now I’m stuck what to do next in Max. What I want to do eventually is have my sensors on arduino play instruments in Ableton Live (be able to use them to play notes or map to effect/synth parameters etc). Could you please provide some basic instruction on next steps or point me towards another tutorial if you know of one?
    Thanks again,
    Andy

  60. 60 Andrew Spitz

    AndyJ’s comment has been answered here.

  61. 61 Amy

    Hi Andrew,
    Thanks for the tutorial. I followed all steps u’ve provided but when i switched on the toggle on the ‘digital pin output’, my lED is not blinking, which means arduino and max are not communicating.

    i was using maxuino 008 and i couldnt c the same visuals u posted up here. i used the maxuino 005 then.

    when i switch the toggle on, all the LED digital input in max are blinking but it’s not blinking on my arduino. and in Max, there’s a message box ‘digital 2 1′ and the ‘1’ digit is changing from 1 to 0 and back n forth.

    btw, I’m using DFRduino Duemilanove version of arduino.

    hope i can get a little help from you here.

    Thank you.

  62. 62 Andrew Spitz

    Hi Amy, sorry for the delay but I’ve been very busy. I haven’t yet tried Maxuino 008 so I’m not sure on that front. Have you tried using Maxuino 007? What Firmata have you got on your Arduino? Have you downloaded Firmata 2.1 from http://at.or.at/hans/pd/objects.html#pduino because there were some problems on Arduino 17 and the Standard Firmata. The flashing message box ‘digital 2 1′, ‘digital 2 0′ is normal, it’s actually going up to 13 but it’s not displaying it. Does your Max window say anything abnormal?

  63. 63 Amy

    Hi Andrew! Thanks for your reply. I hv given up on Maxuino and now i’m using arduino2max patch and it’s working well after i updated the version 5.0.6 to 5.1.3.
    anyway, thank you again.
    Good Day! :)

  64. 64 dionq

    hello : )

    when i try to use a digital input on the arduino, on some channels more than one bang lights up in the maxuino patch.

    3 > 7 inputs are all o.k. but 8 >13 there are problems.:
    input result
    8 = 8 + 9 light up.
    9 = 8+ 9 +10 light up
    10 = 9+10+11 light up
    11 = 10+11+12 light up
    12 = 11+12 light up
    13 = 11+12+13 light up

    the analog ins work fine as do the digital outs.

    any ideas anyone?

    thanks : )

  65. 65 Andrew Spitz

    @dionq I have no idea why, and I can’t test quite yet. When I have some time I will check it out. In the mean time, make sure you’ve updated to the latest firmata and maxuino patch. Please let me know if you come right. If it’s urgent, go to the Arduino forum and see if anyone can help you there. Good luck.

  66. 66 Roger Alsop

    Hi

    This looks like a great tute!!!.

    I have a student who is just starting out with arduino and got a broad form ‘freetronics’ that says it is 100% compatible with arduino hardware. have you had any experience with these boards?

    thanks in advance, Roger

  67. 67 Andrew Spitz

    Hi Roger, thanks so much for the comment and apologies for the delay in response but I have been overseas with little computer access. I haven’t heard of freetronics, but I can only assume that it will work if it is compatible. If your student has issues, just let me know.

  68. 68 balam

    I have been able to make this works thank to your tutorial,
    I am using the v09 with analog inputs
    how ever I have a extrange problem
    if I turn few Analogs ins channels I get the same value that the only analog that has a sensor.
    example analog 1 has a pot.
    data moves the sliders on analogin 1 when I click on On on analog 2-3-4-5-6
    and if I move the Pot on analog 1 all the analog read the same data.

    any ideas how this can be fix.

    thank you..

    Great tutorial

  69. 69 Andrew Spitz

    Hey Balam, have you tried connecting another pot to another analog pin? You’ll probably find that it will not actually output the same data anymore, unless your circuit is hooked up wrong. Does this issue actually affect you?

  70. 70 Ryan Pittman

    great tutorial. easy to follow. thanks!

  71. 71 Andrew Spitz

    Thanks Ryan! Happy to hear it got you up and running.

  72. 72 Victor Gagneux

    Thank you very much for the tutorial!

  73. 73 Glennzone

    Many thanks for this mighty work, to Marius Schebella, Christopher Coleman, and finally to you Andrew. Your presentation was very well done. I attempted for the better part of a day to get Maxuino working, but failed repeatedly due missing details. Your instructions were beautiful.

    Thanks again,
    Glennzone

  74. 74 Glennzone

    Correct me if I’m wrong, but If I’m going to use shift registers and/or a Mux shield on top of my ArduinoMega, I’m going to need to modify the StandardFirmata sketch and the Maxuino example apps. I wouldn’t know where to begin with that. Can you offer some guidance in this effort ?

    Again, thank you. You’ve still taken me a long way in my efforts.
    Glennzone

  75. 75 Andrew Spitz

    Thanks so much for the kind words @Glennzone.

    To be honest, I’m not sure how to adapt the code to add those shields. You might want to head over to the Arduino forum and check with them there? Sorry I can’t help more.

  76. 76 Rafael Pimenta

    Thank you guys very much! It’s amazingly easy to get Arduino and Max/Msp working together.

  77. 77 Andrew Spitz

    Happy it worked out. Thanks for the comment. Good luck with all your projects!

  78. 78 Sylvia

    Hi there :)

    I am trying to set up my arduino with max msp. I am currently working on a sound installation which will use 6 audio channels that will be activated by human presence. This will happen through a pir sensor that is attached to my arduino. The sound files will be imbedded into max msp and the arduino will be connected to it as well, telling max when to activate the different sound files. I am currently having difficulties with maxuino and connecting my arduino to max msp. I am not sure how to connect them together, and where to programme each different instructions/commands. Should I do the programing for the sensor in max msp or in the arduino itself, and how can I connect the two together? Any advice or ideas would very much appreciated!

    Cheers,

    Sylvia

  79. 79 Andrew Spitz

    Hey Sylvia, sorry you’re having issues. That Arduino help patch is awesome, but can be a little overwhelming at first. I created for you a very slimmed down version of it (easier to see what’s going on). All I put is 4 digital inputs and 4 analog inputs. I got a feeling you mostly need analog inputs, and maybe some digital inputs? You can scale up by repeating what I’ve done to other pins…

    The workflow is like this:

    1. load the firmata onto the arduino (then don’t touch the arduino code again)
    2. do everything in Max/MSP
    3. that’s it!

    Here’s the slimmed down patch:

    
    ----------begin_max5_patcher----------
    2538.3oc6b18iiaaD.+Yu+UPXzGZAV6S7SIUDTfqIEEAH45hrAnOj6vBYKt1
    5hrjqj7t2lf7+do3HYK+gjn2UVVWQe37d5CJM72Lb3vgj52uYz3YweQlNF8W
    Q+BZzne+lQizmJ+DiJNdz3UdeYdnWp91FOOd0JYT13agqkI+Rl97eyjISPuO
    xKLdAJHEsNIdl2rvWPOuzKC8R7FTjT5idLNI+fj7q+Y47roSmhJeTgAQx4wa
    hzOORwIWmHSUuNurf3nG1+NnE2RzlUAQgxLs7gKN4iwQYoA+lTemNSITLU3t
    q.waxJKg0odSIJYCnhsvcp0sHJyI+Ovu1b5TKzmJKnW17kAQKpTHgKVWHgs9
    ONV5RgqVnJuspxcfullwy97DlXbkJSj2JckY76SB7BGmeg+3lax+412nlKUl
    koDejevhfLuPz5fnTTVL56+vGi9yd99nUwIRTviZMnz+u7J0WXmdQeQ.Xisc
    2ou3t3l0WDgVegoftFS05K5Ypur5W8kGzX6Rotb6E0kikl0XFcm5RPZo4kMV
    eeXhPqtHuJ0E0teTWOuTpzG4d.Skgpp.3+aVrWhOZxj+1Gi9XT5x3Mg9nYR0
    sjgRBVrLCEGgBi87q0AI2T0ClL050nY3V3obkxP2xvp3mFaDQ0ZEk4fpXXKA
    3orRYpB+N12Vj7Y0i8H1mSvYdQKF+lgU4MCmJ6k0RnROV+3aBKbW6JNjDZRR
    rpAK7tEKqjoodKjGwEkOieL1Wpb3grNIaHmhMVsvlZLjvpdAysHH7SZIcDQa
    jltf2c3YYCGHpAlrSByeNQNay7kpFZ+38cY67+ylf4+JJSlt8R06bk0K9V4Z
    7P44zmwlJvBFkj2KmnknWxKPQyXU4xeFtmouUZ2ZG+XXrpl+1aESZIVOneEJ
    mYlkpRr7TZaCbBHHvS1Va2xa1I.tA3s8UjnNelL4AYjJLa8cXMbAqfyg3g6b
    vxEmAXs9eNvxcgPf3tcNXsLGrD2udA6a.QL1YfHm9CQ0DLz+59ucRhp5JQui
    fdGE8NF5cbyAItFPxqse7aO3elvRn+FBXOicqAl39Iz8hQX88eXvziNinGlj
    klRmSe5LHNdJDT+qracROMB2xLQLb.OQa9iXXx4Bdhk0aG7X2dY3RqSB1oMt
    XCrrzTjZY5HKYDfZJmq7beDM4nE6zuCghgHW7QP4BCgjf6jQPU1QkNxAHhr5
    FBE19hLDp1XJsOXJXSQvhNfoN11lyTwUgojdfoNElVvvndqLExLnYLkeUXJt
    GXpsfCL0tCXZw.bMio8a5S9lISzIOA8C+iuKO4mJFq5bswjW2A8PcLhnj79X
    Jlwlho9oF.Q62dZ3cYt5NO6FlqlJDH7mlsaDWm9LXWQ5fsMmNhqTOpWM5P4m
    Ac3Wo9FuZzg3dFz4x3QtmFLvw0cLuX5VwktYaH+Icqu1r3EKBkMV6LT6lCoV
    SlNzcBLckj5ztccZfpypubz0XJ5OguV18ZrfgfZDhFmFm90nWtVF4iVGmXts
    ua21ahCjNQ8uBX1wsOMZb5Uzf7kOELWl1YbYYfuuL5szuq1+AQaDwbahTtsS
    ppuGYRAeJ.jpbAgxmjIo6milQi8VutxoGUoH4T8yw5Gj31smJHBNk01SknnZ
    Y4YvIU5paJu3VmkVvJYAVPQXXl1qDYpRqtHLd9uJ8q93GGqLmChNLESauru7
    QuMgYObZW46e8G8lKqsvmLi1iFuHIvONJWH1qj4mt70k2OfV0wqVYz2Qj25S
    T3TU8XS5LujbtU3ejTdwr33v8uzVUkxp2KJXkWlLK.DVh01GZvJn+tpuHv86
    xz4Iwgg68nfq7zItBzF44.+rk5mUUTpt8f0kpfwaYjxeb9jFu24x7Vjt+Y1a
    g5U0LqZy48NeSMq2uocFpZm8013tgN8quU9oaWW.6OU4dN0bPo894BKMH7gg
    GTm2vlBSXTo6vhlYcOKgYXoR+G018ZCcwV+7U0vTszFMKV5DvZbiC845TONw
    CBblglGJ8RNeSSqWqoI79ZClXmhP0gYhwpMZRFDzrL7FUuVp+ziP0TiSGXsR
    AiHnIdRGD7LUVs2ttgiM1PW6k1.bVLPRbwxtnMZxFDzLPMlmAnMonXJoaCh7
    9ChZrTKptT7nvW21n0NHlsZFOq97kY8UGRSGBBnRXjQyISKQyp9hrxzdc09b
    pq6BxMOq10DSmVlxu9ogPZ7lj4kJthfeP6Kdp3MyBh1Fx+ursk9A22tQgUkI
    9Ao4g35uM4CspvNWIVXnD6LXjXtgRLcvHw4ZarARLdvHwTCYr8fQhIe0IwXC
    kX9WcRLoij3ctn80ALKil+xCy8lurPnPe5lp4oYbp2SR+GTRfpCjG7xxRBlo
    FEX5gIQZQX7LuvhLLsM5fsCw+jIY40kYlSjRACxVSCW53DRzdpiNHeG2rCxW
    oc2QGjPx1WTn1vTry1slPqKojDZuNaWaV66kIMNg+Nc6r.BqbwxkAOrmupYd
    0wWDrrQET1FiMUpq1WtoS8RRhet57aoF7xphX4F+Ou69G9v2d+G7dJ3geBSr
    lb+c2cenW9H2tM+m+d3FYVbb1xI4S+3psm+8Q9IxmuecP1ukFb2x3H4j+cPh
    7Dk6tu68St+kn4iqegfTNTwCW4sYIqTuz8V4ImRcoS5Fj.NLk23BEgbFIW+h
    tBmU2ylfnXj20ZVsvNv5jfiqLuVN0sNvDFys4wgvzFndEvJ.RPrYbbwBBRu6
    V6yYAsl0pD0xZJmS3NjaQNhoBlvho9ub1TJlK3tU9uMa21nmDXNwJV08jx8b
    34sPls6ZKxtFkDl0Tpvg5RujnzpCPoXniRri0TrCC63dAQIg0AnjO3QIQ6u4
    hQQrSGPQ1+e+zrijFseZvV8x1KnBvJWCJuC1hMucpQakZFPKBLu5bVyzxLXo
    K59o3CX2gC9sffGmXg8F0aci3cuzic7vcOdntGoKOK4A2l731uxCoE4IeOe1
    mxCsM4A2axiQpq9UbZyZF2eZqCdU0fGV+JOspt38q7zVqKhnekm1ZcQr6M4g
    xMwdtN6Gb2yGlIxinGUX7gl.IFZBj8.SfLyl1t2roMSdDCL4gOrjGw.SeIFX
    5KwPSewFVxCsGkmAWeXFDSF1YPEBMoEoYUf+53fnrhAkhgc1G0B9bOIb1dzt
    2SG1CrQcA2a7z0Dogzh4+A.kAe3rXvW9SNo7fK.NcLt0B1bCBlKSaIP0+g.q
    VX8QWfZfXnEAjXnEinXnEEsXn4i1DMFs+BgtSnygNogMNHrQmx8XWdzEnIIw
    nZ.9LcJ5XW7QHLeAjZW9QzY2AX3C7Bu3ijyEolo8j2Vu4Nmmlgg0eRZf4qfA
    oOduCfU.RgSUt0kohYRbAtmmFqPUT74JB1Rh6c.7Q2sn2t89f8VWECRH9AaX
    t75zAaTtC1jbGtA4TOs+3l+a5t+9k
    -----------end_max5_patcher-----------
    

    Good luck!

  80. 80 Andrew Spitz

    Oh, and I forgot to mention… I don’t have an Arduino here with me so I can’t actually test it. It should work though.

  81. 81 Ralph

    Thanks, that was a big help.
    Is there a next tutorial though? I can’t seem to find it.

  82. 82 Andrew Spitz

    Happy that it helped you get setup! I keep meaning to do another one, but it’s super low on my priority list. I will one day though :-) I’m sure there’s lots of stuff out there though.

  83. 83 FRIENDROCK

    Thank you for your tutorial. But I get a problem.When I upload the standard Firmata onto my Arduino, it says”Binary sketch size: 11,856 bytes (of a 14,336 byte maximum)” and the progress bar of uploading stops at about 85%. I don’t know why and how I can do with that. Could you do me a favour? Thanks~

  84. 84 Andrew Spitz

    It’s hard to tell with no more info. Does it compile fine but then have issues when you send it over? First thing I’d do is double check that you have for sure set the right board (maybe it’s ATmega168 instead of 328 or something like that). If not, go to the Arduino forum and see if others have issues. Good luck!

  85. 85 Claudio

    Hello,
    thank you very much for all informations about maxuino.
    I’ve à Arduino MEGA2560 board and I’ve connected it to my computer by USB. I use a relay 220V to control some electric stuff. I put it on 5V, GND and PIN 2. I can switch ON and OFF by maxuino.help patch (I load the standard firmata before opening MAX) and I use another patch in parallel to change this information. I send just a message digitalwrite 1 and 0. But often I lose the connection by the serial port. Arduino stops receiving informations. The audio don’t stop, but if I want to load again the usb serial port MAX crash.
    Someone could help me please ?
    I use MAX/MSP 5.1.3 version
    And sorry for my bad English

  86. 86 Claudio

    Hello again,
    the problem was just electric ! I use now a simple light and the relay works well. So the usb connection don’t shout down anymore !

  87. 87 Andrew Spitz

    Awesome! Glad you figured it out :-)

  88. 88 juz

    hey there i’m trying for the first time to get maxmsp to control the arduino

    mac osx 10.6.8
    arduino 2.2
    board:arduino uno (set on /tools/board)
    serial port: /dev/tty.usbmodem1a21 (set on /tools/serial port)
    programmer: usbasp??? (not sure what this should be
    firmata 2.2
    maxuino _014

    when i open the maxuino-noGUI.help.maxpat it seems to be getting signal to the arduino board (digital pin13 flashes a few times the tx flashes but not the rx)

    i first select the serial portusbmodem1a21’ (the same as the ardunio setting
    on ‘set pin mode’ i enter 13 and get
    on ‘digital output’ iget digitalWrite 13 1

    nothing seems to go to the arduino!, no lights no transfer. i have checked that the arduino works from uploading simple sketches through the arduino software. it’s obviously an error on my part but i just can’t figure out what it is! any help appreciated justin

  89. 89 Andrew Spitz

    Hi Juz,

    I’m very sorry but nothing comes to mind… I can’t look properly because I have a huge deadline for in two weeks. If you don’t come right by then, please send me an email and I’ll have a look. Again, I’m sorry I can’t help now.

  90. 90 MARIO

    HI, i havent try jet but this work is amazing (begin_max5_patcher) , and ‘sound’ super!! me too have a proget about an interactive sculptur . i’ll let u know. 4 tks bye

  91. 91 Andrew Spitz

    Great stuff! Post a link when you’re done with it :-)

  92. 92 Jon Tayler

    Hey

    I’ve followed the instructions posted here, but when I try to upload the example to my arduino (uno) it refuses to compile saying:

    In file included from StandardFirmata.ino:34:
    C:\Program Files (x86)\Arduino\libraries\Firmata/Firmata.h:73: error: typedef ‘callbackFunction’ is initialized (use __typeof__ instead)
    C:\Program Files (x86)\Arduino\libraries\Firmata/Firmata.h:73: error: ‘byte’ was not declared in this scope
    C:\Program Files (x86)\Arduino\libraries\Firmata/Firmata.h:73: error: expected primary-expression before ‘int’
    C:\Program Files (x86)\Arduino\libraries\Firmata/Firmata.h:76: error: typedef ‘sysexCallbackFunction’ is initialized

    and a massive list of similar errors.

    Any idea what I’ve done wrong? any help would be greatly appreciated

  93. 93 Andrew Spitz

    Hey Jon, sorry it’s not working right of the bat. This is quite an old tutorial but should still work. Just make sure you have the latest Arduino IDE, that in “tools” you selected the Arduino UNO board and the serial port will be probably the tty… at the end of the list. And pick the “standard firmata”

    Hope this gets you rolling!

  94. 94 Jon Tayler

    Hey, thanks for your reply. I managed to get it working in the end. Found the problem was that on the maxuino website it instructed you to update the firmata included with the arduino software, turns out this wasn’t neccesary and worked fine when I reinstalled Aduino IDE and skipped that step.

  1. 1 Our Future World. WK ELEVEN. « Interactivating Sydney- Johanna Lark
  2. 2 Arduino Board mit MaxMSP verbinden « SonicSystem
  3. 3 IAT 320 project proposal « Howard Zhang's Blog
  4. 4 Arduino serial communication protocol design | Question and Answer

Leave a Reply