• ### Stumped trying to calibrate/set a center point from a smartphone gyroscope to a mobmuplat knob

Details :

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?

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.

-svanya

• Posts 4 | Views 1803
• @svanya Hello again......
They are not curves, but the math is done, and you might be able to replace the [/ ] objects with a function that gives the curve........ at the moment it is a "V"........
center.zip

• @whale-av

Thanks, this is excellent!

Still trying to wrap my mind around 1) if it's even possible and 2) how I might smooth the "knee" :---))) on this.

Am thrilled to get it and Very thankful.

Peace to you and thru us all,
-svanya

p.s. I can send it thru various trigonometric functions to get curves. But that break it 0 is a doozy.

• @svanya I have used [pow] to give you a curve. It works less well if your centre is a long way from "0" and if at the same time you want the limits to be +-1..... but I imagine that you will never be very far "off center"......
But it works. If you want a more extreme, or less extreme curve you can multiply the right inlet inputs to [pow] to shape the curve.....center_curve.zip

HMM...... it's not right for displaced centers above zero...... and it's late....... maybe you can fix it......
David.

Posts 4 | Views 1803
Internal error.

Oops! Looks like something went wrong!