Transposing position to become the new base position when pressing a button

Nov 15, 2013 at 6:00am

Transposing position to become the new base position when pressing a button

I’m having a real hard time on something I thought would be very simple. I’ve probably been staring at it too long and would appreciate some help…

I’m trying to read accelerometer data and on pressing a button I want to start moving from the value that was stored previously when I had let go of the button. So on letting go of the button I want to remember that position and use that as the base position for the next time I press, regardless of where I moved to when not pressing the button. Not sure if I’m explaining myself clearly. Hopefully the patch is clearer.

The example patch is with [mousestate] and a slider to simulate the accelerometer data and button I’m actually using. I’ve tried to simplify it as much as possible to share here…

<code>

– Pasted Max Patch, click to expand. –

</code>

Everytime I try something different and think I’ve cracked it, I end up with similar issues and it’s driving me crazy. I feel like I almost have it, but it’s outputting the last value and jumping to there :-/

Thanks for any help!

#271314
Nov 15, 2013 at 9:30am

This what i am using to momentarily recalibrate to streaming wii data, upon pressing of a button (like A on the wii). Hope it helps.

<code>

– Pasted Max Patch, click to expand. –

</code>

#271329
Nov 16, 2013 at 4:47am

Thanks so much sharing this, Jayrope. This is a useful patch to have but not what I’m after here. I have clean data coming in, it’s really that I’m having issues with the patch I shared because I’m not able to “shift/transpose” the new position from pressing the button to be in relation to the old position. It almost works, but then jumps to the old position in some cases and can’t figure out why.

#271364

You must be logged in to reply to this topic.