Asked by @Sander_Houtman on FB:
Hi Christian,
Is it possible to make a multi switch via streamdeck?
For instance I press a button on the streamdeck <> it opens RX ambience match and learns what I've got selected in Pro tools. I select a part where I want the amb match to fill and press the same streamdeck button again (instead of a seperate render button) and it closes the amb match window.
thanks!
- Christian Scheuer @chrscheuer2019-11-21 08:41:10.649Z
The beauty of asking here on the forum is that you'll see there have already been questions asked about this in the past:
Christian Scheuer @chrscheuer2019-11-21 08:42:29.224Z
The way to do this is to make a condition in your script that determines which of the actions you want to happen.
In your case, you want to just toggle between 2 actions, but you won't be able to read the state of the RX ambience match (ie. has it learned or not) so you'll have to keep track of that state yourself.
This is achievable via globalState.Christian Scheuer @chrscheuer2019-11-21 08:45:00.535Z
Here's an example of how to do it if you can read the state - for example if X do A, else do B:
https://forum.soundflow.org/-1048#post-2Christian Scheuer @chrscheuer2019-11-21 08:45:59.675Z
In your case we can't read the state, so we can save it ourselves, like this:
if (globalState.hasLearnedRXMatch) { //We have already learned. So insert render code here } else { //We have not learned yet. So insert learn code here. } globalState.hasLearnedRXMatch = !globalState.hasLearnedRXMatch;
- In reply tochrscheuer⬆:SSander Houtman @Sander_Houtman
Thanks.
I'm not into scripting (yet). I'm using the actions only so far. Is it possible for you to add this function to the actions in a future update?Christian Scheuer @chrscheuer2019-11-21 09:03:30.606Z
Hi Sander.
We will add control flow in the actions some time next year yes.
For now, you can create your actions in the macro editor and then just copy/paste the Javascript code from the actions in the script where I put "insert X code here".- SSander Houtman @Sander_Houtman
Great thanks, will try this out now! Working on an M+E track so I have to amb match and fill a lot.
Christian Scheuer @chrscheuer2019-11-21 09:12:04.927Z
Cool :) Let me know if you get stuck.