Forums > MaxMSP

Newbie: First patches: Random audio selection+playback & variable-time delay

Nov 16 2010 | 9:30 pm

Ok, my first ever crack at a patch.
I need one (pretty urgently, unfortunately) that at a random time (within limits yet to be finalized), randomly selects files from a choice of six. These files are then played *without* overlapping. It’s the final bit that’s causing me most headaches.
Also, the sound files don’t seem to want to play when I ask them to be read straight from a file (rather than having to manually select each time).

As a shot in the dark: Also needing to make a patch which samples a live input and delays it for a random amount of time (again, within limits to be inputted). The delay time needs to be consistent for the time something’s inputted to avoid any unwanted glitches. Am I right in thinking that I could just make a simple delay object with a random time message and manually change it before each live audio input?

I’d imagine this is elementary stuff for you all, but thankyou for any help you can give me.

Nov 17 2010 | 12:15 am

Hi derrider,

I’ve posted a patch which I believe covers the first half of the question (about random files) Please let me know if this does not do what you meant, or if it doesn’t make sense. There are many ways to do this; this is how I think I would.

— Pasted Max Patch, click to expand. —

As far as the delay, it depends on how you are deciding on when each live input segment is considered started and stopped. Setting up tapin~ and tapout~ and manually triggering would work if that’s what you want to do, but if say crossing a low amplitude threshold for a certain amount of time signifies the end of a live input segment, then you could automate it that way. (or the same with any other cues)

Nov 17 2010 | 5:08 pm

This is fantastic – I can iron out everything from here (non-overlapping samples…etc).

I see exactly what you mean with regards to the delay.
As the delay will only be needed seven times in the project I\’m using it for, maybe 7 separate delays, all with different possible times, can be connected to 7 audio outs – enabling overlap of the delayed signal (which will only repeat once), should this occur.
I could then just click to the next delay after the input has occurred, letting the wet signal happen whenever it does whilst guaranteeing the next delay is ready to go.
Am I missing something here?

Thank you so much for your help, I’m really extremely grateful.

Nov 17 2010 | 5:29 pm

You’re very welcome, glad I could help.

That sounds to me like a good solution for the delays.


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

Forums > MaxMSP