I believe when you create the entry into your APVTS, you can set the skew there. Perhaps try that if using an attachment, as the slider likely just slaves to the parameter entry.
Also, anyone who understands how the slider can know it’s range when asked but not when setting the skew? I mean isn’t it a little bit funny that I can reset the sliders range by asking the slider which range it has?
also i hate to be a prude, but the better way to use parameter trees is using the layout method.
processor header file
AudioProcessorValueTreeState::ParameterLayout createLayout();
AudioProcessorValueTreeState apvts{*this, nullptr, "my parameters", createLayout()};
processor cpp
AudioProcessorValueTreeState::ParameterLayout YourAudioProcessor::createLayout()
{
AudioProcessorValueTreeState::ParameterLayout layout;
// less typing
using namespace std;
using Normalise = NormalisableRange<float>;
// then for all your params you add like this
layout.add(make_unique<AudioParameterFloat>("filterID", "Filter Name", Normalise(10.f, 20000.f, 0.01f, 0.5f)));
// finally you return the layout
return layout;
}
also, dont forget to remove all the gui functions that modify the slider skew, etc. the slider will automatically use the skew from this method. if you dont remove the gui functions changing the sliders function it could mes things up.
in addition to what the others said i’d like to stress that making a skewed parameter just by applying a new mid point might not yield desirable results for frequencies. normalisableRange also has a constructor for inputting conversion lambdas where you can define the skewing behaviour precisely
What happens is, the NormalisableRange together with the mapping and skewing is forwarded from the AudioProcessorParameter to the Slider when you attach it.
Settings like setRange or setSkew are used on Slider, when you set them AFTER creating the SliderAttachment. However it is not adviseable, because the behaviour of the Slider is now different from the behaviour of the Parameter itself, which is normally not desired.