No internet connection
  1. Home
  2. How to

Temporarily turning off Deck navigation

By Zach Moody @Zach_Moody
    2022-02-14 21:50:46.548Z

    Thanks for the great product! It's really helped streamline my ADR and voiceover recording and I am learning more all the time. I have a few different decks that I use depending on what I'm recording and I'm wondering if there is a way to temporarily turn off the deck navigation? So if for instance I accidentally click into the Finder while I'm recording my stream deck doesn't switch to my Finder deck? It's great that it switches when I'm editing but can be a bit nerve racking when my stop button disappears during a take. Thanks

    • 16 replies

    There are 16 replies. Estimated reading time: 11 minutes

    1. Kitch Membery @Kitch2022-02-14 23:18:08.792Z

      Hi @Zach_Moody

      Currently, there is no easy way to temporarily bypass Application Triggers on decks however if you'd like to dive deeper, you could use a globalState variable in conjunction with the "Show Deck on Stream Deck" Macro Action.

      So you would have one script to enable/disable the deck switching with code like this;

      if (globalState.suspendDeckApplicationTrigger === undefined) {
          globalState.suspendDeckApplicationTrigger = false;
      } else {
          globalState.suspendDeckApplicationTrigger = !globalState.suspendDeckApplicationTrigger;
      }
      
      log("Deck Switching Enabled: " + globalState.suspendDeckApplicationTrigger);
      

      Then for each Deck that you want to be overridden, you'd remove the Application Trigger from those decks and create a standalone script that checks the globalState.suspendDeckApplicationTrigger, and if it's true the deck will not be displayed.

      The script for each of those decks would look like this;

      const commandID = "user:xxxxxxxxxxxxxxxxxxxxxxxxx:xxxxxxxxxxxxxxxxxxxxxxxxx"; //Command ID for the deck
      const streamDeckSerial = "xxxxxxxxxxxx"; //Stream Deck serial
      
      if (globalState.suspendDeckApplicationTrigger === undefined || globalState.suspendDeckApplicationTrigger === false) {
      
          sf.decks.get(commandID).showOnStreamDeck({
              device: sf.devices.streamDeck.getDeviceBySerialNumber(streamDeckSerial),
          });
      }
      

      Note:

      The command ID's for the decks will need to be customized for each Deck. (You can copy the Command ID to the system clipboard via the "Command" menu in SoundFlow);
      You'll also have to set the streamDeckSerial which you can find under "Setup Stream Deck" from the SoundFlow icon up by the clock.
      Then each deck launching script, you'd need to add application triggers.

      As you can see this can be achieved but requires some initial setup.
      I hope that helps.

      1. Thanks, I was hoping you'd share this Kitch :)

        Smaaaall fix needed - this would show if switching is disabled (suspended), not enabled - so the text should read "Deck Switching Suspended" maybe:

        log("Deck Switching Enabled: " + globalState.suspendDeckApplicationTrigger);
        

        Also this if block wouldn't do anything the first time it's run as false and undefined is considered the same state in your other script.

        if (globalState.suspendDeckApplicationTrigger === undefined) {
            globalState.suspendDeckApplicationTrigger = false;
        } else {
            globalState.suspendDeckApplicationTrigger = !globalState.suspendDeckApplicationTrigger;
        }
        

        I would just do this with no if block:

        globalState.suspendDeckApplicationTrigger = !globalState.suspendDeckApplicationTrigger;
        

        The "not" value of undefined is true so this would set it to true, ie. turn on the suspension, on the first run. So it would have effect.

        By the way, since undefined and false are both falsy, usually this if block would be written just with a simple "if not".

        if (!globalState.suspendDeckApplicationTrigger) {
        
            sf.decks.get(commandID).showOnStreamDeck({
                device: sf.devices.streamDeck.getDeviceBySerialNumber(streamDeckSerial),
            });
        }
        
        1. Kitch Membery @Kitch2022-02-15 01:08:51.727Z

          Ahh yeah of course. Thank @chrscheuer :-)

          I think I was overthinking it. :-)

      2. Z
        In reply toZach_Moody:
        Zach Moody @Zach_Moody
          2022-02-15 19:38:47.617Z

          Thanks so much Kitch and Christian. This worked great! I use a script to get to these specialized record decks so I will add the enable/disable script to them. Thanks again.

          1. Z
            In reply toZach_Moody:
            Zach Moody @Zach_Moody
              2022-02-18 16:16:40.577Z

              I had a chance to try this out at work and it worked great! The only problem I'm having is now when I use Soundflow at home without the stream decks I get a "Cannot find a connected Stream Deck device" error every time I go to Finder. Is there way to turn this off? Thanks

              1. You can just make it conditional on if the Stream Deck is found whether to run it or not:

                if (!globalState.suspendDeckApplicationTrigger) {
                    var streamDeck = sf.devices.streamDeck.getDeviceBySerialNumber(streamDeckSerial);
                    if (streamDeck) {
                        sf.decks.get(commandID).showOnStreamDeck({
                            device: streamDeck,
                        });
                    }
                }
                
              2. Z
                In reply toZach_Moody:
                Zach Moody @Zach_Moody
                  2022-02-22 03:15:23.031Z

                  Thanks so much Christian, That works perfectly.

                  1. Z
                    In reply toZach_Moody:
                    Zach Moody @Zach_Moody
                      2022-02-22 20:52:59.773Z

                      I changed this last night on my laptop which worked great at stopping the Stream Deck not found alerts. But when I got to the studio today the Stream Deck that I'm using these scripts with wouldn't load any decks and just sat on the blue SoundFlow logo. I started a problem ticket before I remembered I'd changed the scripts last night. When I reverted them back, the Stream Deck works fine and everything loads correctly.

                      Here is what I was using that worked great when the Stream Deck was connected but threw alerts at me every time I clicked into the Finder when the Stream Deck was not connected. (I removed my Stream Deck's serial numberbefore posting this but it is correct in the script.)

                      const commandID = "package:ckebxbwn7000dnc10wjn49gvv"; //Command ID for the deck
                      const streamDeckSerial = "serialnumber"; //Stream Deck serial
                      
                      if (!globalState.suspendDeckApplicationTrigger) {
                      
                          sf.decks.get(commandID).showOnStreamDeck({
                              device: sf.devices.streamDeck.getDeviceBySerialNumber(streamDeckSerial),
                          });
                      }
                      

                      Last night I changed it to this which got rid of the alert messages but stopped the Stream Deck from working.

                      const commandID = "package:ckebxbwn7000dnc10wjn49gvv"; //Command ID for the deck
                      const streamDeckSerial = "stream deck serial"; //Stream Deck serial
                      
                      if (!globalState.suspendDeckApplicationTrigger) {
                          var streamDeck = sf.devices.streamDeck.getDeviceBySerialNumber(streamDeckSerial);
                          if (streamDeck) {
                              sf.decks.get(commandID).showOnStreamDeck({
                                  device: streamDeck,
                              });
                          }
                      }
                      

                      Can you help me figure out what I did wrong?
                      Thanks

                      1. I'm guessing this is because there are really 2 different Stream Decks and you're referring to them here by serial number. The code should be changed so that it locates the stream deck based on something other than the serial number, or it should be made to support showing the deck on "any of X serial numbers"

                        1. Zach - the code above - did you ever actually put in the serial number of the stream deck in the placeholder, or did you use the above code verbatim?

                          1. ZZach Moody @Zach_Moody
                              2022-02-23 11:49:32.973Z

                              Hi Christian,
                              I did. I used the serial number of my XL in the actual script.

                              1. Right, and am I understanding correctly that it's a different XL you use in your studio from when you use your laptop?

                                1. You can find the first attached Stream Deck XL device like this (regardless of serial number):

                                  var device = sf.devices.streamDeck.connectedDevices.filter(d => d.buttonCount === 32)[0];
                                  log(device.name);
                                  

                                  (Note, here I'm also logging the device's name)

                                  1. Using that, you could change your code to:

                                    const commandID = "package:ckebxbwn7000dnc10wjn49gvv"; //Command ID for the deck
                                    
                                    if (!globalState.suspendDeckApplicationTrigger) {
                                        var streamDeck = sf.devices.streamDeck.connectedDevices.filter(d => d.buttonCount === 32)[0];
                                        if (streamDeck) {
                                            sf.decks.get(commandID).showOnStreamDeck({
                                                device: streamDeck,
                                            });
                                        }
                                    }```
                                  2. In reply tochrscheuer:
                                    ZZach Moody @Zach_Moody
                                      2022-02-23 12:03:29.338Z

                                      I’m only have two Stream Decks, one XL and one regular. I usually leave them at the studio out of laziness and use my iPad and an old iPhone if I want to access decks at home on my laptop.

                            • Z
                              In reply toZach_Moody:
                              Zach Moody @Zach_Moody
                                2022-02-22 23:10:23.721Z

                                Sorry, I should have said that I have two Stream Decks on this system, one regular and one XL. Is there a way to use that instead of the serial number? The XL is the one that does the deck switching. Right now I just use the regular one to launch applications and it always has the same deck on it. Thanks