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.
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.
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:
----------begin_max5_patcher---------- 880.3ocyXsrabBCEc8Do7OXg5xIQbs4Y+P5lpnJfwIgVvLBLJoMp+60OfIjo CAyqP1fGL1vwGeN9duyKWe0Nq3hmoUVnuh9NZ2tWD8rS0mrmcscryJO54jrn J0.shq47Bl09lmwpyKp4YTt5oPa2oGTCtH9m2PvmFrdj7eejp+lVwQrGrP20 97ikzJJiGwSKX+njlv0CCBt0dOBaCxF6lKclUDO4wT1CclQ2IfCau95TDnNk cBzpN+60WIaEM6MlKXzmDqvSKON8YtdYynxUFBN8n6KXbVTtZca8MZ4gHVTO bH9RbHL.Gt2TtDikrAg3bYtThypz+nd2fbnCvwDhmrwW85vPubLdxbbRQdtX c7+jrfypn2TkTVjkIPF5ozrLTRjnSTdcFO8XFEI4jJTDGEWHTs4nL58u9lDy hlTTy3ug0GwNk8k1orsFRM6njkDX16..wWNcvUcMT8tj6GKtNezddb3b87Z5 g3OROeyD1.Oexih0EcJFdxkHvf9IPoYOU5HzMS27Fnt5Nj2EVduaEkiNRi9k 0B45vdVSw+DnDKM1HOX03AwqIlVtTACvj90FM5hy7XigSzAHvDkmy0d83jd7 QUzLIXVJtBObfy4QTdtczPqRDv9XpalV9EW57ZH38kTSigzYE.d5.S3acWKB ZQsWf+JZuBToKsYlKwfRyqyWLpZ3Shlt5oweYqDQ9vpYuFcxM.L6jav5ravt lmci21ldyhWRS3nqnY71rUu3jQqcbLW5z2pBaau1Zf4edZ7CIEYEkZbaeKA7 8b7kp7.+.GBH+UnCH5UDen6JnakTq9wvfNkuU7b3bZUUTmpBNYmDevu.xsR6 kJD96jnyb3HcMB95BMC+.ytQVc9hEm58KlZVZHrpwwa.MD4LBROL0p77+.N0 2Rs7eKsUUTWlzh6liPQc9dGnU7TlJVSmAI+qiPvqi5wzCGnr2THUd5giEBOU CPP20+lowXS9u9YH3r+vAmr5ZC.GdS.24bxkAGNbS.mL4XC.WvXAWnqr5.OU LMvu82KylsQJwvw5R.BHgIArkMfq8o6VFTSLhn2FIJXF3Helkn3wtgqkn9DU YrNgs2rLddSfLrQ7YfwfC9jtYCS77Hw9q77n.R6MejBzMYy1nTJfsIpsiomi uAwrMAZNai80nTc1lzvLRrManI6Pz7O.6Xs0TC -----------end_max5_patcher-----------
for better functionality on startup, the [onebang] object on the lower right should NOT have the argument ‘1’
thanks very helpful
Great solution Noob_Meister !
Forums > MaxMSP