On Sun, May 16, 2004 at 09:14:46AM +0200, Marcus Andersson wrote:
This also means that it is illegal to include 0 in the
parameter range.
In that case you can use f(x) = x*a^x, with a = f(1).
How do I invert this function? I am stuck.
You need the inverse only to set the slider to a given value.
A Newton-Raphson iteration will do that very rapidly, and
the required precision is not very much (a small fraction of
a pixel).
What do you propose in the case of [-20.0, 40.0]?
For a HINT_LOGARITHMIC control, which implies that there is an
exponential conversion from the slider position to the param
value, this is just illegal (as is in fact the f(0) = 0 case).
What do you mean with a log scale from -20 to +40 ???
In fact the linear / logarithmic choice is a bit too simplistic,
It could be improved with a few more hint bits to cover some
classic cases, but for a plugin I can live with this limitation.
Another thing that is not covered is the case of simple gain
fader. If you look at the control law of a good fader on a mixing
desk, it clear that there is more precision (in dB) in the upper
range than at the bottom, and it goes down to minus infinity.
Depending on what the fader is used for, the lowest tick above
'off' could be something from -100 to -40 dB. No standard
slider widget allows you to do such a thing, and you'll need
something more general anyway.
For typical audio work, I'd think a set of about 8 to 10
control laws would cover 99.99% of all cases. It would take
just 4 hint bits to encode these cases plus some 'escape'
value for an arbitrary mapping, but I wouldn't dare propose
such a thing.
--
FA