;; generic osc set
(bind-func set_osc
(lambda (inst:i8* osc_num:i64 gain:float wave:i32 tune:float pw:float phase:float)
(let ((note (cref (cast inst [void]*) note_kernel [void]*)))
(cond ((= osc_num 1)
(cset! note osc1_amp gain float)
(cset! note osc1_wave wave i32)
(cset! note tune1 tune float)
(cset! note pw1 pw float)
(cset! note osc1_phase phase float)
void)
((= osc_num 2)
(cset! note osc2_amp gain float)
(cset! note osc2_wave wave i32)
(cset! note tune2 tune float)
(cset! note pw2 pw float)
(cset! note osc2_phase phase float)
void)
((= osc_num 3)
(cset! note osc3_amp gain float)
(cset! note osc3_wave wave i32)
(cset! note tune3 tune float)
(cset! note pw3 pw float)
(cset! note osc3_phase phase float)
void)
((= osc_num 4)
(cset! note osc4_amp gain float)
(cset! note osc4_wave wave i32)
(cset! note tune4 tune float)
(cset! note pw4 pw float)
(cset! note osc4_phase phase float)
void)
(else (println "bad osc num 1-4") void)))))