View Single Post
Old 06-29-2019, 10:42 AM   #19
earlevel
Human being with feelings
 
Join Date: Dec 2015
Posts: 331
Default

There are still problems, in both the proposed changes and elsewhere.

For all ToNormalizedParam and FromNormalizedParam, the third parameter is "max", so "NPresets() - 1".

For all FromNormalizedParm that feed an integer parameter, there needs to be rounding (e.g., "+ 0.5"). RestorePreset and mCurrentPresetIdx.

"NPresets() - 1" also for parameters.addParameter(new Parameter...kPresetParam...).

I'm still chasing one related bug—I can't choose the last preset because the host (any) still things the highest preset is NPresets(). That is, I have 36 presets, 0-35. If I select the last preset, the host sends the parameter value 0.972222 (35/36—it thinks max is 36, apparently)...looks like that's only happening in Reaper, Cubase gets the full range...

Edit: It looks like the problem is that IPlugVST3::plainParamToNormalized is wrong. The function is given a tag, but uses it as an index so it always fails (I see, the same error as set/getParamNormalized). According to Schwa, Reaper should give a try at it. I'm not sure why it fails, but fixing the plainParamToNormalized...still not there...the last preset now works and the menu indicates the last, the first 18 of 36 presets likewise, but the others work but the menu displays the next one. IPlugVST3::plainParamToNormalized returns the correct value, so it's something else. Seems like repeat still thinks there is one more preset? It's asking for preset name 35 when I set 34...only Reaper that having an issue now.

Last edited by earlevel; 06-29-2019 at 06:33 PM.
earlevel is offline   Reply With Quote