Feature request: Subroutines
Long story short, I (finally!) got my church rig updated to where it'll run the current version of Adv. SS - it was hardware-stuck until now, on Lubuntu 20.04 and corresponding versions of OBS and Adv. SS - and so I'm working on the automation again.
This rig has a finished live feed from the FOH console, controlled remotely by the Broadcast Engineer, but it inherits the FOH mutes and live tweaks, plus a pre-recorded Welcome video that OBS plays itself. For the Welcome video, and at the end of the service, I want to fade down the live feed automatically, so that the FOH Engineer doesn't have to consider the Broadcast as much. I couldn't do that with OBS 25 and that version of Adv. SS, but now I can!
The catch though, is that I actually have 3 sources in OBS, as copies of the same input: Stereo to Broadcast, Mono to Headphones, and Stereo to Headphones. That's so a pair of hotkeys can switch the Headphones between mono and stereo without affecting the Broadcast, because most viewers have their speakers too close together to produce meaningful stereo, but some have headphones. To keep a decent rendition of what they hear, I need to fade all three together, always.
I can do that, by always using 3 actions like this:
View attachment 92164
but it would be a lot more convenient and maintainable to condense those three that are always together, into a single action. (What's actually shown here, is the same concept for a Noise Gate, to handle the analog cable noise when it's supposed to be silent, but sometimes I want to keep that noise because cutting in and out is even more distracting than having it constant.)
I've tried the trick where a macro has its condition to always run as fast as it can forever, but pauses itself at the end, and then another macro unpauses it. That technically works - turns it into a one-shot on demand - but the "subroutine" actually runs *after* the main macro finishes, when I really want the main one to wait in-place for the sub to finish. If they run in parallel, that's fine too; I'll just put a Wait action in the calling macro.
I've also tried setting a variable instead, so that the "subroutine" macro waits for that variable, does its thing, and then clears it. Same thing: the main macro finishes, and *then* the subroutine runs.
I tried setting the subroutines to "run in parallel", but that didn't change anything. I didn't think to try *everything* running in parallel. Would that make it run immediately? What other problems would it cause? I get the impression that that feature is supposed to be used sparingly.
If it does work, without causing other problems, it would be an okay workaround, but I'd really like to see a proper call / return structure. Arguments and return values would be awesome as well, but the present system of a bunch of global variables technically covers their basic use already. (now watch someone try to compute
Ackermann's function on it!)
Continuing the concept of "function arguments", it would also be nice to have the volume level and fade time accept variables, so I could have just one "subroutine" for each concept - Volume, Gate, etc. - that takes the specifics as arguments - Level and Time, {En|Dis}able, etc. And since everyone else who wants to use arguments like that, will have a different action to do it on, you'd probably have to have *everything* take variables in addition to their constants. I hope that's not too much of a paradigm shift.
(This is really becoming a programming language, isn't it? You sure you don't want to just pawn it off to a Python interpreter? Make an API for everything that a plugin might possibly connect to, and the rest is standard Python, at an "add your code here" sort of level that "just works" when you don't mess with the rest of it. Maybe have a menu system, similar to what the macros have now, that insert the corresponding API calls.)