;; only effects monophonic (i.e. 1 note polyphony)
;; if legato is #t then don't retrigger adsr's
(bind-func static set_legato
(lambda (inst:i8* val:i32)
(let ((note (cref (cast inst [void]*) note_kernel [void]*)))
(cset! note legato (if (= val 0) #f #t) i1)
void)))