2010-01-13 10:35:51 +00:00
|
|
|
|
|
|
|
#define NUM_POLYPHONY 32
|
|
|
|
|
|
|
|
struct engine_t
|
|
|
|
{
|
2010-01-20 07:49:38 +00:00
|
|
|
struct control_t lowpass;
|
|
|
|
|
|
|
|
struct control_t modwheel;
|
|
|
|
struct control_t pitchbend;
|
|
|
|
struct control_t aftertouch;
|
|
|
|
|
|
|
|
int monosynth;
|
|
|
|
|
2010-01-21 08:36:18 +00:00
|
|
|
struct osc_t lfo[NUM_LFO];
|
|
|
|
struct voice_param_t params[VOICE_OSCILLATORS];
|
|
|
|
struct envelope_t cutoff_env;
|
|
|
|
|
2010-01-13 10:35:51 +00:00
|
|
|
struct voice_t voice[NUM_POLYPHONY];
|
|
|
|
|
2010-06-14 14:08:49 +00:00
|
|
|
double freqs[128];
|
|
|
|
};
|
2010-01-20 07:49:38 +00:00
|
|
|
|
2010-06-14 14:08:49 +00:00
|
|
|
void engine_init(struct engine_t *engine);
|
|
|
|
void engine_load_program(struct engine_t *engine);
|
2010-01-13 10:35:51 +00:00
|
|
|
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);
|
2010-01-20 07:49:38 +00:00
|
|
|
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);
|