(bind-func static AudioBuffer_ptr
"returns a pointer into the buffer"
(lambda (ab:AudioBuffer* frame chan)
(if (< frame 0) (set! frame (llabs frame)))
(if (< frame (AudioBuffer_frames ab))
(pref-ptr (AudioBuffer_data ab)
(+ (* frame (AudioBuffer_channels ab)) chan))
(pref-ptr (AudioBuffer_data ab)
(+ (* (% frame (AudioBuffer_frames ab)) (AudioBuffer_channels ab)) chan)))))