roelv
January 15, 2024, 9:11am
1
Hi,
I am trying to get a better understanding of how the host stores and restores the state of the plugin. I am printing the Processors setState() and getState() methods and noticed that everytime a project is opened with the plugin, getState() is called twice before setState() is called. Why does it do this? Should it not call setState() first so the host can restore the saved parameters to the plugin?
The call sequence in the VST3 Developer portal also shows that setState() should be called first: Audio Processor Call Sequence - VST 3 Developer Portal
Call sequence in my plugin:
Processor → Initialize
Processor → getLatencySamples
Controller → Initialize
Controller → connect
Processor → getState
Controller → setComponentState
Processor → getLatencySamples
Processor → setupProcessing
Processor → setActive: true
Processor → setProcessing: true
Processor → getLatencySamples
Processor → getState
Controller → getState
Processor → setState
Controller → setComponentState
Controller → setState
Processor → setProcessing: false
Processor → getLatencySamples
Processor → setActive: false
Processor → getLatencySamples
Processor → setActive: true
Processor → setProcessing: true
Processor → getLatencySamples
Yvan
January 15, 2024, 12:21pm
2
in order to sync the controller to the processor we have this first calls…
for these ones:
Processor → getState
Controller → getState
are optionals, maybe the host wants to save the original state before applying a new one…
which host are you using?
roelv
January 17, 2024, 7:42am
3
Thanks, I’m using reaper.
If i load my plugin in Presonus Studio One i get the following call sequence:
Processor → Initialize
Controller → Initialize
Controller → connect
Processor → getState
Controller → setComponentState
Processor → setState
Controller → setComponentState
Controller → setState
Processor → getLatencySamples
Processor → getLatencySamples
Processor → getLatencySamples
Processor → setupProcessing
Processor → getLatencySamples
Processor → getLatencySamples
Processor → getLatencySamples
Processor → getLatencySamples
Processor → getLatencySamples
Processor → setupProcessing
Processor → getLatencySamples
Processor → getLatencySamples
Processor → getLatencySamples
Processor → getLatencySamples
Processor → getLatencySamples
Processor → setActive: true
Processor → setProcessing: true
Controller → createView
It looks like Studio One does not do the extra calls to the processors getState() method. Good to know that this can be different in hosts.