psyn/engine.h

32 lines
940 B
C

#define NUM_POLYPHONY 32
struct engine_t
{
struct control_t lowpass;
struct control_t modwheel;
struct control_t pitchbend;
struct control_t aftertouch;
int monosynth;
struct osc_t lfo[NUM_LFO];
struct voice_param_t params[VOICE_OSCILLATORS];
struct envelope_t cutoff_env;
struct voice_t voice[NUM_POLYPHONY];
};
extern struct engine_t _engine;
void engine_init();
void engine_load_program();
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);