;nyquist plug-in
;version 4
;type analyze
;name "ACX Check"
;maxlen 2143260000
;debugflags trace
;author "Steve Daulton"
;release 2.4.2-1
;copyright "Released under terms of the GNU General Public License version 2"
(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*)))
samples)
(setf *track* (s-rms *track* 10 window-size))
;; Calculate new length in samples without retaining samples in RAM.
(setf samples (truncate (* len (/ (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)))))