Send Bang when when maximum value is reached.


    May 21 2013 | 9:06 pm
    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!

    • May 21 2013 | 10:07 pm
      [select 856]
    • May 21 2013 | 10:20 pm
      Yes, but the numbers is just an example. At least I need to trigger the counting peak which alters.
    • May 21 2013 | 10: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 | 7:41 am
      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.
    • May 22 2013 | 8:04 am
      There's an off by one error on the high number, but this gives you the bangs:
    • May 22 2013 | 11:33 am
      Thank you.. this seems to be what I need.
    • May 22 2013 | 11:36 am
      past
    • May 22 2013 | 12:55 pm
      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.