Hello !
I have been reading the following :
https://steinbergmedia.github.io/vst3_dev_portal/pages/Technical+Documentation/Parameters+Automation/Index.html
I was hoping to understand how to achieve my goal:
I have a threshold knob, where the threshold should be displayed in dBFS, and the knob controlling the threshold should allow to set the threshold in a way that scales nicely: as you turn the knob down the dBs should drop linearly with the knob’s position.
I couldn’t understand how this is supposed to be done so I implemented what I think is a bad hack:
tresult PLUGIN_API UpwardCompressorProcessor::process(Vst::ProcessData& data)
{
//--- First : Read inputs parameter changes-----------
if (data.inputParameterChanges)
{
// for each parameter defined by its ID
int32 numParamsChanged = data.inputParameterChanges->getParameterCount();
for (int32 index = 0; index < numParamsChanged; index++)
{
// for this parameter we could iterate the list of value changes (could 1 per audio block or more!)
// in this example we get only the last value (getPointCount - 1)
Vst::IParamValueQueue* paramQueue = data.inputParameterChanges->getParameterData(index);
if (paramQueue)
{
Vst::ParamValue value;
int32 sampleOffset;
int32 numPoints = paramQueue->getPointCount();
switch (paramQueue->getParameterId())
{
case RMSParams::kParamThresholdId:
if (paramQueue->getPoint(numPoints - 1, sampleOffset, value) == kResultTrue)
mThreshold = value;
break;
}
}
}
}
threshold = exp((mThreshold - 1) / mThreshold); // compare RMS value to this
With this hack, my threshold parameter varies in such a way that I can finely access threshold RMS values corresponding to -100 or -150 dBFS when turning the UI knob.
I feel though that this is not the intended way, but I do not understand what I’m supposed to do with these normalizedtoplain and plaintonormalized methods.
Could somebody clarify a bit for me or point to more reading material ? Reading the doxygen documentation is not very helpful due to my lack of experience.
Thank you very much !