No internet connection
  1. Home
  2. How to

How to select all mono or stereo tracks?

By Ray Wilson @Ray_Wilson1
    2020-09-07 15:46:42.013Z


    I'm creating a series of plugin chains for PT and would like to select all of my mono or stereo tracks and run the macro. I have a few plugins that require specific presets, which I can open against the first selected track, but not the others (although the insert is added to those). How do I load those presets on each additional track with that plugin?

    Solved in post #6, click to view
    • 8 replies
    1. Hi Ray,

      Just to make sure I understand.. Are you talking about Track Presets or Plugin Presets? Is there a reason you wouldn't want to use track presets for this? It could make the whole process a bit smoother, I think.

      1. RRay Wilson @Ray_Wilson1
          2020-09-09 05:27:25.506Z

          The track preset instantiates a plugin, which needs to load a preset. I have the preset configured to apply to all mono or stereo tracks. The preset only affects the first track. Can I make it load on all of the subsequent tracks in the preset operation?

          1. Ah gotcha. No I don't think Pro Tools supports that as a batch operation. But my question is still why you don't have the plugin-preset already loaded in the track preset? Then it's just a single operation.
            I'm sure there's a good reason, but understanding why might make it easier to come up with the best solution :)

            1. GGabriel Lundh @Gabriel_Lundh
                2020-11-09 12:28:18.794Z

                Hi Christian!
                I'm looking to just do as this threads header suggest - have one script that select all stereo audio tracks in a session and one script that selects all mono audio tracks in a session. Is this doable?

                Thanks as always!

                1. If you only need to distinguish between mono and stereo tracks, you can try this:

                  function isAudioTrack(trackName) {
                      var track = sf.ui.proTools.trackGetByName({ name: trackName }).track;
                      if (!track) return;
                      return track.title.value.indexOf('Audio Track') >= 0;
                  }
                  
                  function getTrackWidth(trackName) {
                      var track = sf.ui.proTools.trackGetByName({ name: trackName }).track;
                      var width = track.groups.whoseTitle.is('Audio IO').first.sliders.whoseTitle.contains('Pan').count;
                      return width;
                  }
                  
                  function selectAllAudioTracksOfWidth(width) {
                      var names = sf.ui.proTools.trackNames.filter(isAudioTrack).filter(t => getTrackWidth(t) === width);
                      if (names.length === 0) return;
                      sf.ui.proTools.trackGetByName({ name: names[0] }).track.trackScrollToView();
                      sf.ui.proTools.trackSelectByName({
                          names: names,
                          deselectOthers: true
                      });
                  }
                  
                  //To select all mono audio tracks
                  //selectAllAudioTracksOfWidth(1);
                  
                  //To select all stereo audio tracks
                  selectAllAudioTracksOfWidth(2);
                  
                  Reply1 LikeSolution
                  1. GGabriel Lundh @Gabriel_Lundh
                      2020-11-09 13:18:41.735Z

                      Works like a charm, thank you as always Christian!

                      Just a heads up if somebody pastes the script - The // in front of "//selectAllAudioTracksOfWidth(1);" must be removed to get the mono version working.

                      Thank you Christian!

                      1. Awesome :)

            2. In reply toRay_Wilson1:
              Bryan Daste @Bryan_Daste
                2024-04-04 07:07:42.527Z

                I'm not getting any action at all when I trigger this script. I'm a newbie here, so I'm probably doing something wrong. What is supposed to happen?