#include "const.h" #include "state.h" #include "vco.h" float phase = 0.0f; float vco(void) { float phase_inc = (state.vco_freq * 1760) / SAMPLE_RATE; phase += phase_inc; if (phase >= 1.0f) phase -= 1.0f; return (phase * 2.0f) - 1.0f; }