I am using the equation:
$$y=(1-e^{-ax})*d$$
For the shape of a logarithmic attack phase of an audio synthesizer envelope. The idea is for it to go from (0,0) to (t,1) at a given time (x=t) value.
I therefore need to solve the equation for "a" or "d" by substituting (t,1) as:
$$1=(1-e^{-at})*d$$
I can solve it easily enough for "d" which gives:
$$y=(1-e^{-ax})*(e^{at}/(e^{at}-1))$$
I have graphed this at Desmos and it works with control of the curve by "a" and time "t", where "t" is the point at which y=1:
https://www.desmos.com/calculator/k432jwmhzm
However, I would ideally like it to be controlled by "d" and "t" rather than "a" and "t".
Can the equation above (2nd in this post) be solved for "a" instead to result in an equation controlled by "d" and "t"?
I only need valid output between (0,0) and (t,1), where t>0.
Thanks
Of course it can!
Notice that
$$\begin{align}1 = (1 - e^{-at})d &\iff \frac{1}{d} = 1 - e^{-at}\\ &\iff e^{-at} = 1 - \frac{1}{d}\\ &\iff -at = \log\left( 1 - \frac{1}{d} \right)\\ &\iff a = -\frac{\log\left( 1 - \frac{1}{d} \right)}{t} \end{align}$$