Stop audio files overlapping?

Jamcob's icon

I've got some sounds triggered by a random object but is there anyway of making it so when one plays it stops any others from playing?

Jamcob's icon
Max Patch
Copy patch and select New From Clipboard in Max.

this part of the patch...

Floating Point's icon
Max Patch
Copy patch and select New From Clipboard in Max.

I haven't tested this but it should work in a clunky kind of way

Max Patch
Copy patch and select New From Clipboard in Max.

edit actually this is clearer/neater also onebang inited

Jamcob's icon

Thanks for the response, but that doesn't seem to be working.

Jamcob's icon

Oh didn't see your second patch, I'll try that

Jamcob's icon

Not doing what I need it to do, I want the audio file playing to stop when another one is triggered to play

Floating Point's icon

well that's not so hard, just send a stop message to all your playback instances just before you send a play message to the one you want to play

Jamcob's icon

I don't understand what you mean, if I put a stop message before the sfplay it will interrupt the signal path from '1' and then it won't play anything.

Floating Point's icon

use separate patch cords (thats what theyre for).

but also you should really study the sfplay~ help file and you'll see there's a more elegant way of doing it by preloading cues and jumping to different cues by simply sending the assigned cue number

Jamcob's icon

I'm still not completely sure what you're talking about, is it possible to show me?

brendan mccloskey's icon

Hi
the Cycling74 elves have created an extensive support network, of which this forum is a small part. Right click on any object and open its helpfile, there you will find 'common-use' examples of the object's application. Look at the 'See Also...' dialog too. This way one learns to extend, adapt, improvise and improve. It is a simple and fun way to learn Max.

It's also common to presume that one's own implementation or problem is unique and urgent and therefore only solvable via the forum. This is an error. The helpfiles are the quickest and friendliest method, plus one doesn't get old irate people complaining.

;)
Brendan