raedwulf / alsaequal

GNU Lesser General Public License v2.1
32 stars 13 forks source link

Use logarithmic scale on LADSPA inputs that request it #6

Open bennigraf opened 3 years ago

bennigraf commented 3 years ago

Hi raedwulf,

I'm not sure what the current state of this repo is, but you seem to be at least inofficially the maintainer of this plugin for now, so I'd like to suggest an improvement to it. I tried to use this with the parametric EQ from the CAPS collection; however, I had the problem that the frequency control was mapped linearly from 20Hz to 14kHz over 0-100%, which is not very useful, especially in the low end range. LADSPA plugins do have a way of suggesting to use a logarithmic scale for input controls, though. This PR tries to detect such inputs and then apply control values after scaling them logarithmically over the min/max range. For me, this allows way better control of i.e. the Eq4p freqency.

The code might be a bit rough since I'm not a full time C developer; let me know if you have improvements to suggest.

Best, Benjamin.

pyInter commented 1 year ago

It seems the log scaling is still not applied when the bin file needs creating with the default value. See LADSPADefault() in ladspa_utils.c for details. The log hint bit of HintDescriptor should not be masked off by LADSPA_HINT_DEFAULT_MASK when judging it with LADSPA_IS_HINT_LOGARITHMIC().