Loading .vstpresets in VST3 plugins do not load correctly

In our plugin host (we use Juce 6.0.7) we use the code below to load vstpresets to VST3 plugins hosted, taken from here

The hosted plugins, like brainworx plugins do not load the presets correctly, the values are wrong compared to the values that the presets have when the brainworx plugins are hosted directly in the DAW.
It shows that the parameters are changing but are not correct.

Any ideas what may be causing this?

> auto funknown = static_cast<Steinberg::FUnknown*> (p->getPlatformSpecificData());
>         Steinberg::Vst::IComponent* vstcomponent = nullptr;
> 
>         if (funknown->queryInterface(Steinberg::Vst::IComponent_iid, (void**)&vstcomponent) == 0
>             && vstcomponent != nullptr)
>         {
> 
>             auto* memoryStream = new Steinberg::MemoryStream(data.getData(), static_cast<int>(data.getSize()));
>             vstcomponent->setState(memoryStream);
>             memoryStream->release();
>             vstcomponent->release();
>         }

There are now dedicated methods for reading/writing VST3 preset files:

To use this, create a derived implementation of ExtensionsVisitor and pass it to AudioPluginInstance::getExtensions. The plugin instance will call visitVST3Client on your extensions instance, and you can then call setPreset on the provided VST3Client argument.

1 Like

Thank you so much! Will try that

Updated to Juce 6.1 and implemented this. Works!
Thanks!