Send Bang when when maximum value is reached.

May 21, 2013 at 2:06pm

Send Bang when when maximum value is reached.

Hi!
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?

Yours

Brantiko!

#250164
May 21, 2013 at 3:07pm

[select 856]

#250170
May 21, 2013 at 3:20pm

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

#250172
May 21, 2013 at 3:55pm

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.

#250182
May 22, 2013 at 12:41am

Hi!
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.

#250212
May 22, 2013 at 1:04am

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

<code>

– Pasted Max Patch, click to expand. –

</code>

#250219
May 22, 2013 at 4:33am

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

#250234
May 22, 2013 at 4:36am

past

#250236
May 22, 2013 at 5:55am

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.

<code>

– Pasted Max Patch, click to expand. –

</code>

#250240

You must be logged in to reply to this topic.