;; override midi_cc for analogue chans 1, 2 and 3
(bind-func midi_cc
(lambda (timestamp:i32 controller:i32 value:i32 chan:i32)
(aset! MCC_ARR controller (/ (i32tof value) 127.0))
(if (< chan 3)
(printf "\rMIDI_CC: %d %f %d (%s) %s" controller (ftod (aref MCC_ARR controller)) chan (get_analogue_synth_cc_name controller)
" \r") ;; ugly but can't get vt100 codes working on windows :(
(printf "MIDI_CC: %d %f %d \r" controller (ftod (aref MCC_ARR controller)) chan))
(if (= chan 0) (analogue_cc (cast syn1) 0 controller value))
(if (= chan 1) (analogue_cc (cast syn2) 1 controller value))
(if (= chan 2) (analogue_cc (cast syn3) 2 controller value))
void))