Forums > Jitter

Need Help with a project!

April 26, 2011 | 3:58 am

I’m trying to use my built-in camera on my Mac to detect motion on max msp, when it detects motion I want it to be able to play an audio file, can anyone help me on how to do this? how do I pull up the video feed in max? I’m an UBER NOOB so any advice would be very helpful :]

April 26, 2011 | 5:44 am

Have a look at this little patch. Put some comments in there. If you are stuck or it’s not what you were looking for let me know.
The audio is the simplest way you can do it. It’s not smart at all and chances are you will get clicks if the audio is restarted while the file is still playing. There are ways around that, but I don’t want to take all the fun away from you ;)
Again, ask if you have questions and post any patches in progress.

– Pasted Max Patch, click to expand. –

And since you said you are new, check this post to figure out how to deal with the above mambo-chambo:

April 26, 2011 | 7:40 am

Wow man that patch is just what i was looking for, but your right, i need a way around this piece restarting over and over while the person is still listening to the audio, see what is happening is the person is sitting in a chair and when the webcam sees the person the audio starts playing, this is an amazing patch thank you so much, can you help me to get around that repeating problem?

April 26, 2011 | 5:30 pm

Did you go through the patch and understood all the things that are going on? If so the solution should be very easy. Have a look at the onebang object, what does it do? why did I put it there? now look at the right outlet of sfplay~, what does it do? knowing what onebang does, the already generated bang from the video and the right outlet of sfplay~….

April 26, 2011 | 11:34 pm

I figured out my problem! 5000 pixels of detection was too small, for instance if the person moved their hand to scratch their chin it would restart, I need to maximize so that the person could shift a bit in the chair to get comfortable without the whole thing restarting, but I still needed it to pick up rapid pixel movement, like when they get up and in the chair therefore i reset the pixel count to 100,000. I plan to mimic this patch for my project, is that palgerism? how can i go about this without getting in trouble? I will of course alter certain things. please get back to me on this and thanks again!

April 27, 2011 | 12:05 am

this is fairly standard stuff, I don’t claim any authorship on it. But to be safe you might want to credit the cycling74 forum… maybe link to this post or any other where you got help. I’m sure I learned it from someone here in the forums as well, years ago ;)

Also, I would suggest that you NOT copy and paste the above into your project. Rebuild it from scratch!! First of all, if you rebuild it you will have a better understanding of the inner workings and if your teacher should ask how it works (as to check if it is really your work – which I like to do with students once in a while) you will have good answers. Also different people have different patching styles. I don’t know yours, but it might be obvious that this isn’t your patch…

April 28, 2011 | 10:21 pm

Thank you very much! All I need to know now is can i take an itunes file and use it in this patch as the music, is there tutorials for this or not? Please let me know! Thanks again!

April 29, 2011 | 1:15 am

check helpfile for sfplay~, it tells you the file formats it can use. probably just convert to .wav or .aiff and use those.

Viewing 8 posts - 1 through 8 (of 8 total)