VST3 Wrapper Bugs


#1

I found what appear to be some bugs in the VST3 Wrapper. I'm not running the latest Juce code, but I looked at the latest version on Github and didn't see any related changes.

There are two places where a "TBool" state is passed in from the plug-in host, and the wrapper does a comparison with a "tresult" code, but the comparison ends up doing the opposite of what it should.  For example, in setActive a state of true ends being equal to kResultFalse and then the plug-in resources are released instead of created. And I verified that behavior in the debugger.

    tresult PLUGIN_API setActive (TBool state) override
    {
        if (state == kResultFalse)
        {
            getPluginInstance().releaseResources();
        }
        else
        {
       <snip>
        }
    }

    tresult PLUGIN_API setProcessing (TBool state) override
    {
        if (state == kResultFalse)
            getPluginInstance().reset();
        return kResultTrue;
    }

It should be something like:

    tresult PLUGIN_API setActive (TBool state) override
    {
        if (state )
        {
            <snip>

        }
        else
        {
            getPluginInstance().releaseResources();
        }
    }

    tresult PLUGIN_API setProcessing (TBool state) override
    {
        if (!state)
            getPluginInstance().reset();
        return kResultTrue;
    }

 

I also noticed that VST3 has no bypass control. It looks like that control has to explicitly be created. I assume this is on Jules' to do list, but just thought I'd mention it.

 


#2

Thanks - looks like a typo that dates back to the original VST3 wrapper code, it shouldn't be comparing a bool to a result code! Have tidied that up now!


#3

Thanks Jules. Much appreciated.