ACX Check Plug-in Modification

I made a slight modification to ACX Check. If I have multiple audio tracks and I do Select All, then run ACX Check, the selection exceeds the track length on all but the longest track, so it reports an incorrect noise floor on all but the longest files as follows “Noise floor: -inf dB…” Clearly, where the selection exceeds the track length it’s finding a string of absolute zero values. I modified a couple of lines in (defun getfloor…) to scale the len parameter down to the track length. It now works nicely for multiple files. Here’s the code:

;;;Modified by JLDoty. Search on trackMaxLen to see changes
(defun getfloor ()
  ;; Calculate RMS where rate=10 Hz, window-size=0.4 seconds.
  ;; Return the lowest 0.4 to 0.5 s in the selection.
  (let ((floor 999)
        (window-size (round (* 0.4 *sound-srate*)))
	(setq trackMaxLen len)
	(if (> (get '*selection* 'end) (get '*track* 'end-time))
		(setq trackMaxLen (* len (/ (get '*track* 'end-time) (get '*selection* 'end))))
    (setf *track* (s-rms *track* 10 window-size))
    ;; Calculate new length in samples without retaining samples in RAM.
    (setf samples (truncate (* trackMaxLen (/ (snd-srate *track*) *sound-srate*))))
    (do ((val (snd-fetch *track*) (snd-fetch *track*))
         (count samples (1- count)))
        ((< count 4) floor) ;stop at last full window.
      (setf floor (min floor val)))

Do you have the right ACX-Check? There were two. The latest one is by Steve based on the earlier work by Will.

And yes, the earlier one did have trouble with longer tracks.

I can’t visualize what it’s doing. Do you get individual responses, one for each track?


The current version of ACX Check is available on the Audacity wiki:

Yes, I am working with the latest: release 2.4.2-1. The problem arises because for each track with a selection, Audacity feeds it the same “len” parameter. So when you do “Select All” that value is always the length of the longest track. But when it’s processing a shorter track, using “len” in the getfloor function means its looking for data beyond the end of the shorter track, so it gets all zeros (-inf dB). So you see a legitimate floor on the longest track, but all the rest of them report (-inf dB). All I did was scale the “len” parameter down by the length of the track:

(setq trackMaxLen len)
(if (> (get 'selection 'end) (get 'track 'end-time))
(setq trackMaxLen (* len (/ (get 'track 'end-time) (get 'selection 'end))))

and then use that in the getfloor function and in one other place.