Preventing one audio buffer from overlapping another audio buffer

Joe Gould's icon

Hello,

My name is Joe Gould, and I am doing a senior project where I use Max MSP to create a dance and music performance. Because I am new to the software, my goal is to create regions in my webcam that detect motion and trigger music from audio buffers.

Currently, I made two regions in my webcam that trigger two different audio clips, but I do not understand how to prevent them from overlapping each other. What are the best objects to solve this issue and where does it fit in the flow of my patch?

Any advice would be great, and I linked my file at the bottom of this message if I did not explain my situation clearly.

Gould_Senior_Proj.maxpat
Max Patch

LSka's icon

If I understand correctly, you want to stop one audio clip when the other is triggered?

To simply stop, you can put a [trigger] object right after the [sel 1] and send a "stop" message to the other [groove~] before sending the "startloop" message. (see the [trigger] helpfile to understand how it works.

Or, if you'd like a more "elegant" solution (just a little bit more complex), you can add a [line~] (still triggered by [trigger]) in conjunction with [*~] to fade the output of [groove~]

Joe Gould's icon

Hi LSKA,

Would I take one of the outputs that goes to a message saying stop, and take that output and send it to the input of my other groove~ object? I'll try this out and keep you posted.

Thank you for the advice!

LSka's icon

here's an example

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

Joe Gould's icon

Hi LSKA,

Your patch worked perfectly! Just so that I get a better understanding of what the trigger object does, what does the "b" stand for? Is this like a symbol or attribute?

Thank you so much for your help! Here is my patch if you wanted to play around with it yourself.

Gould_Senior_Proj.maxpat
Max Patch


LSka's icon

trigger ouptuts messages in a specific order (right to left, which is the standard order in Max).
the arguments specify which kind of message to output. b is the short form for "bang" (bang is a special message that is used to trigger other events). You could also write [trigger startloop stop] and trigger would output "stop" from the rightmost outlet and "startloop" from the leftmost.

In the helpfile (right-click on the object and select "open helpfile") you'll find lots of examples

Joe Gould's icon

Thank you for taking the time to respond. This information is helpful!