No internet connection
  1. Home
  2. How to

Reverb Tail Fader Down

By Blake Bunzel @Blake_Bunzel
    2021-10-27 00:25:58.536Z

    Hello,

    I'm not sure how simple of a script this would be but this is what I'm trying to do:
    When cutting to a new scene, I'd like to have a script that selects a 6 second range, then dips the volume automation to -inf (or -138db) for my selected reverb track, and puts a 1 frame ramp down to -inf (or -138db) from the first automation node so there is no pop (for the immediate fade down). Essentially killing any reverb tails that would go into the next scene with a quick macro.
    I've seen a couple of scripts in the forums here that Mr Scheps has had a hand in but I'm not sure how to dial them down to just needing the selected track.
    Preferably this would be for a 23.976/48k session (if that matters for the selected amount).

    • 4 replies
    1. B
      Blake Bunzel @Blake_Bunzel
        2021-10-27 18:02:58.826Z

        Ok I kinda have a jerry rigged script that I put together. It works though trying to figure out how to do to all selected tracks:

        sf.ui.proTools.appActivateMainWindow();

        sf.ui.proTools.selectionSet({
        selectionLength: '00:00:06:00'
        });

        const TARGET_TRACKS = sf.ui.proTools.selectedTrackNames;
        const VOLUME = '-138';
        sf.ui.proTools.appActivateMainWindow();
        const checkBoxes = [
        { Title: 'I/O', State: "Enable" },

        ];
        function setCheckboxState(item) {
        sf.ui.proTools.menuClick({
        menuPath: ['View', 'Edit Window Views', item.Title],
        targetValue: item.State,
        onError: "Continue",
        })
        }
        function setupScreen() {
        //Make sure I/O visible in Edit window
        checkBoxes.forEach(setCheckboxState);
        }

        function setVolume() {
        sf.ui.proTools.mainWindow.invalidate();
        if (sf.ui.proTools.selectedTrack.outputWindowButton.value.invalidate().value != 'open')
        sf.ui.proTools.selectedTrack.outputWindowButton.elementClick();

        var win = sf.ui.proTools.floatingWindows.allItems.filter(function (w) {
            return w.children.whoseTitle.is('Volume').exists;
        })[0];
        
        win.textFields.whoseTitle.is('Volume Numerical').first.elementClick();
        sf.keyboard.type({ text: VOLUME });
        sf.keyboard.press({ keys: 'enter' });
        

        }

        function main() {
        setupScreen();

        TARGET_TRACKS.forEach(function (track) {
            sf.ui.proTools.trackSelectByName({ names: [track] });
        
            //Set the volume
            setVolume();
        });
        
        //Select original track(s) again
        sf.ui.proTools.trackSelectByName({ names: TARGET_TRACKS });
        

        }

        main();

        sf.ui.proTools.mainTrackOutputWindow.getElement("AXCloseButton").elementClick();

        sf.ui.proTools.automationWindow.writeAutoToSelectionButton.proToolsAutomationClickButton();

        sf.ui.proTools.appActivateMainWindow();

        sf.ui.proTools.selectionSet({
        selectionLength: '00:00:00:02'
        });

        sf.keyboard.press({
        keys: "x",
        });

        1. Hey Blake,
          When you get a moment you should run through this tutorial and re-edit this post so your code displays properly. This makes it much, much easier for others to help with your code.

          1. BBlake Bunzel @Blake_Bunzel
              2021-10-27 18:29:51.931Z

              Sorry about that! Newb move there. One thing I noticed is that while this does work, it does require to have the volume automation lane to be visible.

              
              sf.ui.proTools.selectionSet({
                      selectionLength: '00:00:06:00'
              });
              
              
              const TARGET_TRACKS = sf.ui.proTools.selectedTrackNames;
              const VOLUME = '-138';
              sf.ui.proTools.appActivateMainWindow();
              const checkBoxes = [
                  { Title: 'I/O', State: "Enable" },
              
              ];
              function setCheckboxState(item) {
                  sf.ui.proTools.menuClick({
                      menuPath: ['View', 'Edit Window Views', item.Title],
                      targetValue: item.State,
                      onError: "Continue",
                  })
              }
              function setupScreen() {
                  //Make sure I/O visible in Edit window
                  checkBoxes.forEach(setCheckboxState);
              }
              
              function setVolume() {
                  sf.ui.proTools.mainWindow.invalidate();
                  if (sf.ui.proTools.selectedTrack.outputWindowButton.value.invalidate().value != 'open')
                      sf.ui.proTools.selectedTrack.outputWindowButton.elementClick();
              
                  var win = sf.ui.proTools.floatingWindows.allItems.filter(function (w) {
                      return w.children.whoseTitle.is('Volume').exists;
                  })[0];
              
                  win.textFields.whoseTitle.is('Volume Numerical').first.elementClick();
                  sf.keyboard.type({ text: VOLUME });
                  sf.keyboard.press({ keys: 'enter' });
              }
              
              function main() {
                  setupScreen();
              
                  TARGET_TRACKS.forEach(function (track) {
                      sf.ui.proTools.trackSelectByName({ names: [track] });
              
                      //Set the volume
                      setVolume();
                  });
              
                  //Select original track(s) again
                  sf.ui.proTools.trackSelectByName({ names: TARGET_TRACKS });
              }
              
              main();
              
              sf.ui.proTools.mainTrackOutputWindow.getElement("AXCloseButton").elementClick();
              
              sf.ui.proTools.automationWindow.writeAutoToSelectionButton.proToolsAutomationClickButton();
              
              
              sf.ui.proTools.appActivateMainWindow();
              
              sf.ui.proTools.selectionSet({
                      selectionLength: '00:00:00:02'
              });
              
              
              sf.keyboard.press({
                  keys: "x",
              });
              
              
              1. BBlake Bunzel @Blake_Bunzel
                  2021-10-27 19:15:35.646Z

                  Ok I found this in the forum to toggle the view of the track but looks like it doesn't work if the track is anything smaller than the "medium" view. I think I can put a small script to toggle the track view to medium but thinking there might be a sleeker workaround?

                  const viewTwo = 'volume'
                  
                  sf.ui.proTools.appActivateMainWindow();
                  
                  const oldView = sf.ui.proTools.selectedTrack.popupButtons.whoseTitle.is("Track View selector").first.value.invalidate().value;
                  
                  if (oldView === viewOne) {
                  
                      sf.ui.proTools.selectedTrack.popupButtons.whoseTitle.is("Track View selector").first.popupMenuSelect({
                          isShift: true,
                          isOption: true,
                          menuPath: [viewTwo],
                      });
                  
                  } else {
                  
                      sf.ui.proTools.selectedTrack.popupButtons.whoseTitle.is("Track View selector").first.popupMenuSelect({
                          isShift: true,
                          isOption: true,
                          menuPath: [viewOne],
                      });
                  }```