measure the degree of change in incoming data

    May 12 2010 | 12:14 pm
    i have the following scenario: data coming into Max from several sensors, which control the playhead position in a sample. due to the oversensitive (or unstable) nature of the sensors, small amount of data keeps coming in even when sensors are not in use and hence the playhead position changes mildly even when there's no physical interaction with the sensors. what i'd like to do is measure the degree of change in the incoming data so i could distinguish between continuous sensor hecticness and real physical interaction with the sensors. i.e. if there's a sudden number change from 0 to 10 - don't play, but if it's 0 to 100 - start playing, do something, etc.
    i'm considering using a combination of Counter objects to achieve this. but is there a faster way?

    • May 12 2010 | 4:06 pm
      Depends on how much you have to filter this. Do the sensors introduce any noise (like occasional crazy peaks)? If you want to 'do something' every time input change is bigger than a certain amount, what's the point in keeping counters?
    • May 12 2010 | 7:24 pm
      Hi, thanks for the reply. sensors don't introduce noise, there are no crazy peaks, but every now and then there's a number shift of +4 or -4 due to some sensor jitter. it's those kind of jitters that i would like to disregard, because every tiny change takes my sample playhead back to the beginning.
    • May 12 2010 | 7:59 pm
      I put together a patch contrasting several smoothing methods for this thread: