No internet connection
  1. Home
  2. How to

How to bypass all instances of a particular plugin across all tracks

By Gary Keane @Gary_Keane
    2024-10-17 14:50:16.912Z

    Hi guys, is it possible to bypass all instances of one particular plugin across the tracks in a PT session?

    I use TrackSpacer and love it, but I need to turn it off when printing stems or instrumentals so I don't get that sidechain pump from the vocals when the vocals are muted.

    Ideally a command to just find a mute all instances of TrackSpacer.

    Thanks in advance!

    • 2 replies
    1. In reply toGary_Keane:
      Chad Wahlbrink @Chad2024-10-17 16:42:23.203Z

      Hi @Gary_Keane,

      I'm not aware of a great solution for doing this "quickly " without some setup. The best tool I know for selecting tracks that include a specific plugin across an entire session would be Scheps Track Selector. This is a premium package on the Store, but once it scans your session, you can search for tracks based on the presence of named inserts, sends, inputs, outputs, etc.

      If you know all of the tracks with TrackSpacer, you could create a group for them and use that group to select the tracks moving forward.

      After you have selected the tracks, you can use a script to bypass the named plugin (TrackSpacer, in this instance) across all of the selected tracks. I modified the remove all inactive inserts/sends script from Samuel Henriques to create a script to bypass named plugins across all selected tracks. You can use the script shared below in tandem with whatever method you choose to select tracks with TrackSpacer.

      
      let namedPlugin = 'Trackspacer 2.5'
      
      /**
      * @param {Object} trackHeader - Track Header
      * @returns {Object}
      * @property {number} trackHeight
      * @property {'micro'|'mini'|'small'|'medium'|'large'|'jumbo'|'extreme'|'fit to window' } trackSize
      */
      function getCurrentTrackHeight(trackHeader) {
      
          let h = trackHeader.frame.h
      
          let originalTrackHeight;
      
          switch (true) {
              case (h <= 16):
                  originalTrackHeight = 'micro';
                  break;
              case (h === 23):
                  originalTrackHeight = 'mini';
                  break;
              case (h >= 43 && h <= 61):
                  originalTrackHeight = 'small';
                  break;
              case (h >= 79 && h <= 116):
                  originalTrackHeight = 'medium';
                  break;
              case (h >= 135 && h <= 235):
                  originalTrackHeight = 'large';
                  break;
              case (h >= 257 && h <= 420):
                  originalTrackHeight = 'jumbo';
                  break;
              case (h > 440):
                  originalTrackHeight = 'extreme';
                  break;
          }
          return { trackHeight: h, trackSize: originalTrackHeight }
      }
      
      
      
      /**
      * @param {'micro'|'mini'|'small'|'medium'|'large'|'jumbo'|'extreme'|'fit to window' } size
      */
      function setTrackSize(size) {
      
          const selectedTrackH = sf.ui.proTools.selectedTrackHeaders[0]
          const hasHeaderHeightPopup = selectedTrackH.frame.h <= 79
      
      
          try {
              selectedTrackH.popupMenuSelect({
                  anchor: "MidRight",
                  relativePosition: { x: - 10, y: 0 },
                  menuPath: [size],
                  onError: "Continue",
              })
          } catch (err) {
              // Try header left poput
              if (hasHeaderHeightPopup) {
                  sf.ui.proTools.selectedTrack.popupButtons.allItems[2].popupMenuSelect({
                      menuPath: ["Track Height", size],
                  });
              };
          };
      };
      
      function getInsertAndSendInfo() {
          let infoObj = { inserts: [], };
      
          for (var i = 0; i < 10; i++) {
              const insert = sf.ui.proTools.selectedTrack.insertButtons[i];
              if (insert.exists) {
                  if (insert.invalidate().value.value.startsWith(namedPlugin)) {
                      infoObj.inserts.push(i + 1);
                  };
              };
          };
          return infoObj
      };
      
      /**
       * @param {Object} param 
       * @param {Object} param.insInfo 
       */
      function bypassNamedPlugin({ insInfo,}) {
      
          const inserts = insInfo.inserts;
      
          if (inserts) {
              inserts.forEach(insert => {
                  sf.ui.proTools.selectedTrack.trackInsertToggleBypass({
                      insertNumber: insert,
                  });
              });
          };
      };
      
      function enableMenus(currentValue) {
          sf.ui.proTools.menuClick({
              menuPath: ["View", "Edit Window Views", currentValue],
              targetValue: "Enable"
          });
      }
      
      const menus = [
          "Inserts A-E",
          "Inserts F-J",
      ]
      
      const forbidenHeights = [79, 61, 23, 16]
      
      function main() {
      
          //Activate Pro Tools
          sf.ui.proTools.appActivate();
          sf.ui.proTools.invalidate();
      
          //Enable view of Inserts and Sends
          menus.forEach(enableMenus)
      
          sf.ui.proTools.invalidate();
      
          //Get selected tracks
          const originalTracksH = sf.ui.proTools.selectedTrackHeaders;
      
          try {
      
              //Do for each track
              for (var i = 0; i < originalTracksH.length; i++) {
                  const thisTrack = originalTracksH[i]
      
                  //Select track
                  thisTrack.trackSelect();
      
                  //Scroll track into View
                  thisTrack.trackScrollToView();
      
                  const thisTracksize = getCurrentTrackHeight(thisTrack)
      
                  // Resize if needed
                  if (forbidenHeights.includes(thisTracksize.trackHeight)) { setTrackSize("small") }
      
                  const slotsToRemove = getInsertAndSendInfo()
      
                  bypassNamedPlugin({ insInfo: slotsToRemove, })
      
                  // Resize if changed
                  if (forbidenHeights.includes(thisTracksize.trackHeight)) { setTrackSize(thisTracksize.trackSize) }
              };
      
          } finally {
      
              //Restore previously selected tracks
              sf.ui.proTools.trackSelectByName({ names: originalTracksH.map(th => th.normalizedTrackName) });
          }
      
      };
      
      main();
      
      
      1. G
        In reply toGary_Keane:
        Gary Keane @Gary_Keane
          2024-10-20 20:24:55.679Z

          Awesome Chad, thank you so much for this, much appreciated. I’ll give it a whirl.

          Cheers!