measure the degree of change in incoming data

kampana's icon

Hi,

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?

thanks

Bas van der Graaff's icon
Max Patch
Copy patch and select New From Clipboard in Max.

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?

kampana's icon

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.

Chris Muir's icon

I put together a patch contrasting several smoothing methods for this thread:
https://cycling74.com/forums/smoothing-out-numbers