making sound trigger sound without the sound triggering itself max msp

maltevelin's icon

Hey i think the title explains my problem... i need to make sound trigger sound (through input) without the sound triggering itself (at the output) max msp.

So basically when u clap or say something in front of the computer, a random sound will trigger - but the sound itself wont trigger a new one.

This is what i've got so far :)

I appreciate any help on the topic

Best regards Malte

2815.Untitled2.maxpat
Max Patch
Eav's icon

Hi,

A quick search through the forums:

There's a lot of ways to get what you want, but i noticed you've asked the same question a couple of days ago. I'm not an expert myself, but if i were you, i would definitely take the time to go through the tutorials. Some basic objects and a bit of trial and error will get you where you want to be.

Good luck.

maltevelin's icon

Thanks but the question i asked before is not at all the same. Im sorry if i described it poorly... i solved the other problem but this one is still bugging me.. cant seem to fix it.

Eav's icon

Sounds a bit the same to me though. So, this random sound, you mean a random note, or a random sound from a folder on your computer....?
What you have now seems to be correct to me, outputting a random note number between 0 and 49, with a fixed velocity and duration.

Not sure if i would add the left and right channel input together (your +~ object) though.

So what's your next step? Do you mean that the sound that's been triggered coming from your laptop speaker shouldn't trigger a new sound? If that's the case, what about following this route: since you know how long your triggered sound will play, you can use that length/info to "block" new input to your microphone for that amount of time. Probably a few ways to do that, but it's more fun to look for that yourself.

Does it help?

maltevelin's icon

Yeah that helps a lot man! Thanks! and to ur first question i want it to play random soundfiles from a folder.. i havent managed that but i think i can find out how by reading more tutorials - if u dont wanna spoil me and tell me :)

Eav's icon

Good.

sfplay~ and umenu are your friends here. And note that sfplay~'s right output sends a bang when your file is done playing, so that's probably the easiest way to open the gates (pun intended) of your sound input again.

Enough spoiling for now :)

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

Here is a beginning. As I couldn't figure out what you wanted to achieve with this random piano stuff, I replaced it with a random file menu.
Note that I'm also a beginner so that might not be the smarter way to do it. And you'll have to sort out the gate system on the input because I have to make dinner for now !

maltevelin's icon

Hey Stephane! Thanks for the code. However i dont understand why it doesnt react to an input?

Stephane Morisse's icon

It does. did you toggle on the metro ?

maltevelin's icon

yeah but it still doesnt work :S

maltevelin's icon

it says: sfplay~ bad argument for message "open"

Eav's icon

That's probably because the umenu refers to a folder that doesn't exist on your computer (and that's obvious). You have to point to a folder on your computer In the inspector of umenu.

maltevelin's icon

already did that. Still not working ...

maltevelin's icon

got it workin.. dno how but suddenly... magical :)