(bind-func xtm_play
(lambda (offset:double bsched:[void]* inst:[SAMPLE,SAMPLE,i64,i64,SAMPLE*]*
pitch:double vol:double dur:double
num:i64 mem:SAMPLE*)
(let ((bpm (bsched.bpm)))
(xtm_play_note (+ (now) (dtoi64 (* offset (/ 60.0 bpm) SRd)))
inst
(midi2frq (convert pitch))
(convert (/ (exp (/ vol 26.222)) 127.0))
(dtoi64 (* dur (/ 60.0 bpm) SRd))
num mem))))