I'm brand new to JUCE, so apologies if there's an easier way that I didn't find for me to answer this than asking a dumb question!
I've got a (VST only, not concerned with AU at the moment) plugin with a GUI gain slider and associated parameter representing gain. As far as I can tell, that parameter can be modified from 3 general causes: The GUI's slider component, host automation, and directly in the JUCE Processor for any other reason. While the GUI slider and processor can utilize an arbitrary range for the gain parameter, host automation ALWAYS returns a value between 0 and 1 and does not allow for anything else. Because of this, I decided to restrict my GUI slider's range to the same (0 to 1). I want my GUI display to show decibels and allow the user to type new values into the text field in decibels. I did that by converting decibels/gain back and forth in the getTextFromValue/getValueFromText methods and it worked fine. Using JUCE's Decibel class for conversions only works if you want to map parameter 1.0 to 0.0db gain, so I had to just roll my own for the decibel range I wanted (-96 to 12) and set a skew for the slider to look normal.
My problem came when I realized that my host automation now (correctly) logarithmically mapped 0 decibels to ~0.2, which is mathematically correct but pretty functionally unusable. I fixed that by using a pair of linear transforms to remap the values such that 0 decibels mapped to 0.5 instead.
It all technically "works" properly now, but I feel like there HAS to be a better way to accomplish this than the one I used. What would be the proper way to handle parameter transforms in JUCE? Should I just start building a generalized library for this sort of stuff? Thanks for any help!