number List analyzer

mrdirty82's icon

Hi,

There is an object that recognizes if a previous list is increasing or decreasing ?
for example, i have following list:

12 12 12 14 50 52 50 53 53 ---> increasing
53 53 54 57 57 50 12 12 12 -----> decreasing

How can I difference this lists in maxmsp?

Any Idea, I´m trying to analyze with "zl group" and "if" but I´m going crazy...... i think there is like always an easier solution :)

Thanks!

Dario

leafcutter's icon

your decreasing list first increases and then decreases, is this intentional?

I would say you calculate the delta for each value in the list, then add them all together and if the result is positive then your list is increasing.

Show us what you have done so far.

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

Does this help you in any way?

mrdirty82's icon

Thanks for your answer. Yes, it is intentional because of the sensor input.

I think I found a workaround. But I should be a better way.

The Idea is to play a Video once the sensor has been touched and stop it (normally I read a black picture) when is not touched...

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

What do you think?

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

Ah so you need to detect change in a stream of data not in a list as you said in your first post. Functionally it looks like your patch is doing this:

If it's working I wouldn't worry about it. If not record some data into a coll (with the save data in patcher box checked) and post it here and I'll have a look at it for you.

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

...and if you want to avoid false triggering a little smoothing on the input might help

mrdirty82's icon

It seems to work stable. If i have problems in the future will try saving the data into a coll.
Thanks for your help!