Smoothing Numbers question

jotelcalifornia's icon

hey everyone! i'm currently working on a performance using motion tracking. the data is transferred to max via osc and then used to generate sound.
the issue i'm having is this: everything works so far, but the values I get from the sensors are kind of jumpy.
so I tried normal smoothing, for example using the line object, and that worked kind of but didn't satisfy me.
If i use linear smoothing , so that the big jumps get really smoothed out, the normal data gets kind of slow and unimmediate.
So what I want to do, is smooth the values more, the bigger the jumps are. meaning if it jumps from e.g. 0.1 to 1.1 it should apply only 50ms of smoothing. but if it jumps from 0.1 to 4.7 it should take way longer to smooth the value.
Any help appreciated!

Pedro Santos's icon

Max Patch
Copy patch and select New From Clipboard in Max.