;; linear fade closure
(bind-func static fade_c
(lambda ()
(let ((t 0.0)
(incr (/ 1.0 (convert SAMPLE_RATE SAMPLE))))
(lambda (initial:SAMPLE final dur)
(set! t (+ t incr))
(if (> t dur)
final
(+ initial (* (/ t dur) (- final initial))))))))