Hi, Loading a VSTPlugin is an asynchronous process?
How to wait until the plugin is loaded to perform its configuration (e.g. load a preset) ?
In my example, loading a preset returns an error no plugin! in executed at once, but works fine if executed line by line.
(
~bassvst = VSTPluginController(Synth(\bassvst));
// open a plugin by name/key (might require VSTPlugin.search!)
~bassvst.open("sforzando.vst3", editor: true, verbose: false);
try {
~bassvst.loadPreset("MeatBallPizz");
} { |err| format("While loading the preset: %",err.errorString).warn;
~usevst=false;
};
};
)
The .open command has an action argument which you can supply with a function that will be called when itâs ready. You can put the preset loading stuff in there and it will happen nicely and when itâs ready
Indeed. Thanks.
To be noted that the doc leads to confusion: " action: an action to be called with this and a Boolean (success/fail)."
In this âactionâ function, one must not refer to the controller by this but by the variable holding it ( ~bassvst in my case).
To be noted that the doc leads to confusion: " action: an action to be called with this and a Boolean (success/fail)."
Yeah, the wording is a bit misleading. What I meant was that the function will be called with the VSTPluginController instance and a Boolean as arguments. This means that you donât need a variable to refer to the instance: