There's a problem in the commit for this in JUCE HEAD, which causes crashes in Cubase 7 with the VST2 plugin..
Fix's at https://github.com/yairchu/JUCE/commit/f7f1274429a1c93164e8012c129f0607639eeaae
Only the first 16 bytes of the FUID need to be copied (don't know why, just taking this from the SDK docs) while sizeof(FUID) is 20 bytes which overflows the buffer..
... test1 is 34156188 while data is "\x9c.\t\x02".
(My AudioProcessor::getStateInformation does nothing special (just a few parameters stored via XML) and used to work fine before (still does when using Cubase 7 LE.)
Ok, this (crash when loading presets in VST3 in Cubase 5) reproduces here too.. Thanks for catching this!
In the debugger I notice two things:
"size" is 1! Looks like readFromMemoryStream simply doesn't work right in Cubase 5
When using just readFromUnknownStream instead of readFromMemoryStream we do get actual data
However, when reading a VST3 preset file - a ".vstpreset" file rather than a ".fxp", in Cubase 5 we get the whole content of this file including its header (which starts with "VST3").
So for now I'll try the following fix - use just readFromUnknownStream and not readFromMemoryStream, and in "loadVST2CompatibleState" - check if the data starts with 'VST3' or big-endian 'VstW' and support skipping the vst3 .vstpreset file's header..
Ended up not disabling readFromMemoryStream as I suggested before because it contains some Adobe Audition CS6 workaround which I don't want to remove, but instead loadStateData returns whether it was successful or not.
Mart, can you try this patch and see if it solves the problem at your end as well?
I recently noticed unexpected behaviour when setting plugin parameters via Cubase's Texteditor-Style value input field (see attached picture). I had to enter the normalized [0.0 , 1.0] values there to set the parameters right.
So I found what I'd need to implement would be Steinberg's IEditController::getParamValueByString method.
Steinberg provides a default implementation in EditController::getParamValueByString where the string is just parsed to double. Cubase then uses that value to set the plugin's parameter. (Hence, the behaviour described above).
So here is a proposal how to add that method to JUCE (adding a default implementation to juce::AudioProcessor that behaves just like Steinberg's default implementation):
https://github.com/MartinHH/JUCE/commit/539c84e05bdf5935a61598e8c303d4bd05cdfdef
Works fine when properly overriden (did not test on Windows yet).
Something that I recently noticed and that I can reproduce with the DemoPlugin:
Using: OSX 10.9.2, XCode 5.1.1, Cubase 5.5.3
Building: VST3 Universal Binary 32/64 Bit, Base SDK 10.7
Steps to reproduce the crash:
1. open a new empty project, create a new track and load the VST3 version of the plugin
2. change a parameter
3. unload the plugin without storing anything (confirm to discard changes)
-> Crash with EXC_BAD_ACCESS somewhere in a libobjc.A.dylib's disassembly (see attached screenshot for details)
I couldn't reproduce this using Cubase 7 LE and I have to admit the combination of Cubase 5 and OSX 10.9 is rather obscure (and not offcially supported by Steinberg)...
Latest changes in my "wavelab" branch should also fix an issue with VST3 support for midi-only plugins - though I haven't tested those as I don't have any to test..