Why no NormalisableRange::setSkewFromCenter()?


#1

it would be really useful to have a setSkewFromCenter() method for NormalisableRange, (such as the Slider one)
Or perhaps a static method somewhere that returns the skew corresponding to a given range + center

NormalisableRange<float> freqRange (20.f, 20000.f);
const float center = 5000.f;
const float skew = std::log (0.5f) / std::log ((center - freqRange.start) / (freqRange.end - freqRange.start));
freqRange.skew = skew;

#2

+1. Had to write this into the class myself, it should really be in there already…


#3

For greater flexibility would this not allow you to achieve the same thing? Suggestion: Replace skew with lambdas

The problem with the NormalisableRange class is that people could just continually ask for all sorts of changes and adjustments to get the slight modification they require. IMO a more generic solution as suggested above is required.


#4

Yes, that would be fine, if the Slider class is also changed to use a NormalisableRange instead of independant min/max/skew values.