Cockos : REAPER : NINJAM : Forums
Forum Home : Register : FAQ : Members List : Search :
Old 10-07-2019, 01:30 AM   #1
Human being with feelings
Join Date: Dec 2015
Posts: 327
Default Build IPlugEffect with latest wdl/ol?

I wanted to do a sanity check to be certain that behavior I'm seeing from Reaper has nothing to do with any changes I've made to wdl/ol. So I pulled the last wdl/ol, which calls for VST3 3.6.9, with the intent to build IPlugEffect. 3.6.9 seems to be a proper match for the most part, but it doesn't have the base lib so link fails. Also, base.xcodeproj is in the project browser, but doesn't exist in 3.6.9. I'm not sure that the lib is needed, but deleting would require other changes, and I expected IPlugEffect to build out of the box. This is not a big deal, just want ot see if anyone has a quick fix. VST3 changed quite a bit between 3.6.5 and 3.6.9.

I have no problem building IPlugEffect with my older-idl/ol-based fork, using VST 3.6.5. I just want to build it with the final wdl/ol. IPlug2/IPlugEffectVST3 works better with Reaper, btw.

Xcode 9.4.1, High Sierra
earlevel is offline   Reply With Quote
Old 10-08-2019, 01:09 AM   #2
Human being with feelings
Join Date: Dec 2015
Posts: 327

Never mind, I took the time to make it build with VST3 3.6.9.

And confirmed the same Reaper-only issue I was seeing with my plugin, which is (for the curious):

Here is the relevant code, from IPlugVST3::process in IPlugVST3.cpp; When recalling a user preset, Reaper first issues a factory preset (note we are recalling a user preset!) command. The value (which should be 0-1, to select a factory preset) is garbage (NaN in this case, but in my own plugin was 0, 1, or a huge negative number which happened to be an interesting bit pattern). RestorePreset will fail if the number doesn't correspond to a factory preset, but it doesn't matter—it either restores a factory preset or fails. Regardless, Reaper then sends parameter changes for all plugin parameter, in order (handled in the default case here).

case kPresetParam:
  RestorePreset(FromNormalizedParam(value, 0, NPresets(), 1.));
  //TODO pitch bend, modwheel etc
  if (idx >= 0 && idx < NParams())
    if (GetGUI()) GetGUI()->SetParameterFromPlug(idx, (double)value, true);
If anyone wonders, there is no change in behavior if PLUG_DOES_STATE_CHUNKS is set to 1. With 1, you'd expect restoration by chunk, but it never happens. I also played with uncommenting SetState and the various combinations people have tried over the years, with no success. (BTW, Reaper handles factory preset recalls just fine.)

For most plugins, you won't notice the mistake. But I need to restore from chunks, not serial parameter changes for one of my plugins, so it's bad news for me. My plugin works correctly for every other VST3 host I've tried.

Basically, it appears to be a Reaper implementation error that's sensitive to the IPlug(1) VST3 implementation. IPlug2 has a much better implementation, and Reaper doesn't have this issue with it (reaper calls SetState). I have to stick with IPlug1 right now, so next step is to figure how to rewrite IPlugVST3 in a way that makes Reaper happy..
earlevel is offline   Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -7. The time now is 08:08 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.