Hi, I’m new to all of this so pardon if I get some of the terminology incorrect. I’m looking to use Surge-XT in a live environment, and I’d like to be able to change patches/presets automatically during the course of a song. I’d also like to have some additional parts pre-recorded on separate tracks, for things I can’t play live at the same time, as one might expect. I’m hoping that this is a supported use case of Ardour, but I don’t exactly know.
The problem is, I can’t seem to find a way to effectively change patches or presets in Surge using Ardour’s automation.
Things I’ve tried so far…
I can insert a patch/program change event into the MIDI channel. This does have an effect, however Surge-XT does not handle these events in a useful way. There is an issue in their github about this, but suffice it to say, it’s not suitable.
Create presets for the Surge-XT plugin at the Ardour level (meaning at the top of the window when you open the plugin’s GUI, not as patches within Surge-XT itself). These Ardour-level presets seem to save/restore the state of the plugin when I use them, but I’m unable to figure out how to change these using either the Ardour automation or using any kind of event I can add to the midi track.
Create few Surge-XT tracks, one for each sound I want to use in a song, and use the automation to fade in/out each one, as the song progresses. This works in theory, but the problem is that all of the Surge-XT instances all run all of the time, even the muted ones, and the CPU load is such that I get pops in the audio from having too many instances all running.
Do something like number three, but turn the plugin on/off at appropriate times during the song. Well, I didn’t actually do this because I can’t find any controls which will allow me to do it, but it’s something I looked for.
Do something like number three, but change the MIDI routing at appropriate times during the song to make the inactive Surge-XT instances not play (and not use any CPU). Like #4, I haven’t figured out how to change MIDI signal routing using the automation.
So of the above things, I think I’d most like to do #2, if it’s at all possible, based on my current understanding. Did I miss a way to do this? Am I barking up the wrong tree here? An answer like “you want some other software for this” is an acceptable answer. Like I said, I’m new to all of this, so if this isn’t the kind of thing that Ardour is really designed for I can accept that answer.
Hi there! I’m also pretty new to all of this, but I’ve been working on some Lua scripts for Ardour recently, and switching presets seems like exactly the kind of thing scripting was designed for.
I threw together a quick script for you. It comes in two pieces: a file called preset_locator.lua which is a DSP processor that you put on a track just before the plugin you want to automate (meaning, just before Surge in your case), and a session script in a file called preset_loader.lua that you run using the Edit / Lua Scripts / Script Manager / Session Scripts.
You’ll need to copy the two files into Ardour’s scripts folder before starting Ardour in order for them to be visible. (For me on linux, that’s ~/.config/ardour7/scripts)
And here’s a demo of it in action.
See if this does what you want. When you launch the preset_loader session script, it will print to the session log a numbered list of all of the presets. Afterwards, you should be able to automate the Preset Locator’s ID to swap between presets.
If you need to print out that list again, you’ll have to unload and reload the session script.
(Swapping presets quickly was very taxing on my machine. Be warned. Also, please test this thoroughly before going into a live setting.)
I gave this a go last night, and it definitely does something, but the presets it sets are not deterministic. When I set Locator_ID to 1, for example, it doesn’t set the same preset every time. The session script also uses a lot of CPU when idle. This may or may not be an issue if I increase the buffer size.
I ended up building Surge-XT from source and hacked in something that works for now. Basically when a program change event comes in, I look for a patch named MIDI-NNN where NNN is the patch number requested. This does the job but I doubt I’ll get it merged.
Thank you so much for the scripts though. It’s given me something to think about with respect to scripting Ardour for related purposes. I will go through the docs and get a handle on how the lua stuff all works.
You can definitely rate-limit the session script, and you are right that it uses a lot of resources. Right now it checks on every buffer.
I have no experience with the deterministic aspect though. I’m a bit surprised to hear that it’s not consistent, but also not very surprised either.
Your solution of looking for a named preset is clever! If you decide that you want to use lua scripting after all, plugins in lua have a plugin:preset_by_label() method that can get a named preset, so you could do the same thing instead of doing what is currently in the script and searching for the nth preset by number. Ardour comes with some sample scripts, and here’s one that deals with getting/loading presets. (See lines 35-39) ardour/s_pluginutils.lua at master · Ardour/ardour · GitHub