I just did a few more tests (in Cubase 12) that give strange results:
I first did this:
- remove the VST3 version, put the VST2 version in place (I can see in the GUI if it is VST2 or VST3, so I’m sure the right version gets used)
- create a project with 2 audio tracks, each with my VST2 plugin as insert effect
- on track 1, don’t change the program, but change the parameters to something easily recognizable
- on track 2, change the program to say program index 8, and then adjust the parameters to something easily recognizable
- save the project
→ If I restart Cubase and reload the project, all is fine as has been the case for years now: the parameters for the effect on each tracks are the way they were when the project was saved.
Then I did this:
- remove the VST2 version, put the VST3 version in place
- start Cubase and reload the project
→ Since the JUCE_VST3_CAN_REPLACE_VST2 flag is set, the original VST2 version correctly gets replaced by the VST3 version, so that works fine.
→ But the settings are only correctly restored for the 1st track. For the second track, I see the default settings (settings for 1st program), not the ones the project got saved with.
Digging a bit deeper, I then set a breakpoint in my plugin’s setCurrentProgram method,. And I can see that this breakpoint never gets hit for the VST3 version when the project is loaded, which seems a bit weird to me…
For the VST2 version, the breakpoint does get hit:
First a call to setStateInformation happens (which restores the plugin’s full state from the saved project, so all parameters of all programs), and then setCurrentProgram happens with the correct index (0 for the plugin on the 1st track, 8 for the plugin on the 2nd track) which is all normal.
So, for some reason the setCurrentProgram call never happens for the VST3 version (the breakpoint does get hit when you change the program via the Quick Controls).
You would expect this to be called at some point when a project loads, right?
Maybe I am missing a new JUCE VST3 flag that could be related this?
By using the Quick Controls on the plugin on the 2nd track, I can actually change the program to index 8 myself, and then I can see that the changed settings (as they were saved) are there indeed. It’s just the setCurrentProgram that is not being called apparently for the VST3.
This is with Cubase 12.0.20 (Build 263) on Windows 10.
And also seeing the same symptoms in Cubase 11.0.41 on Windows 10.