simple question about lists and bangs?

seanzshow's icon

Hi,

I have a list of numbers (integers) coming from my patch that cycle from 100 down to 0 then back up to 100.

What i want is to generate a bang when the list reaches 99 on its way back up. The problem is it first has to go through 99 on the way down, from which i want no output.

I have tried using sel 99 and a togedge so that i can take bangs from the togedge's output 2, but this only seems to work first time when Max has been shut down and re-opened. If i try to do it twice it seems to get confused!!?

Im sure there must be a more reliable way?

Any help would be greatly appreciated.

gusanomaxlist's icon

Try [past 99].

Ciao

Luke Hall's icon

You need to analyse the number stream to figure out which direction it is going in and then use this to gate your selection. Here is a method that does what you're looking for, I've made it so that you can change the direction and selection integer. I hope it helps.

lh

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

seanzshow's icon

nice!

Im sending some good karma your way!