View Single Post
Old 08-22-2019, 12:45 PM   #12
earlevel
Human being with feelings
 
Join Date: Dec 2015
Posts: 327
Default

Quote:
Originally Posted by Nonlinear View Post
I see that you also fixed a Reaper presets bug in VST3. I haven't noticed any VST3 issues in Reaper - what was that about?
The original IPlug implementation of VST3 host communication that includes handling presets is a bit rough.

Basically...Reaper has the wrong idea of how many step the menu has, by the VST definition, probably because IPlug told it wrong in the initialization (a two-value parameter has one step in VST terms, not two—the base and one step). In most cases this wouldn't matter—the host tells the plugin that the fourth item in the preset list is selected, the plugin brings up the fourth preset. But Reaper does an unusual step, to support preset renumbering by the plugin, it essentially tells the plugin which preset to select, then it asks which preset is now set. The catch is that it's a normalized parameter value, 0-1, This would still be OK if IPlug implemented both ways of the conversion functions, but it misses one side (normalizedParamToPlain was missing...but it didn't implement PlainParamToNormalized right either)—Reaper does it's own calculation. So, for a menu of 32 items, your plugin would think that's 32/32 = 1.0. Reaper would say 32/33. There's no harm if IPlug is equipped to do both sides of the calculation, or if Reaper didn't support renumbering with these calls—that's why other hosts didn't have that issue.

It's a little worse than that, because you fix some of this, then realize there are IPlug rounding mistakes and partial implementation, but if you get it all fixed it all works right on any host...in which VST presets are implemented, which is another fun inconsistency.
earlevel is offline   Reply With Quote