Bang on the first time, not on the second.

musicmovement's icon

Hello,
I'm looking for an object or abstraction that will sequentially receive integers and produce a bang only at the first occurrence of that value. Repeated values should not produce a bang. I first thought this would be possible using zl or change, but I couldn't figure it out.

The idea is to track the first occurrences of numbers 1 to 44 and ignore any repetitions.

thanks for any help,
sincerely,
marC

AudioLemon's icon

I wonder could you put the numbers in a coll and then remove them when they are seen. Don't know really but I guess I'd try that.

Mehmet Can Ozer's icon

Hi, did you check the "change" object? It seems that the object provides what you need.

Best,

Mehmet Can

Luke Hall's icon
Max Patch
Copy patch and select New From Clipboard in Max.
MIB's icon

have a look at the "histo" object as well.

spokeNine's icon

I have a similar question. I basically need a change object that will output a bang if the numbers DO match, so my patcher can try again with a new number.
I'm kinda surprised the change object doesn't do that.

this is not so elegant, clumsily depending upon R->L

Max Patch
Copy patch and select New From Clipboard in Max.

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

or

Max Patch
Copy patch and select New From Clipboard in Max.

or...there are many ways to skin this cat.

musicmovement's icon

Thank you for all your great suggestions. I went with Vanille and MIT's suggestion to use histo. Works like a dream and very simple.

best,
marC

spokeNine's icon

Thanks David.
I like skinning a cat with an if...then statement.
If the cat is skinned randomly while nobody is watching then the cat is both skinned and unskinned at the same time.
There are no objects for that.