free-audio / clap

Audio Plugin API
https://cleveraudio.org/
MIT License
1.78k stars 100 forks source link

Logarithmic parameters? #285

Closed sadko4u closed 1 year ago

sadko4u commented 1 year ago

Hello!

Just noticed that CLAP doesn't provide logarithmic parameters (for, example, the Frequency). I mean, the host does not know anything about the parameter scale like in PortProperties:logarithmic.

Would be a good idea to add such flag.

abique commented 1 year ago

Hi,

It doesn't work like that with CLAP. You should change the domain of your knob so it is linear, like using the pitch domain for frequencies instead.

robbert-vdh commented 1 year ago

These flags are inherently too limited because they cannot possibly represent all the different ways you'd want your parameter range to be scaled/skewed/transformed, which is probably part of the reason why CLAP didn't even bother with them. Either indeed make your parameter's domain linear, like using MIDI note IDs instead of frequencies, or just use [0, 1] and do the scaling in your plugin.

abique commented 1 year ago

Also modulation would not work well if the domain wasn't linear and they need to be applied before the domain conversion.