(bind-func oscv_c
(lambda (phase)
(let ((i 0)
(y:/4,float/* (alloc))
(vphase:/4,float/* (alloc))
(srv (v4val SAMPLE_RATE))
(twopiv (v4val TWOPIf))
(inc:/4,float/* (alloc)))
(vset! vphase 0 phase)
(lambda (amp:/4,float/* freq:/4,float/*)
(pset! inc 0 (* twopiv (/ freq srv)))
(dotimes (i 4)
(vset! vphase i phase)
(set! phase (+ phase (vref inc i)))
(if (> phase PIf) (set! phase (- phase TWOPIf))))
(pset! y 0 (* amp (_sin vphase)))
y))))