Vst3 development - problem with loading state

i’m making this vst3 plugin, and i’ve decided to grab the renoise demo as of late (with intent to purchase it if i find it like it). but renoise, uniquely, seems to have trouble loading previously saved state of the VST3. there are no problems in any other host i’ve tested it in. i know it’s probably a dumb idea to go on here and ask for help on how to get this VST3 to work with renoise, in that i would imagine it to be an incredibly difficult thing to help people with, and maybe does not fit within the topic of this board, but i think it’s worth it if it does end up saving me some headache.

so, i have this basic file with the VST3 as instrument 00. i notice that whenever it loads, it prints Vst3Plugs: Failed to apply initial component state to controller (not critical) to the log. whenever i play a note, it produces a permanent DC offset. which is not what i configured the instrument to do when i saved the project. i should mention that it played back perfectly fine when i created it initially, before re-opening the project. so obviously. loading’s not working.

my question is then, what is the order/conditions of VST3 calls it sends to the plugin upon initialization/loading? mmm, actually, i don’t know too much about how the VST3 API works, because I just programmed my plugin as a CLAP plugin and used the clap-wrapper project to wrap it as a VST3. but. seriously. what does “Failed to apply initial component state to controller” mean? did SingleComponentEffect::setState return kResultFalse or what? is it called before or after an important initialization call? is there a bug in Renoise with SingleComponentEffect support? is it because my plugin doesn’t yet implement presets? well, these are probably things that only the developers of renoise would know, but having some sort of answer to any of those questions would be helpful, i would think.

this is the source code for my plugin: GitHub - pkhead/beepbox-plug: Port of BeepBox synthesizers · GitHub
this is the source code of clap-wrapper: GitHub - free-audio/clap-wrapper: Wrappers for using CLAP in other plugin environments · GitHub

thanks in advance.

i just realized that I can just run renoise through a C++ debugger with breakpoints in the DLL. from that I have observed that Renoise first calls IComponent::setActive(true), then IAudioProcessor::setProcessing(true), and then IComponent::setState, which means that it is loading the state while the audio thread is active. I have also just noticed that my state-loading code is not thread-safe. And also, that loading state resets some important data that was set in the handler to setActive. Obviously, I programmed it without considering the possibility of setState being called while the plugin is activated and processing. So that’s probably why. Whoops.

So how do I close a thread?
well, just in case, I probably shouldn’t close it until I fix the issue. But I’m pretty confident that that was why.

2 Likes

yep, that was the problem. although Vst3Plugs: Failed to apply initial component state to controller (not critical) still gets printed to the log. so i assume that has something to do with the fact that i did not define any presets or an initial state (although the plugin initializes its state by itself).

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.