Assuming just d and v are variable, you'll probably want some thing like

d(v):
        d = d_low + (d_high - d_low) * (log(v) - log(v_low)) / (log(v_high) -
log(v_low));

v(d):
        v = v_low * pow(v_high / v_low, (d - d_low) / (d_high - d_low));

--Richard

> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of Marcus
> Andersson
[...]
> I would like to know if there is any agreed upon logarithmic function to
> use for LADSPA control ports when the LADSPA_HINT_LOGARITHMIC is set. In
> practice, the function should map display coordinates (the slider) to
> control values.
>
> The best I have come up with myself is this:
>
> Control port value, v
> Control port low limit, v_low
> Control port high limit, v_high
> Display coordinates, d
> Display coordinates low limit, d_low
> Display coordinates high limit, d_high
[...]

Reply via email to