Arduino + MAX/MSP

Apr 4, 2010 at 8:11am

Arduino + MAX/MSP

Hi! I’m a total newbie, and i really need help with a project that uses both MAX/MSP and an Arduino board.

I have to complete a project where there’s a toggle button that alternates between two sounds… i.e. When I press a button on the arduino, the toggle button on MAX/MSP turns ON and it plays Sound 1, and when i press the same button again, it’s turned OFF, and it plays Sound 2. I’ve already sort of got the MAX/MSP bit figured out (if you press the toggle button on maxmsp it alternates between the two sounds), and i just don’t know how to get my arduino board to talk to the patcher. I’ve uploaded the Firmata to my arduino board, and i’ve got the button set up, but i just don’t know how to integrate it such that when i press Button 1 on my Arduino, it interacts with Toggle Button 1 on MaxMSP. Did that make any sense? I’m very new to all this so i kinda need explicit, step-by-step directions! :s

Thank you!

#49524
Apr 4, 2010 at 11:21am

If your Max patch is functioning the way you require, then that’s half the battle. When you say ‘Firmata’ do you mean Maxuino or some such? This is an extensive program that reads all the analog and digital inputs on the board, and also a Max patch for reading the serial data. If, as you say, you’re a newcomer to programming, then troubleshooting the code will be a little tricky. If you spend some time with the Arduino tutorials, you should be able to write your own simple program for reading a switch yourself. I’m not in front of Max or Arduino at the moment, but for the time being see if the [onebang] object helps in your Max patch. If you can hang on a few days I can write a suitable program and patch for you.

#177967
Apr 4, 2010 at 3:46pm

Look at the Serial Call and Response example that comes with the Arduino. There’s a Max patch in there that you can easily modify.

#177968
Apr 5, 2010 at 4:16am

Brendan: I’m using Maxuino… or rather i’m trying to! I’m not too familiar with the programming bit which is why i’m having a lot of trouble and the project is due next monday… if you could help me with a patch i would really really appreciate it!

Scott: Thanks, i’ll look into it!

#177969
Apr 5, 2010 at 10:41am
#177970
Apr 5, 2010 at 10:57pm

You might also have a look at my SensorBox firmware: http://pixlpa.com/blog/arduino-sensorbox-firmware

The intention was to create a simple and straightforward patch and firmware that reads the inputs of an Arduino board. The Firmata project has made a lot of progress recently, but it might do more than you really need right now.

#177971
Apr 6, 2010 at 12:22am

read up on something call switch debouncing too, it might be helpful.

#177972
Apr 6, 2010 at 4:44am
#177973
Apr 9, 2010 at 1:57pm

Thank you guys so much. You’ve been really awesome! I managed to hook up my arduino to Arduino2Max and the buttons are responding! The only problem is that now, whenever i open a file, the sound comes out all weird and distorted and I don’t know enough to figure out why. I’ve attached my file for reference. I’m sorry i’m being a bit of a pain in the bum!

#177974
Apr 10, 2010 at 10:43am

Tested your patch and it works fine, no distortion or other issue. Check your Options/DSP Status; i've attached a screenshot of my own settings

[attachment=129510,349]

Attachments:
  1. dspstat.jpg
#177975

You must be logged in to reply to this topic.