;; but it's clunky having to do all this modulo and pi-related stuff
;; with the time, especially when we have closures to manage
;; function-local state. So we abstract out an oscillator function
(bind-func osc_c
(lambda (phase)
(lambda (amp freq)
(let ((inc (* STWOPI (/ freq SRf))))
(set! phase (+ phase inc))
(if (> phase SPI) (set! phase (- phase STWOPI)))
(* amp (sin phase))))))