Combined mux.c and buttons.c to input.c
This commit is contained in:
@@ -101,7 +101,7 @@ void synth_init(void) {
|
||||
osc.Init(SAMPLE_RATE);
|
||||
osc.SetWaveform(vco_mode_to_daisy(VCO_SAW));
|
||||
osc.SetFreq(440.0f);
|
||||
osc.SetAmp(2.0f);
|
||||
osc.SetAmp(1.0f);
|
||||
|
||||
filter.Init(SAMPLE_RATE);
|
||||
filter.SetFreq(2000.0f);
|
||||
@@ -117,9 +117,9 @@ void synth_init(void) {
|
||||
filter_env.SetTime(ADENV_SEG_ATTACK, 0.01f);
|
||||
filter_env.SetTime(ADENV_SEG_DECAY, 0.5f);
|
||||
filter_env.SetMin(0.0f);
|
||||
filter_env.SetMax(1.0f);
|
||||
filter_env.SetMax(2000.0f);
|
||||
|
||||
state.clock_bpm = 0.2f;
|
||||
state.clock_bpm = 0.1f;
|
||||
|
||||
clock_phase = 0.0f;
|
||||
clock_trig = false;
|
||||
@@ -147,10 +147,10 @@ float get_sample(void) {
|
||||
filter_env.Trigger();
|
||||
}
|
||||
|
||||
vco_env.SetTime(ADENV_SEG_ATTACK, pot_to_time(state.env1_attack, ENV_ATTACK_MIN, ENV_ATTACK_MAX));
|
||||
vco_env.SetTime(ADENV_SEG_DECAY, pot_to_time(state.env1_release, ENV_RELEASE_MIN, ENV_RELEASE_MAX));
|
||||
filter_env.SetTime(ADENV_SEG_ATTACK, pot_to_time(state.env2_attack, ENV_ATTACK_MIN, ENV_ATTACK_MAX));
|
||||
filter_env.SetTime(ADENV_SEG_DECAY, pot_to_time(state.env2_release, ENV_RELEASE_MIN, ENV_RELEASE_MAX));
|
||||
//vco_env.SetTime(ADENV_SEG_ATTACK, pot_to_time(state.env1_attack, ENV_ATTACK_MIN, ENV_ATTACK_MAX));
|
||||
//vco_env.SetTime(ADENV_SEG_DECAY, pot_to_time(state.env1_release, ENV_RELEASE_MIN, ENV_RELEASE_MAX));
|
||||
//filter_env.SetTime(ADENV_SEG_ATTACK, pot_to_time(state.env2_attack, ENV_ATTACK_MIN, ENV_ATTACK_MAX));
|
||||
//filter_env.SetTime(ADENV_SEG_DECAY, pot_to_time(state.env2_release, ENV_RELEASE_MIN, ENV_RELEASE_MAX));
|
||||
|
||||
float vco_env_out = vco_env.Process();
|
||||
float filter_env_out = filter_env.Process();
|
||||
@@ -158,9 +158,10 @@ float get_sample(void) {
|
||||
float vco_freq = pot_to_freq(state.vco_freq, VCO_FREQ_MIN, VCO_FREQ_MAX);
|
||||
if (state.quant_enabled) vco_freq = quantize(vco_freq, 12.0f);
|
||||
|
||||
osc.SetFreq(vco_freq);
|
||||
osc.SetWaveform(vco_mode_to_daisy(state.vco_mode));
|
||||
osc.SetAmp(1.0f);
|
||||
//osc.SetFreq(vco_freq);
|
||||
static int n = VCO_SINE;
|
||||
osc.SetWaveform(vco_mode_to_daisy((vco_mode_t)(n++ % 4)));
|
||||
//osc.SetAmp(1.0f);
|
||||
|
||||
float vco_out = osc.Process();
|
||||
|
||||
@@ -168,12 +169,12 @@ float get_sample(void) {
|
||||
float mod_cutoff = base_cutoff + filter_env_out * (FILTER_FREQ_MAX - FILTER_FREQ_MIN);
|
||||
mod_cutoff = fclamp(mod_cutoff, FILTER_FREQ_MIN, FILTER_FREQ_MAX);
|
||||
|
||||
filter.SetFreq(mod_cutoff);
|
||||
filter.SetRes(state.filter_resonance);
|
||||
//filter.SetFreq(mod_cutoff);
|
||||
//filter.SetRes(state.filter_resonance);
|
||||
filter.Process(vco_out);
|
||||
float filtered = filter.Low();
|
||||
|
||||
float vca_out = filtered * vco_env_out * state.vco_volume;
|
||||
float vca_out = filtered * vco_env_out;// * state.vco_volume;
|
||||
|
||||
float reverb_out = vca_out; //reverb(vca_out, state.reverb_amount);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user