Changerange from linear to exponential
Hi,
I'm am trying to change a linear range from 0. to 1. to an exponential range that is an upside down line drive. I'm working images fading that is controlled by movement. I need it to fade to the second image with little movement and then stay on that second image.
What range? What kind of curve?
A patch would be helpful too.
Any exponential curve will map the unit range into itself (i.e., map the range [0 .. 1] to [0 .. 1]), with varying amounts of curvature depending on the exponent (little secret from Litter Power: the way lp.scampi and friends handle exponential curves is to linearly map the input value into the unit range, perform the relevant function, and finally use a linearly scaling to the output range).
Try something like [expr pow($f1\,$f2)] and try different values for $f2 to find the curve you like.
The one thing you need to watch out for is that negative exponents (i.e., square roots and the like) may barf when the input value is exactly zero. So you may need to special case this, for instance by inserting a [sel 0.] in front of your [expr], connecting a [t 0] to the sel's left outlet, and hooking the right outlet into the left inlet of the [expr].
Got it? Or do you need a patch?