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
1 changed files with 11 additions and 3 deletions

View File

@ -192,10 +192,18 @@
(,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)
`(let ((nyq%environment (nyq:the-environment)))
(snd-trigger ,input #'(lambda (t0) (with%environment nyq%environment
(at-abs t0 ,beh))))))
`(let* ((nyq%environment (nyq:the-environment))
(gate%signal (force-srate *sound-srate* ,input))
(s%rate (snd-srate gate%signal)))
(snd-trigger gate%signal
#'(lambda (t0) (eval-seq-behavior ,beh "TRIGGER")))))
;; EVENT-EXPRESSION -- the sound of the event
;;