No internet connection
  1. Home
  2. How to

Toggle mute selected tracks in Pro Tools

By Andrew Sherman @Andrew_Sherman
    2021-12-07 06:51:03.629Z

    I have multiple tracks selected in Pro Tools. The first is unmuted, the rest are muted. I would like to mute the first one, and then unmute the next one (I'm auditioning takes, but not using playlists). When I run the command the next time, I would like to mute track 2 and unmute track 3, etc. So only one of the selected tracks is unmuted at one time, the rest remain muted.

    The tracks do not have specific names as this changes, so I'm trying to control the tracks based on their status as "selected" tracks.

    How can I access the tracks based on their selection?

    Solved in post #2, click to view
    • 5 replies
    1. Try something like this (untested):

      
      let tracks = sf.ui.proTools.selectedTrackHeaders.map(t => ({
          track: t,
          isMuted: t.isMuted,
      }));
      
      //Find the index of the currently unmuted track
      let unmutedIndex = tracks.findIndex(t => !t.isMuted);
      
      //Now mute that track
      if (unmutedIndex >= 0)
          tracks[unmutedIndex].track.trackSetMute({ targetValue: 'Enable' });
      
      //Find the next index of the track to unmute
      let nextIndex = unmutedIndex + 1;
      if (nextIndex >= tracks.length)
          nextIndex = 0;
      
      //Unmute the next track
      tracks[nextIndex].track.trackSetMute({ targetValue: 'Disable' });
      
      
      Reply1 LikeSolution
      1. AAndrew Sherman @Andrew_Sherman
          2021-12-07 18:03:59.013Z

          That's super-impressive Christian, considering it's untested. Do you dream in code?! Works perfectly. If I want to alter it to solo instead of mute, do I just change "track.trackSetMute" to "track.trackSetSolo" instead?

          1. Hahaha ;) Happy it worked!

            For soloes, would the logic need to be the exactly same? Ie. all tracks soloed except one? Or the reverse? This would have bearing on which changes would need to be made.

            1. AAndrew Sherman @Andrew_Sherman
                2021-12-07 18:33:37.094Z

                Leave it with me Christian, would be a good exercise for me to play with variations. On a separate note I've been finding some amazing possibilities using javascript with Adobe After Effects and Premiere, and it's all driven from Soundflow as a central platform. My script library is a work in progress but has already transformed my workflow

                1. That's amazing to hear!