Forums > MaxMSP

Send Bang when when maximum value is reached.

May 21 2013 | 2:06 pm

As so often I need your help to solve a very banal problem:

A Stepper-Motor controller sends out the position eg. 856. If the motor stops and turns around in the other direction it goes 855,854 and so on..
I want MAX to BANG if the maximum is reached (here: 856).

How ca this be made easily?



May 21 2013 | 3:07 pm

[select 856]

May 21 2013 | 3:20 pm

Yes, but the numbers is just an example.
At least I need to trigger the counting peak which alters.

May 21 2013 | 3:55 pm

Ah, so you don’t know what the maximum is, you just want to know when the direction changes?

[change -] and [change +] indicate direction. A little work will have to be done to capture the maximum number, as this reports after the direction has changed.

May 22 2013 | 12:41 am

In this case, change bangs when the Number is smaller than the number recieved before. But I want just ONE bang after the maximum value is reached.

May 22 2013 | 1:04 am

There’s an off by one error on the high number, but this gives you the bangs:

-- Pasted Max Patch, click to expand. --


May 22 2013 | 4:33 am

Thank you.. this seems to be what I need.

May 22 2013 | 4:36 am


May 22 2013 | 5:55 am

If you know the peak value you’re looking for, you can use sel or >= or peak or past. If you’re just looking at a stream of data coming in in real time and you don’t know what value you’re looking for, then you can only report that a peak has occurred after the peak has been reached, once the input value has started to decrease. This abstraction does that.

-- Pasted Max Patch, click to expand. --


Viewing 9 posts - 1 through 9 (of 9 total)

Forums > MaxMSP