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?
- Christian Scheuer @chrscheuer2021-12-07 17:41:14.042Z
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' });
- AAndrew Sherman @Andrew_Sherman
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?
Christian Scheuer @chrscheuer2021-12-07 18:17:00.868Z
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.
- AAndrew Sherman @Andrew_Sherman
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
Christian Scheuer @chrscheuer2021-12-07 18:34:03.045Z
That's amazing to hear!