No internet connection
  1. Home
  2. How to

Changing volume/peak indicators

By Eli Crews @Eli_Crews
    2022-02-18 23:24:41.732Z

    My first question! I apologize if this has been asked before (I couldn't find it searching), but is there a way to change the little box that displays the numerical value for "vol"/"dly"/"pk" in either the Edit or Mix window? I tried doing Click UI Element, but A) I couldn't find how to add modifiers to that action - changing the value needs a cmd-click on a Mac - and B) it didn't seem like regular click was working in there either, since it didn't reset the peak value (I know how to do that with a EuControl menu command already).

    Thanks in advance!
    Eli

    Solved in post #7, click to view
    • 6 replies
    1. E
      Eli Crews @Eli_Crews
        2022-02-24 00:09:44.394Z

        I'm coming to the conclusion that a lack of an answer means this isn't possible. Anybody want to prove me wrong?

        1. Hey @Eli_Crews, sorry for the slow response on this one.

          Yes, this is possible! The following will command+click on the Volume Indicator of the selected track (Edit window only).

          function toggleSelectedTracksAudioVolumeIndicator() {
              sf.ui.proTools.selectedTrack.groups.whoseTitle.is("Audio IO").first.sliders.first.mouseClickElement({ isCommand: true });
          }
          
          toggleSelectedTracksAudioVolumeIndicator();
          
          1. EEli Crews @Eli_Crews
              2022-02-25 21:22:54.174Z

              No problem, and thank you so much!!! This is really great, but: extra points if there's a script that also works in the mix window AND skips over delay amount so functions like a volume/peak toggle?

              1. EEli Crews @Eli_Crews
                  2022-02-25 21:24:53.910Z

                  (Of course that would only apply in Narrow Mix Window mode, in regular mode you can see both volume and peak simultaneously...)

                  1. Haha, half a point if I make it toggle but just on the Edit window?

                    /** @param {'Volume' | 'Delay' | 'Peak' } targetIndicator */
                    function setTrackAudioVolumeIndicatorTo(targetIndicator) {
                        sf.ui.proTools.appActivateMainWindow();
                        sf.ui.proTools.mainWindow.invalidate();
                    
                        const selectedTrack = sf.ui.proTools.selectedTrack;
                        const volumeSlider = selectedTrack.groups.whoseTitle.is("Audio IO").first.sliders.first
                        const currentIndicator = volumeSlider.title.value;
                        let clickCount;
                    
                        if (targetIndicator === currentIndicator) return;
                    
                        if (targetIndicator === 'Volume' && currentIndicator === 'Peak' ||
                            targetIndicator === 'Delay' && currentIndicator === 'Peak' ||
                            targetIndicator === 'Peak' && currentIndicator === 'Delay') {
                            clickCount = 1;
                        }
                    
                        if (targetIndicator === 'Volume' && currentIndicator === 'Delay' ||
                            targetIndicator === 'Delay' && currentIndicator === 'Volume' ||
                            targetIndicator === 'Peak' && currentIndicator === 'Volume'
                        ) {
                            clickCount = 2;
                        }
                    
                        volumeSlider.mouseClickElement({
                            isCommand: true,
                            anchor: 'MidCenter',
                            clickCount
                        });
                    }
                    
                    function toggleBetweenVolumeAndPeakIndicators() {
                        sf.ui.proTools.appActivateMainWindow();
                        sf.ui.proTools.mainWindow.invalidate();
                    
                        const currentIndicator = sf.ui.proTools.selectedTrack.groups.whoseTitle.is("Audio IO").first.sliders.first.title.value;
                    
                        if (currentIndicator === 'Volume') setTrackAudioVolumeIndicatorTo('Peak');
                        if (currentIndicator === 'Peak') setTrackAudioVolumeIndicatorTo('Volume');
                    }
                    
                    toggleBetweenVolumeAndPeakIndicators();
                    
                    1. EEli Crews @Eli_Crews
                        2022-02-26 19:16:44.442Z

                        Oh man, this gets at least 3/4 of a point! Thanks so much!

                        Reply1 LikeSolution