Forums > MaxMSP

continuous slider from random start points – Leap motion

April 13, 2014 | 9:17 pm

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.



MIB
April 14, 2014 | 8:25 pm

maybe a bit clunky but might get you started…

– Pasted Max Patch, click to expand. –

April 14, 2014 | 10:02 pm

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


April 17, 2014 | 4:48 pm

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.


Viewing 4 posts - 1 through 4 (of 4 total)