(bind-func cerberus_filter_cc
(lambda ()
(let ((val 0.0:f))
(lambda (inst offset:i32 cc:i32 value:i32)
;;(println 'cerberus_filter_cc cc value)
(set! val (/ (i32tof value) 127.0))
(cond ((= cc (+ offset 0)) ;; lpf frq
(set_filter_frq inst (cerberus_frq_from_val val)))
((= cc (+ offset 1)) ;; lpf res
(set_filter_res inst (cerberus_logRamp val)))
((= cc (+ offset 2)) ;; hpf frq
(set_hpf_frq inst (cerberus_frq_from_val val)))
((= cc (+ offset 3)) ;; filter drive/saturation
(set_filter_drive inst (+ 1.0 (* 3.0 val)))))))))