continuous slider from random start points - Leap motion

innerear's icon

I'm using the Leap Motion to control some sliders. When I put my hand over the sensor it jumps to that value, say I'm halfway up it starts at 50 and at the highest point is 127. When I remove my hand it stays where it is left off, which good, but when I put my hand back in at any other random point all of a sudden slider jumps to wear my hand is entered. So, hand in 0-60, remove hand slider stays at 60, hand back in 95-0. I'd love it if when my goes to do the second move, that the value doesn't jump up suddenly from 60 to 95, but continue from 60 regardless from where I start on the second move.

right now I'm running some smoothing algorithm, but not the best solution.

Please help, or point me in the right direction.

I attached a patch the illustrates the issue. the section the LEFT with the urn and line objects is just to show the kind of input I get with the sensor. the MIDDLE part is a little something that captures the last value when I remove my hand. the RIGHT is the Slider that I'd like to finally effect, which will control the gain of a looped tonal sample.

Contiuous_from_jumps.maxpat
Max Patch
MIB's icon
Max Patch
Copy patch and select New From Clipboard in Max.

maybe a bit clunky but might get you started…

innerear's icon

Thanks MIB. I came up with this but it's much clunkier, and when the smoothed out value goes above 127 it keeps going, which is annoying.

I'm using yours.

super thanks

Contiuous_from_jumps-answer.maxpat
Max Patch
Andro's icon

What I do is enable the signal if my hand is open and disable it if my hand is closed ( a fist ). I can still see what value my hand position has and open it when its in the right place. Maybe you can also change the amount of smoothing by closing and opening your other hand.