Forums > MaxMSP

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

November 15, 2013 | 6:00 am

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!


November 15, 2013 | 9:30 am

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>


November 16, 2013 | 4:47 am

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.


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