#define NUM_LFO 4 #define NUM_POLYPHONY 32 struct engine_t { struct control_t lowpass; struct control_t modwheel; struct control_t pitchbend; struct control_t aftertouch; struct control_t osc_shape[4]; struct control_t osc_level[4]; int monosynth; struct osc_t osc[NUM_LFO]; struct voice_t voice[NUM_POLYPHONY]; }; extern struct engine_t _engine; void engine_init(); void engine_run(struct engine_t *engine, uint32_t samples, float *left, float *right); void engine_startvoice(struct engine_t *engine, uint8_t note, uint8_t velocity); void engine_endvoice(struct engine_t *engine, uint8_t note, uint8_t velocity); void engine_controlchange(struct engine_t *engine, uint8_t controller, uint8_t value); void engine_programchange(struct engine_t *engine, uint8_t value); void engine_aftertouch(struct engine_t *engine, uint8_t value); void engine_pitchchange(struct engine_t *engine, int16_t value);