;make a buffer mono in place
(bind-func make_mono
(lambda (buffer:float* buffer_size:i64)
(let ((n:i64 0))
(dotimes (n (/ buffer_size 2))
(pset! buffer (* n 2) (/ (+ (pref buffer (* n 2)) (pref buffer (+ (* n 2) 1))) 2.0))
(pset! buffer (+ (* n 2) 1) (pref buffer (* n 2))))
void)))