Normalising parameter values #46
Replies: 1 comment 1 reply
-
Despite parameters in CLAP can have different min/max values, the projection is always linear. Imagine you create a filter cutoff and say min=20 and max=20000, the automation will create linear values from 20 to 20000, so the projection from 0.0 to 1.0 will always work. If it were different, the character of the parameter value projection would need to be communicated (logx/exp). But there is no such thing. In case of a filter cutoff you would not define [20,20000] as a min/max pair, you would use [0.0, 1.0] and the parameter text rendering would provide a suitable text representation of the Hz. The logarithmic nature is only happening on the DSP code and the text representation rendering. |
Beta Was this translation helpful? Give feedback.
-
Hi, I'm wondering what you think of this and whether it's something missing in this implementation.
I don't know VST3 very well, but I am quite familiar with VST2 and now CLAP. It seems like VST3 wants parameter values normalised as a float from 0 to 1 which is different to how CLAP wants them.
The code in the clap-wrapper looks like it's just a linear mapping, using the params min and max values.
clap-wrapper/src/detail/vst3/parameter.h
Lines 38 to 45 in f14d5b2
However, I don't think this will work in the case where the parameter is not meant to be linear. For example I have a filter cutoff that has a minimum value of 20hz and a maximum value of 20000hz. When moving the slider on the GUI it changes the value logarithmically because that sounds the most intuitive to the human ear. And I'd want that behaviour to be the same if the host is somehow controlling the parameter.
I'm beginning to think I need to just pretend the parameter is 0 to 100 or something.
How do you go about situations like this? I feel like I am overthinking this.
Thanks
Beta Was this translation helpful? Give feedback.
All reactions