bang only on first change

Nov 15, 2013 at 1:43am

bang only on first change

Hi guys. I have a patch in which I would like to have a midi slider be divided into 5 different functions. I have successfully split the ranges, now all I need to do is drop out the constant banging which is still being sent from my slider’s value and focus my attention only on changes between the ranges. I have seen people coming up with interesting ways to compare numbers, sending out a bang when they are equivalent, but only once.

I think I need to somehow keep track of the last number (split range) keeping it available and as the newest number is triggered perform some kind of comparative operation between the two. Any ideas?

Here is my max patch

<code>

– Pasted Max Patch, click to expand. –

</code>

#271298
Nov 15, 2013 at 1:58am

Maybe with a change, like this:

<code>

– Pasted Max Patch, click to expand. –

</code>

#271300
Nov 15, 2013 at 2:27am

A [bucket] is one way to keep track of previous numbers.

<code>

– Pasted Max Patch, click to expand. –

</code>

#271301
Nov 15, 2013 at 10:34am

wow, Thanks guys. Incorporating now

#271331

You must be logged in to reply to this topic.