Exponential scaling problem (real-time input data from an accelerometer)

cpp

New member
Joined
Dec 1, 2017
Messages
4
Hi everyone, I'm a musician working on a developing computer program for control over expressive parameters of a sound in live performance. I’m trying to build an equation that uses real-time input data from an accelerometer to smoothly interpolate between two sets of variables between 0.0 and 1.0 at the same time a time-based envelope function runs. The effect is that both the accelerometer and the envelope are influencing the output for musical performance data.

I'm posting this in the algebra category because although my equation variables in exponents, I think the part of the problem I'm stuck on is one of algebra around getting the exponents on one side of the equation; after that, I know I can take a logarithm of both sides to find out the exponent.

Screen Shot 2017-12-01 at 5.52.37 PM.jpg
I created the scenario in figure 1 to visualize this. This drawing is only a possible representation. The lowest and highest values are always 0 and 1 respectively but any of the values can be the lowest. The relationships between a, j, x; b, k, y; c, l, z; a, b, c; j, k, l; x, y, z are all to be the same:
j = (x - a) * (0.5)^p + a
k = (y - b) * (0.5)^p + b;
l = (z - c) * (0.5)^p + c
b = (c - a) * (0.5)^p + a
k = (l - j) * (0.5)^p + j
y = (z - x) * (0.5)^p + x.

Variables a, c, x, z and k are known when a performance begins. I want to find variables b, j, l and y. I think I can do this by finding p from the known variables a, c, k, x and z.


I think that I can find p by substituting the equations for j and l into the equation for k:
k = (l - j) * (0.5)^p + j; j = (x - a) * (0.5)^p + a; l =
(z - c) * (0.5)^p + c
k = ( (
(x - a) * (0.5)^p + a ) - ( (x - a) * (0.5)^p + a ) ) * (0.5)^p + j

This feels like a big mess! I know I can substitute a variable for (1/2)^p and simplify it a little bit but I'm not getting very far:
Q = (0.5)^p
k =
( ( (x - a) * Q + a ) - ( (x - a) * Q + a ) ) * Q + j
k - j = ( ( (x - a) * Q + a ) - ( (x - a) * Q + a ) ) * Q

I know that if I can get Q on one side, then I can substitute (0.5)p back in and take the logarithm of both sides to find the power. Then, knowing p, I can easily find b and y using the earlier equations. However, I can’t seem to reduce this complex equation.






Can someone help me? If it's unclear, perhaps let me know how I can present it clearer. Thanks so much, Christian
SaveSave
SaveSave
 
… Variables a, c, x, z and k are known…

k - j = ( ( (x - a) * Q + a ) - ( (x - a) * Q + a ) ) * Q

I know that if I can get Q on one side, then I can substitute (0.5)p back in and take the logarithm of both sides to find [p]
Do you have a complete set of values for those symbols that you could post, as an example?

Also, this expression and that expression are the same. Is there a typo? One is subtracted from the other, so the result for k-j will be zero for any choice of x, Q, and a.
 
Do you have a complete set of values for those symbols that you could post, as an example?

Also, this expression and that expression are the same. Is there a typo? One is subtracted from the other, so the result for k-j will be zero for any choice of x, Q, and a.

Thank you for the responses.

Addressing known values:
a, c, x, z and k can be any floating-point values between 0.0 and 1.0 but they are known once the performance starts. The diagram is made to roughly represent a=0, c=0.25, x=0.5, z=1, k=0.75. The lowest value is always 0 and the highest value is always 1.0 but any of the variables can be highest or lowest.

Addressing the typo:
There is indeed a typo in the formula: I substituted the formula for l in the place of j. It should read:
k = ( ( (z - c) * (0.5)^p + c ) - ( (x - a) * (0.5)^p + a ) ) * (0.5)^p + ( (x - a) * (0.5)^p + a )

Addressing multiple formulae for k:
Responding to another's comment, there are two formulae for k because each one is finding the middle value between the two extremes of each set of ranges; value k happens to be the middle between j and l as well as between b and y.
 
It seems the crux of this problem is just solving this equation for Q:

k = ( ( (z-c)Q-c) - ( (x-a)Q-a ) )Q - ( (x-a)Q-a)

Working with simplifying it, I came up with this:
k - a = (a+z)Q^2 + (x-c)Q^2 + (x-c)Q

Can anyone help me figure out how to get further?
 
It seems the crux of this problem is just solving this equation for Q:

k = ( ( (z-c)Q-c) - ( (x-a)Q-a ) )Q - ( (x-a)Q-a)

Working with simplifying it, I came up with this:
k - a = (a+z)Q^2 + (x-c)Q^2 + (x-c)Q

Can anyone help me figure out how to get further?
You have a quadratic in Q. Rearrange and then apply the Quadratic Formula. ;)
 
Yes! That's it. Thanks so much for the help!

I figured out and coded the equation from the quadratic formula, substituted logarithms to get find the power from the original equation and it works. However I'm having problems with limits and dividing by 0. I'll post again if I can't figure it out.

Thanks again!
 
Top