Bang after inactivty

Jason Orri's icon

Hi guys, I've tried searching for a solution but this topic is hard to articulate in an easily searchable phrase, so I found nothing.
My problem is I would like to trigger a bang in button A. if there hasn't been a bang in button B. after an amount of set time e.g. 15 seconds.. I don't want a metro for 10 seconds on the button A., but to ensure the patch is measuring the inactivity of button B... if button B does bang the inactivity time is set back to zero and no bang in button A occurs...

Hope that makes sense... any ideas would be helpful

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

Sorry guys, figured it out:

Medd's icon

I'm not sure that's how I'd do it but I'm not sure I fully understand the context of the patch.

Either way, I'd use a [sel] instead of [route] at the bottom.

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

Or maybe something like this?

Jason Orri's icon

This is actually really helpful. Much more efficient and I've implemented it in my patch. Thanks very much! Just out of interest, the patch I posted above doesn't work as, for some reason unknown to me, when the counter resets it doesn't always go back to 0, sometimes it will start at 44 or 55 etc and so my route, or sel (thanks, dickmedd) doesn't work.... why is this??

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

This might be clearer, it keeps picking up a 27 or 24 instead of incrementing in 1000s..

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

As stated in the reference, reset resets the time, but doesn't restart the metronome. What you should do is first send a 0 (to stop the clocker) then a 1 to restart it. Like this:

Jason Orri's icon

If you let that run, you'll see the problem remains... strange. I get that you'd have to click the (0, 1) twice to set it back to zero but is there a way to make the whole cycle independant... so it will always just go back to zero and count upwards in 1000s, as it stands it wont do that. Thanks for your help :)

Jason Orri's icon

Is there a way to simply trigger a bang if the clocker exceeds 15000 rather than just that specific number via select?

Chris Muir's icon
Max Patch
Copy patch and select New From Clipboard in Max.
Jason Orri's icon

Awesome, thanks so much.

williamjturkel's icon

You might call this the 'Lost' mechanism, after the button that Desmond Hume has to press every 108 minutes to avert the end of the world http://en.wikipedia.org/wiki/Orientation_(Lost)

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

How about letting the Max scheduler take care of it for you, by using the delay object?

Jason Orri's icon

What an elegant solution! Also, william, yes, that's exactly how this feels.