You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
58 lines
984 B
58 lines
984 B
#ifndef __PRESET_H__
|
|
#define __PRESET_H__
|
|
|
|
#include "dsp/oscillator.h"
|
|
#include "dsp/filter.h"
|
|
#include "dsp/adsr.h"
|
|
|
|
struct Preset {
|
|
typedef struct {
|
|
uint8_t attack;
|
|
uint8_t decay;
|
|
uint8_t sustain;
|
|
uint8_t release;
|
|
} Envelope;
|
|
|
|
uint8_t osc1Mode;
|
|
uint8_t osc2Mode;
|
|
uint8_t oscMix;
|
|
|
|
struct {
|
|
uint8_t type;
|
|
uint8_t slope;
|
|
uint8_t freq;
|
|
uint8_t Q;
|
|
} filter;
|
|
|
|
Envelope ampEnv;
|
|
Envelope fltEnv;
|
|
};
|
|
|
|
static const Preset DEFAULT_PRESET = {
|
|
.osc1Mode = Oscillator::MODE_SAW,
|
|
.osc2Mode = Oscillator::MODE_SAW,
|
|
.oscMix = 0,
|
|
|
|
.filter = {
|
|
.type = Filter::TYPE_LP,
|
|
.slope = Filter::SLOPE_24,
|
|
.freq = 127,
|
|
.Q = 0,
|
|
},
|
|
|
|
.ampEnv = {
|
|
.attack = 0,
|
|
.decay = 0,
|
|
.sustain = 127,
|
|
.release = 0
|
|
},
|
|
|
|
.fltEnv = {
|
|
.attack = 0,
|
|
.decay = 0,
|
|
.sustain = 127,
|
|
.release = 0
|
|
}
|
|
};
|
|
|
|
#endif |