My idea was if one can maintain the same setup (audio/MIDI wiring etc), but occassionally change one plugin (e.g. reverb). This could be useful within variations or even global rackspace (with “reverb section”).
After changing the plugin, its preset could be loaded. This works for me, but I couldn’t get any result from ReplacePlugin() command.
I would like to strongly advice you to first push the regular GP functions to their limits and you will probably conclude that this kind of exotic scripting idea is probably not necessary, not to say dangerous because replacing plugins on the fly while playing is probably not something for which you can guarantee an absolute safety.
Sure, pushing regular functions to their limits is what I do anyway But this function could be useful, like LoadGPPreset which is one of the best new functions I think and can have huge impact on overall workflow and number of plugins used.
Yes, this is what I was trying to do recently: to have “reverb unit” in global rackspace which is able to switch between 7 different reverb plugins. In my setup, this could save 50+ instances of reverb in 80+ rackspaces. Unfortunately, it is not so simple as to create one long serial chain of plugins and bypass them on the fly because there is cumulated latency between the plugins in the chain. E.g. CSR reverbs, which sound great, do it. They must be connected in parallel, but this also means that there must be some switching plugin between them otherwise there is a mismatch in audio path, wrong volumes etc. And of course, a lot of scripting…
Now imagine the difference: to have just one instance there, which could replace the plugin currently in need. Then load its preset and this could be maximally simple and effective. So this was my dream…
Per the documentation,
Load a GP plugin preset in the background - seriously experimental and probably very unsafe
Per the documentation
Replace the plugin in the specified block - experimental
In particular, anything marked experimental can go away without warning in a future update — never depend on such functions please. Basically, in such cases, All Bets Are Off!
I might be missing something, but of you run them parallel, then connect them all to the same target (bypass all but the one you need of course), why would there be a mismatch in audio path?
Of course I have seen this warning, I was trying it like an experiment. But I could say that all the plugins were perfect with LoadGPPreset, no crash whatsoever. Maybe there should be a lot of beta testing this function with different plugins. I have tried very different kinds of plugins - Pianoteq 7, Blue3 organ, Kontakt 4 and Independence samplers, several reverbs, even Audio File Player with multi track audio files - so far everything was perfect. It would be pitty to see this function going away.
Replacing plugin is perhaps more dangerous and I understand that it should not be relied upon.
Because the plugin is bypassed, but not the routed audio itself. So in order to maintain proper volume and routing behavior, I used to direct audio via multi channel audio mixer, which was directing signal to different reverb plugins. The route to actual reverb was soloed, the rest was muted.
Well, theoretically not, but I have tried it with CSR reverb plugin making just very small latency (0.1 ms) and finally the difference was audible. This issue is discussed elsewhere here in the forum.
OK, you also said audio path, that’s what confused me. Makes sense. So along with bypassing, you could group mute buttons of the mixer, so in the same bypass action, automatically those bypassed signals would also be muted. Seems more reliable to me than swapping plugins.
Just for your curiosity, I have tried to do simple setup with one rackspace + 2 variations and one reverb plugin to test this command. The code goes like this:
Var Reverb : PluginBlock
On Variation (oldIndex : Integer, newIndex : Integer)
Var name : String = GetVariationName(newIndex)
path : String = "/Library/Audio/Plug-Ins/VST/"
Select
name == "Default" Do
ReplacePlugin(Reverb, path + "OrilRiver.vst")
name == "Variation 1" Do
ReplacePlugin(Reverb, path + "OldSkoolVerb.vst")
End
End
In case of VST and VST3 plugins, ReplacePlugin() really switched between plugins several times and then stopped to do it. In case of AU (Components), there was no reaction.