;; flanger
;; delay in milliseconds
;; range in milliseconds
;; rate in hertz
(bind-func static flanger_c
(lambda ()
(let ((ms (* .001 SRf))
(halfsrf (* 0.5 SRf))
(comb (comb_c (convert SRf)))
(mod (osc_c 0.0)))
(lambda (x:SAMPLE in out delay range rate feedback)
(comb x
(+ (* ms delay)
(clamp (* ms range (+ 0.5 (mod 0.5 rate)))
0.0 halfsrf))
in out feedback)))))