Need Help with a project!
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 :]
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.
----------begin_max5_patcher---------- 1634.3oc0Zs0aaaCE94jeErduzN33wK55JPQGJ1.J51dXauMLTPaQ6nVIRWI 5boEs+1GuXk3zZKKQlnnBzZURoJdNe76bU7Smdxj4hqX0S.+L3eAmbxmN8jS LSom3jsiOYRI8pEEzZyiMgytTL+cSlZukjckzLcgflUxpqAnlaI1HKXR40qY 1W+jIf+a6sxyL+eTumyvQMO+RAWxoklmdxuTkSKZtyZpbw447UushsPZeYQg wyfSAAIP8kHr9WTxL3MKAeSYNWs9FgFc6jVo5NypW357OZVXj58om8ymdp9m o9AJxVPibtb+.RnS.RXbpAPHQ5K3QJfnYIyo7UGDUL2buvBxMdBxfGAXj9R3 iMrv9XFcwWl7spGBd781PjcKNr428qD38pDtHsZ6Y5J12rKJVy3fEmypDumw lQyW1OS9Pu1ICLfPRhYmLpefvCOAud45B50e4f.Rc9JtVMaio6k8ebhku2NQ e+vC9.vy1oqoWznF+vepUgaTV0FsZ0T+ACSiTKLzNyjmqTPGv1EhxRlx83WC tKD7KXURfT.lmyoUWCdpfCn7LfX4Rv57qXE0OyLNS.pEkL.WjWy.UrrMKj4M OqTwbA77kxqARMJVCd9yZVqhbNagXC2rfjucygj3ztCgXLZIolKnP6lDpe9g f2er2Cgvu52e8qdC3O9UPsBE3YO4I6wUEwsH1n.q8arEAft3IdHQfe60+0e+ O6G.byAFFZ.fjvwM.n8KAD7ELP9RPonhoLRnbPHDB2ZhAnpIE7mCVRKJ.yYE hKuysqX0LYmMnHtAlwFObQjcQyGQCpCl.379mpC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orpqT3nBa7vxxLKG5XxTT O8pnb8GNs43lr6Hek1tv.iQCOBB6BB1CCUDJ0hY1OWpJYzlQ9JscwQGJzo86 f.zN62A1CVjeVLcPXCFzc6NYCmLrDvtfRoCpHo603wYYCaH9tP7iGTIJnKfT OsDQlnUHD1d41QC.5EMr7dx8O7MHNWiFVYpKrrX73yiU7v5XG0IqQxvJScI4 LzvhS3ztjw8v5I.2kfx3g04NA1UbpOoERrsSHY6YyEdyHeQvtv9ICaocFY5X re7HLwFrOVjpAe9z+Gv+T3EF -----------end_max5_patcher-----------
And since you said you are new, check this post to figure out how to deal with the above mambo-chambo: http://cycling74.com/forums/topic.php?id=26095
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?
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~….
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!
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…
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!
check helpfile for sfplay~, it tells you the file formats it can use. probably just convert to .wav or .aiff and use those.