;; given current channel
;; and pan value [0.0-1.0]
;; returns value betwee n [0.0-1.0]
;; uses CHANNELS
(bind-func static panner
(lambda (chan:i64 pan)
(let ((cn1:SAMPLE (convert (- CHANNELS 1))))
(- 1.0 (/ (fabs (- (* pan cn1) (convert chan))) cn1)))))