2010-01-13 10:35:51 +00:00
|
|
|
#define VOICE_OSCILLATORS 4
|
2010-01-13 17:05:00 +00:00
|
|
|
#define VOICE_FILTERS 2
|
2010-01-21 08:36:18 +00:00
|
|
|
#define NUM_LFO 4
|
|
|
|
|
|
|
|
enum {
|
|
|
|
PAN_FIXED,
|
|
|
|
PAN_OSC,
|
|
|
|
PAN_LFO,
|
|
|
|
};
|
|
|
|
|
|
|
|
struct voice_param_t
|
|
|
|
{
|
|
|
|
uint8_t pan_type;
|
2010-01-21 17:40:30 +00:00
|
|
|
uint8_t pan_source;
|
|
|
|
double pan_level;
|
|
|
|
double pan_level_r;
|
2010-01-21 08:36:18 +00:00
|
|
|
|
|
|
|
struct control_t shape;
|
|
|
|
struct control_t level;
|
|
|
|
struct control_t freq_mult;
|
|
|
|
struct control_t phase;
|
|
|
|
|
|
|
|
struct envelope_t env;
|
|
|
|
};
|
2010-01-13 10:35:51 +00:00
|
|
|
|
|
|
|
struct voice_t
|
|
|
|
{
|
|
|
|
bool playing;
|
|
|
|
uint8_t note;
|
|
|
|
uint32_t sample;
|
|
|
|
uint32_t released;
|
|
|
|
|
|
|
|
double velocity;
|
2010-01-21 08:36:18 +00:00
|
|
|
|
2010-01-13 10:35:51 +00:00
|
|
|
struct osc_t osc[VOICE_OSCILLATORS];
|
|
|
|
|
2010-01-20 07:49:38 +00:00
|
|
|
//struct filter_t fil[VOICE_FILTERS];
|
|
|
|
struct bw_filter_t bw[VOICE_FILTERS];
|
2010-01-13 10:35:51 +00:00
|
|
|
};
|
|
|
|
|
2010-06-14 14:08:49 +00:00
|
|
|
struct engine_t;
|
|
|
|
|
|
|
|
void voice_init(struct voice_t *voice, const struct engine_t *engine, double freq);
|
|
|
|
void voice_run(struct voice_t *voice, const struct engine_t *engine, uint32_t samples, float *left, float *right);
|