I set up my guitar/pedal smartphone app to read gyroscope values (x,y,z) and bend (turn the knobs) on preset pedal-effects, ex. gain, feedback, delay, pitch etc. Sort of a 3-d tremolo bar effect yet for any parameter I want.
That was all good and well and works great. However...
I am attempting to trigger a calibrate function/subpatch:
when the toggle is on it reads the x,y,z signals,
when you turn it off it triggers a [sel 0] and it sets the current values, ex [v curX]
which are then used to center the pedals on 0.5 (the center of my mobmuplat knobs)
So you turn it on, move your guitar around until its "centered", then click off and it stores those values and calibrates the incoming x, y, z accordingly.
I worked on this for about 8-10 hours and couldn't get it straight.
My smartphone rotates and sends out a signal (gravitationly based) for x y and z in the range of -1 to 1
My knobs are in the range of 0 to 1 with the middle at 0.5 (which is where I want them and apparently not as trivial as I thought).
I need to offset the curve (-1 to 1) so it "rests" around [v currX] etc values and thus is centered around the 0.5 of the knob.
How do I do that?
meaning how do I:
given an initial value, a, between the range of -1 to 1, set it so all future values between -1 and 1 rotate around that set/center point?
Thanks for your help.
I am very excited to get this done as I think it is way cool feature/effect for my rig.
peace. Look forward to your help.