(bind-func cerberus_main_cc
(lambda ()
(let ((val 0.0:f))
(lambda (inst offset:i32 cc:i32 value:i32)
(set! val (/ (i32tof value) 127.0))
(cond ((= cc (+ offset 0)) ;; pan pos
(set_pan_pos inst val))
;; ((= cc (+ offset 1)) ;; pan width
;; (set_pan_width inst val))
((= cc (+ offset 1)) ;; gain
(set_gain inst (* val 4.0)))
((= cc (+ offset 2)) ;; portamento (ms)
(set_portamento inst (* val 100.0)))
((= cc (+ offset 3)) ;;
(if (= value 127)
(cerberus_reset inst))
void))))))