Using ping sensor data into MAX/Msp to play videos


I am a visual arts student, and I would need some help with using Max MSP in conjunction with Arduino. I am developing my final project, and this is my first time working with Arduino and Max MSP. I have no prior experience in computer programming. For my project, I creating an interactive piece with video wherein a ping distance sensor causes the switch from one video clip to the next in response to the distance values of the ping detector (for this, i would have to associate specific distance ranges of valuess with a corresponding video clip).
I would need help to create my patch for Max MSP so that it can read the data from Arduino (that would be data from a ping sensor that measures distance), and, according to the distance measured by the ping sensor, play a specific video clip.
When there is no data measured, a continuous video loop would play, such that only when an obstacle is detected at a specific distance does Max MSP play a particular video (I want to associate different distance ranges to different video clips).
Here is a picture of the Max patch that I have so far:

I have the Arduino2MAX patch already that I'm working with (on this page: Arduino Playground - HomePage).

I need help with 3 things:

  1. How to make a specific range of distance data from the sensor cause a specific video to play in Max/Msp (that's the part I can't figure out given my very limited time before project due date)

  2. I have this ping sensor

which sends a digital signal; but I need distance values, so I must find a way to convert digital input into distance values

  1. Every time I close MAX/Msp, my videos are no longer uploaded, so I need to re-upload the videos each time. I must find a way to save the videos onto max so that i don't need to re-upload each time.

I appreciate your help. Thanks.

1: google first hit:

2: google first hit:

3: google first hit:

Hope I don't sound to terse! However, I think you'll be able to get further with a bit of reading, that is, opposed to writing. :wink:

  1. I already saw this page, but I'm referring to using MAX/Msp! I'm asking about how, IN MAX/msp, to make the MAX patch so that the data I receive from Arduino can cause a specific clip to play...I need help here with MAX.

  2. This doesn't help, because once again, at this point, I'm working with MAX...the code that I downloaded on Arduino simply makes it so that all the Arduino pins can be read on MAX/Msp. The problem is that the ping sensor gives a digital signal and so on my MAX patch, all the digital pins are read as 1 and 0s, so I need help to modify this on MAX or to modify the Arduino sketch (the one from Arduino2Max that I gave a link to: Arduino Playground - HomePage).

  3. I searched the forum and have not found an answer to this very simple problem. Apparently there is a message, "@autosave 1" that you can use next to but it doesn't work.

Your problem is that you are asking about an MSP problem in an Arduino forum.

All the Arduino will do is send and receive serial data.

If you want to send data from MSP that is an MSP problem.
If you want to receive from the Arduino in MSP that is an MSP problem.

I would suggest you ask on an MSP forum because that is where you have the problem.

I did (obviously) submit a post to the MAX forum, but they have not posted it on the forum- they say they need to review all posts before putting them up on their forum. It's been a few days and I need urgent help, so I have tried my luck with the Arduino board, but it seems no one can help.