#define VOICE_OSCILLATORS 4 #define VOICE_FILTERS 2 struct voice_t { bool playing; uint8_t note; uint32_t sample; uint32_t released; double velocity; struct osc_t osc[VOICE_OSCILLATORS]; struct filter_t fil[VOICE_FILTERS]; }; void voice_init(struct voice_t *voice, double freq); void voice_run(struct voice_t *voice, uint32_t samples, float *left, float *right);