From d8010a7bc6ec7420cecab800d6193e28a3b678d2 Mon Sep 17 00:00:00 2001 From: SteveDaulton Date: Wed, 16 Jun 2021 15:11:12 +0100 Subject: [PATCH] Bug 2808 Nyquist GATE function limits floor level to -60 dB --- nyquist/nyquist.lsp | 6 +++--- plug-ins/noisegate.ny | 18 ------------------ 2 files changed, 3 insertions(+), 21 deletions(-) diff --git a/nyquist/nyquist.lsp b/nyquist/nyquist.lsp index 12ec235c2..647dca21c 100644 --- a/nyquist/nyquist.lsp +++ b/nyquist/nyquist.lsp @@ -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 diff --git a/plug-ins/noisegate.ny b/plug-ins/noisegate.ny index 2bdf59b2b..8bf0bb75e 100644 --- a/plug-ins/noisegate.ny +++ b/plug-ins/noisegate.ny @@ -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.