1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-04-30 15:49:41 +02:00

Fix Bug 2698 - Noise Gate fails silently if hold is non-zero

Nyquist fix from RDB
This commit is contained in:
SteveDaulton 2021-03-21 17:46:30 +00:00
parent 2e162adeff
commit d72a10ddc1

View File

@ -192,10 +192,18 @@
(,seq-prim ,snd-expr seqrep%closure)))) (,seq-prim ,snd-expr seqrep%closure))))
;; TRIGGER - sums instances of beh which are launched when input becomes
;; positive (> 0). New in 2021: input is resampled to *sound-srate*.
;; As before, beh sample rates must match, so now they must also be
;; *sound-srate*. This implementation uses eval-seq-behavior to create
;; a more helpful stack trace for SAL.
(defmacro trigger (input beh) (defmacro trigger (input beh)
`(let ((nyq%environment (nyq:the-environment))) `(let* ((nyq%environment (nyq:the-environment))
(snd-trigger ,input #'(lambda (t0) (with%environment nyq%environment (gate%signal (force-srate *sound-srate* ,input))
(at-abs t0 ,beh)))))) (s%rate (snd-srate gate%signal)))
(snd-trigger gate%signal
#'(lambda (t0) (eval-seq-behavior ,beh "TRIGGER")))))
;; EVENT-EXPRESSION -- the sound of the event ;; EVENT-EXPRESSION -- the sound of the event
;; ;;