how to Trigger object when the bang is off vs on

Jul 28, 2010 at 5:26am

how to Trigger object when the bang is off vs on

Hello this I feel Is somewhat a simple question. but haven’t been able to solve it. I don’t understand very well
how the if statements work in max msp.

I have a gate object that outputs a number that is going from 0 to 320 in various sequences, if I attach a bang to the same outlet the bang stays On if the number is moving , as soon as the number stops moving the bang turns off. This is great.. my question is what object do I need to detect the bang when it turns off and detect it when it turns on

so I can trigger different events when the number stops moving(bang off) from when the number is moving(bang on).

thanks for the time.

#51544
Jul 28, 2010 at 6:34am

oh je. ^^

a bang in max is nothing but the message “bang”, just like the
message “hello” .. it does not turn on and off … unfortunately
many newbies are mislead from the [button] object´s behaviour.

what you want to use to find out about the densitiy of incoming
events is the [timer] object (in conjunction with [if] or [==] when
you want a true false output for activity.)

[timer] is not easy to use at first but it is worth the hassle.

-110

#184876
Jul 28, 2010 at 8:31am

thank you

#184877
Jul 28, 2010 at 4:42pm

here's a solution which doesn't use an expression or a timer, just some conditioning using [maximum], [-1], [select] and the inevitable [onebang]; selecting peaks and troughs is a common head-scratcher and has eluded me for some time so i'm glad you posted this question; some may find this one a little convoluted, but it's as minimal as i can make it:

– Pasted Max Patch, click to expand. –

Brendan

[attachment=137713,878]

Attachments:
  1. startStop.jpg
#184878
Jul 28, 2010 at 4:49pm

ps
for better functionality on startup, the [onebang] object on the lower right should NOT have the argument ’1′

ooops

#184879
Jul 29, 2010 at 1:31am

thanks very helpful

#184880
Oct 11, 2013 at 10:36am

Great solution Noob_Meister !

#267772

You must be logged in to reply to this topic.