Detecting multiple bangs within set duration?

yworrybehappy's icon

Hi,

First post, new to Max. Running Max 6.1.3.

I need to outbang when bangs from two other objects happen within a certain amount of time (1000ms) from each other.

In other words, I have two functions that outbang when certain things happen. I need to outbang when both of those things happen, within 1000ms of each other.

Thanks a ton! Much appreciated.

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

this should do what you want

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

Calculate the difference between the time of occurrence of the two bangs. If it's less than or equal to 1000 ms, then bang.

yworrybehappy's icon

Wait, I am confused! How do I open these posted max patches? I've copied the code, selected 'new from clipboard,' and opens a coll looking thing opens with the copied text inside. How do I open this up as a patcher in max 6?

Thanks!

Christopher Dobrian's icon

Did you include the first and last lines?

----------begin_max5_patcher----------
and
-----------end_max5_patcher-----------

Or better yet, just click on the little icon to the right, and it will copy the right stuff to the clipboard for you.

yworrybehappy's icon

Thanks Christopher! That was silly of me. Thanks, both of these solutions work great.