Bug 2808 Nyquist GATE function limits floor level to -60 dB

This commit is contained in:
SteveDaulton 2021-06-16 15:11:12 +01:00 committed by Paul Licameli
parent 6b82f43000
commit d8010a7bc6
2 changed files with 3 additions and 21 deletions

View File

@ -1501,10 +1501,10 @@ loop
(format t "WARNING: ~A ~A function; setting falltime to 0.01.\n"
"falltime must be greater than zero in" source)
(setf falltime 0.01)))
(cond ((< floor 0.001)
(format t "WARNING: ~A ~A function; setting floor to 0.001.\n"
(cond ((< floor 0.00001)
(format t "WARNING: ~A ~A function; setting floor to 0.00001.\n"
"floor must be greater than zero in" source)
(setf floor 0.001)))
(setf floor 0.00001)))
(let (s) ;; s becomes sound after collapsing to one channel
(cond ((arrayp sound) ;; use s-max over all channels so that
(setf s (aref sound 0)) ;; ANY channel opens the gate

View File

@ -134,24 +134,6 @@ Suggested Threshold Setting ~a dB.")
;;; Gate Functions
;; Override Nyquist GATE function (from nyquist.lsp)
;; The default version has minimum floor of -60dB, which is not low enough here.
(defun gate (sound lookahead risetime falltime floor threshold
&optional (source "GATE"))
(let (s) ;; s becomes sound after collapsing to one channel
(cond ((arrayp sound) ;; use s-max over all channels so that
(setf s (aref sound 0)) ;; ANY channel opens the gate
(dotimes (i (1- (length sound)))
(setf s (s-max s (aref sound (1+ i))))))
(t (setf s sound)))
(setf s (snd-gate (seq (cue s)
(stretch-abs 1.0 (s-rest lookahead)))
lookahead risetime falltime floor threshold))
(prog1 (snd-xform s (snd-srate s) (snd-t0 s)
(+ (snd-t0 s) lookahead) MAX-STOP-TIME 1.0)
(setf s nil) (setf sound nil))))
(defun noisegate (sig follow)
;; Takes a sound and a 'follow' sound as arguments.
;; Returns the gated audio.