Adjusting gain on multiple tracks

I’m talking about adjusting the gain levels across all tracks, in one operation. I know of other ways to change the volume, but can I adjust gain levels (specifically, the gain sliders) on multiple tracks, simultaneously?

There’s no built-in way to adjust the gain of multiple tracks at the same time, but you could write a Nyquist Macro to do so.

Here’s some code that could be the basis of such a plug-in. This code may be run as it is in the Nyquist Prompt with Audacity 2.4.0:

;type tool
;control mode "Set track gain as" choice "Absolute value,Increase/Decrease" 0
;control gain "Track Gain (dB)" float "" 0 -36 36

(let ((trackinfo  (aud-get-info "tracks"))
      (id 0))
  (dolist (info trackinfo)
    (let ((isselected (assoc 'SELECTED info))
          (trkgain (assoc 'GAIN info)))
      (when (and isselected (= (second isselected) 1))
        (case mode
          (0  (aud-do-command "SelectTracks" :mode "Set" :track id :trackcount 1)
              (aud-do-command "SetTrackAudio" :gain gain))
          (t  (setf trkgain (+ (linear-to-db (second trkgain)) gain))
              (setf trkgain (max (min trkgain 36) -36))
              (aud-do-command "SelectTracks" :mode "Set" :track id :trackcount 1)
              (aud-do-command "SetTrackAudio" :gain trkgain))))
      (incf id))))

For slightly earlier versions of Audacity, the “aud-do-command” lines will need replacing with “aud-do” commands.

Note that Nyquist Macros are quite a new feature, so this won’t work at all on old versions.

Thanks Steve, So, I’ll wait until 2.4.0 is out. Will this code work for Linux also?