(bind-func midi_note_on
(lambda (pitch:i32 vol:i32 chan:i32)
(if (< (dsp.inst1.adsr.out:float) 0.05)
(begin
(dsp.inst1.freq:float (midi2frq (i32tof pitch)))
(dsp.inst1.amp:float (/ (i32tof vol) 127.0))))
(dsp.inst1.newfreq:float (midi2frq (i32tof pitch)))
(dsp.inst1.newamp:float (/ (i32tof vol) 127.0))
(dsp.inst1.pitch:i32 pitch)
(dsp.inst1.gate:float 1.0)
void))