Forums > MaxMSP

Controlling playback of a loop with arduino analog input values.

June 9, 2009 | 5:58 pm

I posted on here a while back looking for help getting analog values into max using my arduino, and was advised to get this info from the arduino forum. Have done so and can now read the values of my LDRs across the analog inputs in max, however, I am pretty new to max, and am just working through the tutorials. However, with my uni deadlines fast approaching, I need to find a way to take these values, and use them to control the volumes at which a couple of loops play back.
Is there a simple patch in which I can load some loops and somehow attach the values from my light dependent resistors to control the volumes of these.
I am reading the arduino using the max test patch that comes in the maxuino download, and have followed this tutorial to get this far http://www.soundplusdesign.com/?p=1305&cpage=1#comment-1529.

Thanks!

Toby


June 9, 2009 | 6:50 pm

No one is going to write your patch for you (or at least they shouldn’t given that this is an assignment), but fortunately what you are asking is covered very well in the tutorials and help files.

For playback look at [sfplay~] or [groove~]
For volume control look at [*~] and [line~]
For dealing with your data look at [scale]

Hope that helps some.

David


June 9, 2009 | 8:01 pm

Cool, thanks, I have already looked through some of those, but will read through the rest, I have been working my way through a few of the tutorials in the help menu. I also understand I’m going to need to use a scaler object to apply the values somehow.
I was by no means asking for anyone to build me one, but if something capable of playing back a couple of wavs or other audio file is available then I would be very grateful. My degree is an art degree and a project I have undertaken on my own, not an assignment, but I want to use it in my portfolio, and use it for an exhibition outside of university. I won’t be being marked on my use of max, or even indicating that is what I have used, it is the quality of sound and the nature of the interaction that will be being judged. I certainly didn’t mean to give the impression I was trying to cheat, with max I am working in an area outside what is taught on my course so this sort of ‘cheating’ would be allowed.
Thanks very much for the advice, I will endeavor to do my best in building my own patch but am currently a little daunted still, and am aiming to complete it for an exhibiting soon. If anyone knows of a mixer type patch or simply a patch with playback and volume which I could use multiple times for the different files this would be really helpful.
Cheers


June 9, 2009 | 8:02 pm

Sorry I see you’ve mentioned scale there too, didn’t spot it.


June 10, 2009 | 4:02 am

Have you looked at the sfplay~ help patch? It plays a sound file and has volume control. All the help files are actually patches, so unlock, select the item you want, copy, and paste into a new patch and start building from there. When you get stuck, then let us know specifically where you are having problems, with a patch showing where you are stuck, and I’m sure people will be more willing to help. I know Max can be pretty intimidating in the face of a deadline, but focus on the objects I mentioned before and you should be able to have something built in a couple of days that does what you want.

Again, specific questions (with patched) tend to get much better results).

David

P.S. It seems a matter of semantics between asking if someone has built x already vs. asking them to build x.


April 28, 2010 | 4:31 pm

Hey Toby

I’m doing a similar project for uni at the moment and am struggling a bit. Do you have an online presence for the work you created, or could you give me a few basic pointers in setting up LDR’s with arduino and Max?
That would be really great

Matt


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