|
|
|
@ -294,8 +294,6 @@ void setup() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
initial_values_from_eeprom(false); |
|
|
|
|
|
|
|
|
|
#if defined(TEENSY_AUDIO_BOARD) |
|
|
|
|
sgtl5000_1.enable(); |
|
|
|
|
sgtl5000_1.lineOutLevel(SGTL5000_LINEOUT_LEVEL); |
|
|
|
@ -356,6 +354,29 @@ void setup() |
|
|
|
|
#ifdef DEBUG |
|
|
|
|
Serial.println(F("Internal DAC enabled.")); |
|
|
|
|
#endif |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
initial_values_from_eeprom(false); |
|
|
|
|
|
|
|
|
|
#if defined(USE_FX) |
|
|
|
|
// Init effects
|
|
|
|
|
for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) |
|
|
|
|
{ |
|
|
|
|
memset(delayline, 0, sizeof(delayline[instance_id])); |
|
|
|
|
if (!modchorus[instance_id]->begin(delayline[instance_id], MOD_DELAY_SAMPLE_BUFFER)) { |
|
|
|
|
#ifdef DEBUG |
|
|
|
|
Serial.print(F("AudioEffectModulatedDelay - begin failed [")); |
|
|
|
|
Serial.print(instance_id); |
|
|
|
|
Serial.println(F("]")); |
|
|
|
|
#endif |
|
|
|
|
while (1); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
#ifdef DEBUG |
|
|
|
|
Serial.print(F("MOD_DELAY_SAMPLE_BUFFER=")); |
|
|
|
|
Serial.print(MOD_DELAY_SAMPLE_BUFFER, DEC); |
|
|
|
|
Serial.println(F(" samples")); |
|
|
|
|
#endif |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
// start SD card
|
|
|
|
@ -388,29 +409,7 @@ void setup() |
|
|
|
|
change_disp_sd(true); |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
#if defined(USE_FX) |
|
|
|
|
// Init effects
|
|
|
|
|
for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) |
|
|
|
|
{ |
|
|
|
|
memset(delayline, 0, sizeof(delayline[instance_id])); |
|
|
|
|
if (!modchorus[instance_id]->begin(delayline[instance_id], MOD_DELAY_SAMPLE_BUFFER)) { |
|
|
|
|
#ifdef DEBUG |
|
|
|
|
Serial.print(F("AudioEffectModulatedDelay - begin failed [")); |
|
|
|
|
Serial.print(instance_id); |
|
|
|
|
Serial.println(F("]")); |
|
|
|
|
#endif |
|
|
|
|
while (1); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
#ifdef DEBUG |
|
|
|
|
Serial.print(F("MOD_DELAY_SAMPLE_BUFFER=")); |
|
|
|
|
Serial.print(MOD_DELAY_SAMPLE_BUFFER, DEC); |
|
|
|
|
Serial.println(F(" samples")); |
|
|
|
|
#endif |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
set_fx_params(); |
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) |
|
|
|
|
{ |
|
|
|
|
// INIT PEAK MIXER
|
|
|
|
@ -429,6 +428,7 @@ void setup() |
|
|
|
|
master_mixer_l.gain(3, pseudo_log_curve(configuration.fx.reverb_level / 100)); |
|
|
|
|
|
|
|
|
|
set_sys_params(); |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
// Initialize processor and memory measurements
|
|
|
|
|
AudioProcessorUsageMaxReset(); |
|
|
|
@ -805,7 +805,7 @@ void handleControlChange(byte inChannel, byte inCtrl, byte inValue) |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
case 107: // CC 107: delay volume
|
|
|
|
|
configuration.fx.delay_level[instance_id] = map(inValue, 0, 0x7f, DELAY_SEND_MIN, DELAY_SEND_MAX); |
|
|
|
|
configuration.fx.delay_level[instance_id] = map(inValue, 0, 0x7f, DELAY_LEVEL_MIN, DELAY_LEVEL_MAX); |
|
|
|
|
delay_mixer[instance_id]->gain(1, pseudo_log_curve(mapfloat(configuration.fx.delay_level[instance_id], DELAY_LEVEL_MIN, DELAY_LEVEL_MAX, 0.0, 1.0))); |
|
|
|
|
if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_delay_level)) |
|
|
|
|
{ |
|
|
|
@ -1436,6 +1436,9 @@ void initial_values_from_eeprom(bool init) |
|
|
|
|
|
|
|
|
|
for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) |
|
|
|
|
{ |
|
|
|
|
set_voiceconfig_params(instance_id); |
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
MicroDexed[instance_id]->setPBController(configuration.dexed[instance_id].pb_range, configuration.dexed[instance_id].pb_step); |
|
|
|
|
MicroDexed[instance_id]->setMWController(configuration.dexed[instance_id].mw_range, configuration.dexed[instance_id].mw_assign, configuration.dexed[instance_id].mw_mode); |
|
|
|
|
MicroDexed[instance_id]->setFCController(configuration.dexed[instance_id].fc_range, configuration.dexed[instance_id].fc_assign, configuration.dexed[instance_id].fc_mode); |
|
|
|
@ -1446,33 +1449,27 @@ void initial_values_from_eeprom(bool init) |
|
|
|
|
MicroDexed[instance_id]->doRefreshVoice(); |
|
|
|
|
MicroDexed[instance_id]->setMaxNotes(configuration.dexed[instance_id].polyphony); |
|
|
|
|
MicroDexed[instance_id]->setMonoMode(configuration.sys.mono); |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
#if defined(USE_FX) |
|
|
|
|
//chorus_mixer[instance_id]->gain(0, 1.0 - pseudo_log_curve(mapfloat(configuration.fx.chorus_level[instance_id], CHORUS_LEVEL_MIN, CHORUS_LEVEL_MAX, 0.0, 1.0)));
|
|
|
|
|
//chorus_mixer[instance_id]->gain(1, pseudo_log_curve(mapfloat(configuration.fx.chorus_level[instance_id], CHORUS_LEVEL_MIN, CHORUS_LEVEL_MAX, 0.0, 1.0)));
|
|
|
|
|
//chorus_mixer[instance_id]->gain(0, 1.0 - mapfloat(configuration.fx.chorus_level[instance_id], CHORUS_LEVEL_MIN, CHORUS_LEVEL_MAX, 0.0, 0.5));
|
|
|
|
|
/*
|
|
|
|
|
chorus_mixer[instance_id]->gain(1, 1.0 - mapfloat(configuration.fx.chorus_level[instance_id], CHORUS_LEVEL_MIN, CHORUS_LEVEL_MAX, 0.0, 0.5)); |
|
|
|
|
chorus_mixer[instance_id]->gain(1, mapfloat(configuration.fx.chorus_level[instance_id], CHORUS_LEVEL_MIN, CHORUS_LEVEL_MAX, 0.0, 0.5)); |
|
|
|
|
delay_mixer[instance_id]->gain(0, 1.0); |
|
|
|
|
delay_mixer[instance_id]->gain(1, pseudo_log_curve(mapfloat(configuration.fx.delay_level[instance_id], DELAY_LEVEL_MIN, DELAY_LEVEL_MAX, 0.0, 1.0))); |
|
|
|
|
delay_fb_mixer[instance_id]->gain(0, 1.0); |
|
|
|
|
delay_fb_mixer[instance_id]->gain(1, pseudo_log_curve(mapfloat(configuration.fx.delay_feedback[instance_id], DELAY_FEEDBACK_MIN, DELAY_FEEDBACK_MAX, 0.0, 1.0))); |
|
|
|
|
reverb_mixer_r.gain(instance_id, pseudo_log_curve(configuration.fx.reverb_send[instance_id] / 100.0)); |
|
|
|
|
reverb_mixer_l.gain(instance_id, pseudo_log_curve(configuration.fx.reverb_send[instance_id] / 100.0)); |
|
|
|
|
|
|
|
|
|
// MicroDexed[instance_id]->fx.Gain = configuration.dexed[instance_id].sound_intensity / 100.0;
|
|
|
|
|
MicroDexed[instance_id]->fx.Gain = 1.0; |
|
|
|
|
MicroDexed[instance_id]->fx.Reso = mapfloat(configuration.dexed[instance_id].filter_resonance, FILTER_RESONANCE_MIN, FILTER_RESONANCE_MAX, 1.0, 0.0); |
|
|
|
|
MicroDexed[instance_id]->fx.Cutoff = mapfloat(configuration.dexed[instance_id].filter_cutoff, FILTER_CUTOFF_MIN, FILTER_CUTOFF_MAX, 1.0, 0.0); |
|
|
|
|
|
|
|
|
|
reverb_mixer_r.gain(instance_id, pseudo_log_curve(configuration.fx.reverb_send[instance_id] / 100.0)); |
|
|
|
|
reverb_mixer_l.gain(instance_id, pseudo_log_curve(configuration.fx.reverb_send[instance_id] / 100.0)); |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
dexed_level[instance_id]->gain(pseudo_log_curve(mapfloat(configuration.dexed[instance_id].sound_intensity, SOUND_INTENSITY_MIN, SOUND_INTENSITY_MAX, 0.0, SOUND_INTENSITY_AMP_MAX))); |
|
|
|
|
|
|
|
|
|
set_voiceconfig_params(instance_id); |
|
|
|
|
*/ |
|
|
|
|
//dexed_level[instance_id]->gain(pseudo_log_curve(mapfloat(configuration.dexed[instance_id].sound_intensity, SOUND_INTENSITY_MIN, SOUND_INTENSITY_MAX, 0.0, SOUND_INTENSITY_AMP_MAX)));
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
set_sys_params(); |
|
|
|
|
set_fx_params(); |
|
|
|
|
set_sys_params(); |
|
|
|
|
|
|
|
|
|
set_volume(configuration.sys.vol, configuration.sys.mono); |
|
|
|
|
|
|
|
|
@ -1749,7 +1746,7 @@ bool eeprom_get_performance() |
|
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
|
PARAMETER-HELPERS |
|
|
|
|
******************************************************************************/ |
|
|
|
|
******************************************************************************/ |
|
|
|
|
|
|
|
|
|
void set_fx_params(void) |
|
|
|
|
{ |
|
|
|
@ -1788,13 +1785,20 @@ void set_fx_params(void) |
|
|
|
|
// DELAY
|
|
|
|
|
delay_mixer[instance_id]->gain(0, 1.0); |
|
|
|
|
delay_mixer[instance_id]->gain(1, pseudo_log_curve(mapfloat(configuration.fx.delay_level[instance_id], DELAY_LEVEL_MIN, DELAY_LEVEL_MAX, 0.0, 1.0))); |
|
|
|
|
delay_fx[instance_id]->delay(0, constrain(configuration.fx.delay_time[instance_id] * 10, DELAY_TIME_MIN * 10, DELAY_TIME_MAX * 10)); |
|
|
|
|
delay_fx[instance_id]->delay(0, constrain(configuration.fx.delay_time[instance_id], DELAY_TIME_MIN, DELAY_TIME_MAX) * 10); |
|
|
|
|
delay_fb_mixer[instance_id]->gain(0, 1.0); |
|
|
|
|
delay_fb_mixer[instance_id]->gain(1, pseudo_log_curve(mapfloat(configuration.fx.delay_feedback[instance_id], DELAY_FEEDBACK_MIN, DELAY_FEEDBACK_MAX, 0.0, 1.0))); |
|
|
|
|
|
|
|
|
|
// REVERB
|
|
|
|
|
// REVERB SEND
|
|
|
|
|
reverb_mixer_r.gain(instance_id, pseudo_log_curve(configuration.fx.reverb_send[instance_id] / 100.0)); |
|
|
|
|
reverb_mixer_l.gain(instance_id, pseudo_log_curve(configuration.fx.reverb_send[instance_id] / 100.0)); |
|
|
|
|
|
|
|
|
|
// DEXED FILTER
|
|
|
|
|
//MicroDexed[instance_id]->fx.Gain = mapfloat(configuration.dexed[instance_id].sound_intensity, SOUND_INTENSITY_MIN, SOUND_INTENSITY_MAX, 0.0, SOUND_INTENSITY_AMP_MAX);
|
|
|
|
|
MicroDexed[instance_id]->fx.Gain = 1.0; |
|
|
|
|
MicroDexed[instance_id]->fx.Reso = mapfloat(configuration.dexed[instance_id].filter_resonance, FILTER_RESONANCE_MIN, FILTER_RESONANCE_MAX, 1.0, 0.0); |
|
|
|
|
MicroDexed[instance_id]->fx.Cutoff = mapfloat(configuration.dexed[instance_id].filter_cutoff, FILTER_CUTOFF_MIN, FILTER_CUTOFF_MAX, 1.0, 0.0); |
|
|
|
|
MicroDexed[instance_id]->doRefreshVoice(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// REVERB
|
|
|
|
@ -1809,12 +1813,20 @@ void set_fx_params(void) |
|
|
|
|
|
|
|
|
|
void set_voiceconfig_params(uint8_t instance_id) |
|
|
|
|
{ |
|
|
|
|
// DEXED FILTER
|
|
|
|
|
//MicroDexed[instance_id]->fx.Gain = mapfloat(configuration.dexed[instance_id].sound_intensity, SOUND_INTENSITY_MIN, SOUND_INTENSITY_MAX, 0.0, SOUND_INTENSITY_AMP_MAX);
|
|
|
|
|
MicroDexed[instance_id]->fx.Gain = 1.0; |
|
|
|
|
MicroDexed[instance_id]->fx.Reso = mapfloat(configuration.dexed[instance_id].filter_resonance, FILTER_RESONANCE_MIN, FILTER_RESONANCE_MAX, 1.0, 0.0); |
|
|
|
|
MicroDexed[instance_id]->fx.Cutoff = mapfloat(configuration.dexed[instance_id].filter_cutoff, FILTER_CUTOFF_MIN, FILTER_CUTOFF_MAX, 1.0, 0.0); |
|
|
|
|
// INIT PEAK MIXER
|
|
|
|
|
microdexed_peak_mixer.gain(instance_id, 1.0); |
|
|
|
|
|
|
|
|
|
// Controller
|
|
|
|
|
MicroDexed[instance_id]->setPBController(configuration.dexed[instance_id].pb_range, configuration.dexed[instance_id].pb_step); |
|
|
|
|
MicroDexed[instance_id]->setMWController(configuration.dexed[instance_id].mw_range, configuration.dexed[instance_id].mw_assign, configuration.dexed[instance_id].mw_mode); |
|
|
|
|
MicroDexed[instance_id]->setFCController(configuration.dexed[instance_id].fc_range, configuration.dexed[instance_id].fc_assign, configuration.dexed[instance_id].fc_mode); |
|
|
|
|
MicroDexed[instance_id]->setBCController(configuration.dexed[instance_id].bc_range, configuration.dexed[instance_id].bc_assign, configuration.dexed[instance_id].bc_mode); |
|
|
|
|
MicroDexed[instance_id]->setATController(configuration.dexed[instance_id].at_range, configuration.dexed[instance_id].at_assign, configuration.dexed[instance_id].at_mode); |
|
|
|
|
MicroDexed[instance_id]->controllers.refresh(); |
|
|
|
|
MicroDexed[instance_id]->setOPs(configuration.dexed[instance_id].op_enabled); |
|
|
|
|
MicroDexed[instance_id]->doRefreshVoice(); |
|
|
|
|
MicroDexed[instance_id]->setMaxNotes(configuration.dexed[instance_id].polyphony); |
|
|
|
|
MicroDexed[instance_id]->setMonoMode(configuration.sys.mono); |
|
|
|
|
|
|
|
|
|
// Dexed output level
|
|
|
|
|
dexed_level[instance_id]->gain(pseudo_log_curve(mapfloat(configuration.dexed[instance_id].sound_intensity, SOUND_INTENSITY_MIN, SOUND_INTENSITY_MAX, 0.0, SOUND_INTENSITY_AMP_MAX))); |
|
|
|
@ -2171,6 +2183,7 @@ void show_configuration(void) |
|
|
|
|
Serial.print(F(" Delay Time ")); Serial.println(configuration.fx.delay_time[instance_id], DEC); |
|
|
|
|
Serial.print(F(" Delay Feedback ")); Serial.println(configuration.fx.delay_feedback[instance_id], DEC); |
|
|
|
|
Serial.print(F(" Delay Level ")); Serial.println(configuration.fx.delay_level[instance_id], DEC); |
|
|
|
|
Serial.print(F(" Reverb Send ")); Serial.println(configuration.fx.reverb_send[instance_id], DEC); |
|
|
|
|
Serial.print(F(" Filter Cutoff ")); Serial.println(configuration.dexed[instance_id].filter_cutoff, DEC); |
|
|
|
|
Serial.print(F(" Filter Resonance ")); Serial.println(configuration.dexed[instance_id].filter_resonance, DEC); |
|
|
|
|
Serial.print(F(" Sound Intensity ")); Serial.println(configuration.dexed[instance_id].sound_intensity, DEC); |
|
|
|
|