No internet connection
  1. Home
  2. How to

Can SF3 Toggle 2 Macros on the Same SD Key?

By Ron Aston @Ron_Aston
    2019-09-15 02:43:16.419Z2019-09-15 03:21:59.940Z

    As a sound effects editor, I do a fair amount of Time Compression/Expansion editing in Pro Tools. I'm also a Smart Tool user 99.9% of the time. What I'd like to be able to do is :

    1.) Press a single key on my SD XL once to launch a SF macro that will switch me from Smart Tool mode to TCE tool mode.
    2.) Do my TCE edit(s)
    3.) Then press that same key again to launch a 2nd macro that switches me from the TCE tool back to the Smart tool mode again. Can this be done in SF without getting too geeky? :-)

    I've been able to create the Smart tool to TCE tool maccro on 1 SD key and another macro for TCE tool back to Smart tool on a 2nd SD key. I'd love to be able to do this with just one key if this functionality already exists in SF3. I'd think that a lot of PT sound effects editors might like the same thing.

    I'd also like to be able to create 1 SD key to toggle between Grid and Slip modes in PT.

    What do you think, Christian?

    Solved in post #4, click to view
    • 14 replies
    1. Hi @Ron_Aston

      Yes this should actually be quite simple (in a script). We don't have support for if/then/else logic like this in macros yet, but it will be possible in a future release.
      I'm not at a PT computer right now, but we can easily make this script.

      1. Ron Aston @Ron_Aston
          2019-09-15 04:16:13.463Z2019-09-15 04:22:58.039Z

          That would be SO awesome, Christian! I'll probably need some instruction on how to incorporate the script with the 2 macros that I made for this, unless there's a better way.

          Here are my 2 macros for this...

          From Smart Tool to TCE...

          From TCE back to Smart Tool...

          This currently works fine using 2 keys.

          Much appreciated. :-)

          1. Try this:

            if (sf.ui.proTools.mainWindow.cursorToolCluster.smartTool.invalidate().value.value !== "Selected") {
                sf.keyboard.press({ keys: 'f6,f6,f6,cmd+7' });
            } else {
                sf.keyboard.press({ keys: 'f6,f6' });
            }
            

            It uses the same technique as you to select the tools, but switches based on whether or not the smart tool is currently selected.

            ReplySolution
            1. Ron Aston @Ron_Aston
                2019-09-17 16:45:40.307Z

                This works perfectly, Christian. Thank you!

          2. M
            In reply toRon_Aston:
            Martin Pavey @Martin_Pavey
              2019-09-17 17:09:16.837Z

              This is an excellent one thanks Christian and Ron.

              I have a couple of others I would love as single key shortcuts if possible, but I can't see how to adapt this script to make them work.

              One is 'Find' in the clips list and 'Clear Find' as a toggle.

              Another is a shortcut that bumps up the waveform and the sets it back to normal.
              I currently do it with 2 keys, Command, option, right bracket x 2 on one key and Command, Option, Control, Left Bracket on the other.

              Is there an easy way to set up alternating Keyboard shortcut commands with Soundflow?

              Thanks

              1. Ron Aston @Ron_Aston
                  2019-09-17 17:14:10.527Z

                  Hi Martin....These are easy to create. I use these all the time. Just create these 2 Macros to launch the PT key commands for Find/Clear....

                  Find Clips - Command-Shift-F
                  Clear Find - Command-Shift-D

                  Good luck!

                  Ron

                  1. In reply toMartin_Pavey:

                    Hi @Martin_Pavey!
                    If you can't make these work off of Ron's suggestions, then please create these as new topics and we'll address them there :)
                    The short answer is that yes you can do this generically, but it's better to do specifically for each specific shortcut, since ideally you want them reacting to the state in Pro Tools, not just whether or not you pressed the button once or twice.

                    1. To give you a generic answer on how to have one button do 2 things regardless of Pro Tools' state, but just circle between doing A or B:

                      globalState.myScriptState = !globalState.myScriptState;
                      if (globalState.myScriptState) {
                          log('A');
                      } else {
                          log('B');
                      }
                      

                      Here we're using the global state variable myScriptState to toggle between logging either A or B depending on how many times I've pressed the button. First time, it'll log A, next B, next, it'll log A, then B, then A...

                      1. Note if you have different scripts / states you want to toggle, don't reuse the myScriptState variable in all your scripts. Since it's a global state you're setting, you need to rename myScriptState to something new for each script you have so that they don't interfere with each other's states.

                  2. M
                    In reply toRon_Aston:
                    Martin Pavey @Martin_Pavey
                      2019-09-17 19:48:04.312Z

                      Yes, I have them as shortcuts, but as a toggle on one key.
                      How would that work?

                      1. Ron Aston @Ron_Aston
                          2019-09-17 19:59:10.074Z

                          Ahhh. Sorry about that. I, too would love to be able to do that on 1 SD button. Maybe Christian can come to our rescue. :-)

                        • T
                          In reply toRon_Aston:
                          Tom H @Tom_H
                            2019-11-25 04:31:53.127Z

                            Hi Christian,
                            I have a similar request but can't seem to work out how to modify the macros to make it work for me:

                            In my case, I'd love to have use a StreamDeck button for the automation window that clicks "Punch Preview" with a first press, and then on a second press, clicks "AutoMatch".

                            Sorry, I'm not a natural programmer, and so wonder if you could help me?
                            Many thanks,
                            Tom.

                            1. Hi @Tom_H

                              You should be able to use the script here as a starting point, it will toggle between doing those two things.
                              https://forum.soundflow.org/-1001#post-11

                              To get the code for clicking Punch Preview and AutoMatch respectively, you should check out our UI Automation videos in the User Group on FB.

                              1. TTom H @Tom_H
                                  2019-11-28 22:35:01.291Z

                                  Thank you very much Christian. (& sorry it took me a little while to get back to you...)