No internet connection
  1. Home
  2. How to

"No Input" for all Audio Tracks

By Ingo Pusswald @ingo_luftrausch
    2020-04-17 08:55:11.338Z

    Hi,
    on large post-pro sessions I often want all "Audio Tracks" to have "No Input", except Aux etc, only "real" Audio Tracks.
    But I can´t figure out how to build such a script.

    Thanks!

    • 11 replies
    1. Ingo Pusswald @ingo_luftrausch
        2020-04-17 09:12:08.687Z

        There must be something like "Select Tracks by Type". But I can only find "Sort Tracks by Type".... Hmmm

        1. In reply toingo_luftrausch:
          Khonnor Wallace @Khonnor_Wallace
            2020-04-17 09:51:11.633Z

            Hi Ingo! You can use this:

            Hope it works!

            Khonnor

            1. In reply toingo_luftrausch:
              Ingo Pusswald @ingo_luftrausch
                2020-04-17 09:57:59.030Z

                I´m getting very close, I think...
                The last Step I´m missing is how to "Click Popup Menu" with modifiers "Option+Shift" to apply "no input" for all selected Tracks.

                1. In reply toingo_luftrausch:
                  Ingo Pusswald @ingo_luftrausch
                    2020-04-17 10:11:08.641Z

                    Ok,
                    it seems to be more complicated cause the Track Size (mono, stereo etc...) also comes into count. If the first selected track is for e.g. stereo, ProTools selects "no input" only to other selected stereo tracks.

                    1. In reply toingo_luftrausch:
                      Khonnor Wallace @Khonnor_Wallace
                        2020-04-17 10:16:09.552Z

                        You can try with this code:

                        sf.ui.proTools.appActivateMainWindow();

                        const popupMenu = sf.ui.proTools.trackOpenListPopupMenu().popupMenu;

                        popupMenu.menuClickPopupMenu({
                        menuPath: ["Show Only","Audio Tracks"],
                        });

                        const names = sf.ui.proTools.trackGetVisibleTracks().names;

                        sf.ui.proTools.trackSelectByName({
                        names: names,
                        });

                        sf.ui.proTools.selectedTrack.trackInputSearch();

                        1. Ingo Pusswald @ingo_luftrausch
                            2020-04-17 10:24:31.266Z

                            Good Idea, but same behaviour :-(

                            First Track is Master, if its mono, only other selected mono tracks will change to "no input". All other formats will be skipped.

                          • In reply toingo_luftrausch:
                            Christian Scheuer @chrscheuer2020-04-17 17:47:51.788Z2020-04-17 17:55:22.374Z

                            Try this:

                            
                            function isAudioTrack(trackName) {
                                var track = sf.ui.proTools.trackGetByName({ name: trackName }).track;
                                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 showAllTracks() {
                                sf.ui.proTools.mainWindow.trackListPopupButton.popupMenuSelect({
                                    menuPath: ['Show All Tracks']
                                });
                                sf.ui.proTools.mainWindow.invalidate();
                            }
                            
                            function setTrackHeightForAllTracks(size) {
                                var track = sf.ui.proTools.visibleTrackHeaders[0];
                                track.trackScrollToView();
                                track.trackSelect();
                            
                                var f = track.frame;
                                var popupMenu = track.popupMenuOpenFromElement({
                                    relativePosition: { x: f.w - 10, y: 5 },
                                    isOption: true,
                                }).popupMenu;
                                popupMenu.menuClickPopupMenu({
                                    menuPath: [size]
                                });
                            }
                            
                            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
                                });
                            }
                            
                            function selectInputForAllSelected(inputPath) {
                                if (sf.ui.proTools.selectedTrackCount == 0)
                                    return;
                            
                                //Scroll first track to view and select "no input" for all selected tracks
                                sf.ui.proTools.selectedTrack.trackInputSelect({
                                    inputPath: inputPath,
                                    selectForAllSelectedTracks: true,
                                });
                            }
                            
                            function main() {
                                sf.ui.proTools.appActivateMainWindow();
                            
                                //Make sure all tracks are shown
                                showAllTracks();
                            
                                //Make sure all tracks are medium sized so we can read if they're mono or stereo
                                setTrackHeightForAllTracks('medium');
                            
                                //Select all mono->mono tracks and set their input
                                selectAllAudioTracksOfWidth(0);
                                selectInputForAllSelected(['no input']);
                            
                                //Select all mono->X tracks and set their input
                                selectAllAudioTracksOfWidth(1);
                                selectInputForAllSelected(['no input']);
                            
                                //Select all stereo->X tracks and set their input
                                selectAllAudioTracksOfWidth(2);
                                selectInputForAllSelected(['no input']);
                            }
                            
                            main();
                            

                            It is quite complex because Pro Tools will only set input for selected tracks of the same width (mono or stereo) as the selected track.

                            1. KKevin madigan @Kevin_madigan
                                2021-12-22 18:15:52.706Z

                                Hi Christian. Would it be possible for you to modify the above code for just a range of selected tracks and not all tracks please.
                                I have tried
                                sf.ui.proTools.selectedTrack.trackInputSelect({
                                inputPath: ['no input'],
                                selectForAllSelectedTracks: true
                                });
                                but if the first track is not visible in the edit window it does not work.

                                1. Hey Kevin,

                                  On my way to have a bit of Christmas vacation, but feel free to ping me on the other side.

                                  Try searching for trackScrollToView, that will help you focus the first selected track. Then you'd need to get the selected track names before you call trackScrollToView, and then restore that selection afterwards.

                                  1. KKevin madigan @Kevin_madigan
                                      2021-12-28 20:52:38.169Z

                                      Thanks, will give it a shot

                                  2. In reply tochrscheuer:
                                    Ryan DeRemer @Ryan_DeRemer
                                      2022-04-05 05:33:47.500Z

                                      Hey @chrscheuer ,

                                      I playing with the script you provided about, and I wonder if there's a way to add an exemption to it? For example, excluding a Print track.