|
|
@ -443,12 +443,8 @@ void setup() |
|
|
|
|
|
|
|
|
|
|
|
master_mixer_r.gain(DEXED, 1.0); |
|
|
|
master_mixer_r.gain(DEXED, 1.0); |
|
|
|
master_mixer_l.gain(DEXED, 1.0); |
|
|
|
master_mixer_l.gain(DEXED, 1.0); |
|
|
|
master_mixer_r.gain(CHORUS, mapfloat(configuration.fx.chorus_level, CHORUS_LEVEL_MIN, CHORUS_LEVEL_MAX, 0.0, 1.0)); |
|
|
|
|
|
|
|
master_mixer_l.gain(CHORUS, mapfloat(configuration.fx.chorus_level, CHORUS_LEVEL_MIN, CHORUS_LEVEL_MAX, 0.0, 1.0)); |
|
|
|
set_fx_params(); |
|
|
|
master_mixer_r.gain(DELAY, mapfloat(configuration.fx.delay_level, DELAY_LEVEL_MIN, DELAY_LEVEL_MAX, 0.0, 1.0)); |
|
|
|
|
|
|
|
master_mixer_l.gain(DELAY, mapfloat(configuration.fx.delay_level, DELAY_LEVEL_MIN, DELAY_LEVEL_MAX, 0.0, 1.0)); |
|
|
|
|
|
|
|
master_mixer_r.gain(REVERB, mapfloat(configuration.fx.reverb_level, REVERB_LEVEL_MIN, REVERB_LEVEL_MAX, 0.0, 1.0)); |
|
|
|
|
|
|
|
master_mixer_l.gain(REVERB, mapfloat(configuration.fx.reverb_level, REVERB_LEVEL_MIN, REVERB_LEVEL_MAX, 0.0, 1.0)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) |
|
|
|
for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -459,91 +455,10 @@ void setup() |
|
|
|
dexed_mixer_r.gain(instance_id, 1.0); |
|
|
|
dexed_mixer_r.gain(instance_id, 1.0); |
|
|
|
dexed_mixer_l.gain(instance_id, 1.0); |
|
|
|
dexed_mixer_l.gain(instance_id, 1.0); |
|
|
|
|
|
|
|
|
|
|
|
#if defined(USE_FX) |
|
|
|
set_voiceconfig_params(instance_id); |
|
|
|
// INIT REVERB
|
|
|
|
|
|
|
|
reverb_send_mixer_r.gain(instance_id, mapfloat(configuration.dexed[instance_id].reverb_send, REVERB_SEND_MIN, REVERB_SEND_MAX, 0.0, 1.0)); |
|
|
|
|
|
|
|
reverb_send_mixer_l.gain(instance_id, mapfloat(configuration.dexed[instance_id].reverb_send, REVERB_SEND_MIN, REVERB_SEND_MAX, 0.0, 1.0)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// INIT DELAY
|
|
|
|
|
|
|
|
delay_send_mixer_r.gain(instance_id, mapfloat(configuration.dexed[instance_id].delay_send, DELAY_SEND_MIN, DELAY_SEND_MAX, 0.0, 1.0)); |
|
|
|
|
|
|
|
delay_send_mixer_l.gain(instance_id, mapfloat(configuration.dexed[instance_id].delay_send, DELAY_SEND_MIN, DELAY_SEND_MAX, 0.0, 1.0)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// INIT CHORUS
|
|
|
|
|
|
|
|
chorus_send_mixer_r.gain(instance_id, mapfloat(configuration.dexed[instance_id].chorus_send, CHORUS_SEND_MIN, CHORUS_SEND_MAX, 0.0, 1.0)); |
|
|
|
|
|
|
|
chorus_send_mixer_l.gain(instance_id, mapfloat(configuration.dexed[instance_id].chorus_send, CHORUS_SEND_MIN, CHORUS_SEND_MAX, 0.0, 1.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(); |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Dexed output level
|
|
|
|
|
|
|
|
dexed_level[instance_id]->gain(mapfloat(configuration.dexed[instance_id].sound_intensity, SOUND_INTENSITY_MIN, SOUND_INTENSITY_MAX, 0.0, SOUND_INTENSITY_AMP_MAX)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// PANORAMA
|
|
|
|
|
|
|
|
mono2stereo[instance_id]->panorama(mapfloat(configuration.dexed[instance_id].pan, PANORAMA_MIN, PANORAMA_MAX, -1.0, 1.0)); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#if defined(USE_FX) |
|
|
|
set_sys_params(); |
|
|
|
// DELAY
|
|
|
|
|
|
|
|
delay_r.delay(0, mapfloat(configuration.fx.delay_time * 10, DELAY_TIME_MIN, DELAY_TIME_MAX, 0.0, float(DELAY_TIME_MAX))); |
|
|
|
|
|
|
|
delay_l.delay(0, mapfloat(configuration.fx.delay_time * 10, DELAY_TIME_MIN, DELAY_TIME_MAX, 0.0, float(DELAY_TIME_MAX))); |
|
|
|
|
|
|
|
// delay_fb_mixer is the feedback-adding mixer
|
|
|
|
|
|
|
|
delay_fb_mixer_r.gain(0, 1.0); // original signal
|
|
|
|
|
|
|
|
delay_fb_mixer_r.gain(1, mapfloat(configuration.fx.delay_feedback, DELAY_FEEDBACK_MIN, DELAY_FEEDBACK_MAX, 0.0, 1.0)); // amount of feedback
|
|
|
|
|
|
|
|
delay_fb_mixer_l.gain(0, 1.0); // original signal
|
|
|
|
|
|
|
|
delay_fb_mixer_l.gain(1, mapfloat(configuration.fx.delay_feedback, DELAY_FEEDBACK_MIN, DELAY_FEEDBACK_MAX, 0.0, 1.0)); // amount of feedback
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// CHORUS
|
|
|
|
|
|
|
|
switch (configuration.fx.chorus_waveform) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
case 0: |
|
|
|
|
|
|
|
chorus_modulator.begin(WAVEFORM_TRIANGLE); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case 1: |
|
|
|
|
|
|
|
chorus_modulator.begin(WAVEFORM_SINE); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
default: |
|
|
|
|
|
|
|
chorus_modulator.begin(WAVEFORM_TRIANGLE); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
chorus_modulator.phase(0); |
|
|
|
|
|
|
|
chorus_modulator.frequency(configuration.fx.chorus_frequency / 10.0); |
|
|
|
|
|
|
|
chorus_modulator.amplitude(mapfloat(configuration.fx.chorus_depth, CHORUS_DEPTH_MIN, CHORUS_DEPTH_MAX, 0.0, 1.0)); |
|
|
|
|
|
|
|
chorus_modulator.offset(0.0); |
|
|
|
|
|
|
|
#if MOD_FILTER_OUTPUT == MOD_BUTTERWORTH_FILTER_OUTPUT |
|
|
|
|
|
|
|
// Butterworth filter, 12 db/octave
|
|
|
|
|
|
|
|
modchorus_filter_r.setLowpass(0, MOD_FILTER_CUTOFF_HZ, 0.707); |
|
|
|
|
|
|
|
modchorus_filter_l.setLowpass(0, MOD_FILTER_CUTOFF_HZ, 0.707); |
|
|
|
|
|
|
|
#elif MOD_FILTER_OUTPUT == MOD_LINKWITZ_RILEY_FILTER_OUTPUT |
|
|
|
|
|
|
|
// Linkwitz-Riley filter, 48 dB/octave
|
|
|
|
|
|
|
|
modchorus_filter_r.setLowpass(0, MOD_FILTER_CUTOFF_HZ, 0.54); |
|
|
|
|
|
|
|
modchorus_filter_r.setLowpass(1, MOD_FILTER_CUTOFF_HZ, 1.3); |
|
|
|
|
|
|
|
modchorus_filter_r.setLowpass(2, MOD_FILTER_CUTOFF_HZ, 0.54); |
|
|
|
|
|
|
|
modchorus_filter_r.setLowpass(3, MOD_FILTER_CUTOFF_HZ, 1.3); |
|
|
|
|
|
|
|
modchorus_filter_l.setLowpass(0, MOD_FILTER_CUTOFF_HZ, 0.54); |
|
|
|
|
|
|
|
modchorus_filter_l.setLowpass(1, MOD_FILTER_CUTOFF_HZ, 1.3); |
|
|
|
|
|
|
|
modchorus_filter_l.setLowpass(2, MOD_FILTER_CUTOFF_HZ, 0.54); |
|
|
|
|
|
|
|
modchorus_filter_l.setLowpass(3, MOD_FILTER_CUTOFF_HZ, 1.3); |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// REVERB
|
|
|
|
|
|
|
|
freeverb_r.roomsize(mapfloat(configuration.fx.reverb_roomsize, REVERB_ROOMSIZE_MIN, REVERB_ROOMSIZE_MAX, 0.0, 1.0)); |
|
|
|
|
|
|
|
freeverb_r.damping(mapfloat(configuration.fx.reverb_damping, REVERB_DAMPING_MIN, REVERB_DAMPING_MAX, 0.0, 1.0)); |
|
|
|
|
|
|
|
freeverb_l.roomsize(mapfloat(configuration.fx.reverb_roomsize, REVERB_ROOMSIZE_MIN, REVERB_ROOMSIZE_MAX, 0.0, 1.0)); |
|
|
|
|
|
|
|
freeverb_l.damping(mapfloat(configuration.fx.reverb_damping, REVERB_DAMPING_MIN, REVERB_DAMPING_MAX, 0.0, 1.0)); |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// MONO/STEREO
|
|
|
|
|
|
|
|
if (configuration.sys.mono == 0) |
|
|
|
|
|
|
|
modchorus_inverter.gain(-1.0); // stereo mode
|
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
modchorus_inverter.gain(1.0); // mono mode
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// set initial volume
|
|
|
|
|
|
|
|
set_volume(configuration.sys.vol, configuration.sys.mono); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Initialize processor and memory measurements
|
|
|
|
// Initialize processor and memory measurements
|
|
|
|
AudioProcessorUsageMaxReset(); |
|
|
|
AudioProcessorUsageMaxReset(); |
|
|
@ -708,7 +623,6 @@ void handleControlChange(byte inChannel, byte inCtrl, byte inValue) |
|
|
|
if (inValue < MAX_BANKS - 1) |
|
|
|
if (inValue < MAX_BANKS - 1) |
|
|
|
{ |
|
|
|
{ |
|
|
|
configuration.performance.bank[instance_id] = inValue; |
|
|
|
configuration.performance.bank[instance_id] = inValue; |
|
|
|
//eeprom_write();
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 1: |
|
|
|
case 1: |
|
|
@ -736,7 +650,6 @@ void handleControlChange(byte inChannel, byte inCtrl, byte inValue) |
|
|
|
case 5: // Portamento time
|
|
|
|
case 5: // Portamento time
|
|
|
|
configuration.dexed[instance_id].portamento_time = inValue; |
|
|
|
configuration.dexed[instance_id].portamento_time = inValue; |
|
|
|
MicroDexed[instance_id]->setPortamentoMode(configuration.dexed[instance_id].portamento_mode, configuration.dexed[instance_id].portamento_glissando, configuration.dexed[instance_id].portamento_time); |
|
|
|
MicroDexed[instance_id]->setPortamentoMode(configuration.dexed[instance_id].portamento_mode, configuration.dexed[instance_id].portamento_glissando, configuration.dexed[instance_id].portamento_time); |
|
|
|
//eeprom_write();
|
|
|
|
|
|
|
|
break; |
|
|
|
break; |
|
|
|
case 7: // Instance Volume
|
|
|
|
case 7: // Instance Volume
|
|
|
|
#ifdef DEBUG |
|
|
|
#ifdef DEBUG |
|
|
@ -748,7 +661,6 @@ void handleControlChange(byte inChannel, byte inCtrl, byte inValue) |
|
|
|
#else |
|
|
|
#else |
|
|
|
dexed_level[instance_id]->gain(mapfloat(configuration.dexed[instance_id].sound_intensity, SOUND_INTENSITY_MIN, SOUND_INTENSITY_MAX, 0.0, SOUND_INTENSITY_AMP_MAX)); |
|
|
|
dexed_level[instance_id]->gain(mapfloat(configuration.dexed[instance_id].sound_intensity, SOUND_INTENSITY_MIN, SOUND_INTENSITY_MAX, 0.0, SOUND_INTENSITY_AMP_MAX)); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
//eeprom_write();
|
|
|
|
|
|
|
|
break; |
|
|
|
break; |
|
|
|
case 10: // Pan
|
|
|
|
case 10: // Pan
|
|
|
|
#ifdef DEBUG |
|
|
|
#ifdef DEBUG |
|
|
@ -756,14 +668,12 @@ void handleControlChange(byte inChannel, byte inCtrl, byte inValue) |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
configuration.dexed[instance_id].pan = map(inValue, 0, 0x7f, PANORAMA_MIN, PANORAMA_MAX); |
|
|
|
configuration.dexed[instance_id].pan = map(inValue, 0, 0x7f, PANORAMA_MIN, PANORAMA_MAX); |
|
|
|
mono2stereo[instance_id]->panorama(mapfloat(configuration.dexed[instance_id].pan, PANORAMA_MIN, PANORAMA_MAX, -1.0, 1.0)); |
|
|
|
mono2stereo[instance_id]->panorama(mapfloat(configuration.dexed[instance_id].pan, PANORAMA_MIN, PANORAMA_MAX, -1.0, 1.0)); |
|
|
|
//eeprom_write();
|
|
|
|
|
|
|
|
break; |
|
|
|
break; |
|
|
|
case 32: // BankSelect LSB
|
|
|
|
case 32: // BankSelect LSB
|
|
|
|
#ifdef DEBUG |
|
|
|
#ifdef DEBUG |
|
|
|
Serial.println(F("BANK-SELECT CC")); |
|
|
|
Serial.println(F("BANK-SELECT CC")); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
configuration.performance.bank[instance_id] = inValue; |
|
|
|
configuration.performance.bank[instance_id] = inValue; |
|
|
|
//eeprom_write();
|
|
|
|
|
|
|
|
break; |
|
|
|
break; |
|
|
|
case 64: |
|
|
|
case 64: |
|
|
|
MicroDexed[instance_id]->setSustain(inValue > 63); |
|
|
|
MicroDexed[instance_id]->setSustain(inValue > 63); |
|
|
@ -781,37 +691,31 @@ void handleControlChange(byte inChannel, byte inCtrl, byte inValue) |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 65: |
|
|
|
case 65: |
|
|
|
MicroDexed[instance_id]->setPortamentoMode(configuration.dexed[instance_id].portamento_mode, configuration.dexed[instance_id].portamento_glissando, configuration.dexed[instance_id].portamento_time); |
|
|
|
MicroDexed[instance_id]->setPortamentoMode(configuration.dexed[instance_id].portamento_mode, configuration.dexed[instance_id].portamento_glissando, configuration.dexed[instance_id].portamento_time); |
|
|
|
//eeprom_write();
|
|
|
|
|
|
|
|
break; |
|
|
|
break; |
|
|
|
#if defined(USE_FX) |
|
|
|
#if defined(USE_FX) |
|
|
|
case 103: // CC 103: filter resonance
|
|
|
|
case 103: // CC 103: filter resonance
|
|
|
|
configuration.dexed[instance_id].filter_resonance = map(inValue, 0, 0x7f, FILTER_RESONANCE_MIN, FILTER_RESONANCE_MAX); |
|
|
|
configuration.dexed[instance_id].filter_resonance = map(inValue, 0, 0x7f, FILTER_RESONANCE_MIN, FILTER_RESONANCE_MAX); |
|
|
|
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.Reso = mapfloat(configuration.dexed[instance_id].filter_resonance, FILTER_RESONANCE_MIN, FILTER_RESONANCE_MAX, 1.0, 0.0); |
|
|
|
//eeprom_write();
|
|
|
|
|
|
|
|
break; |
|
|
|
break; |
|
|
|
case 104: // CC 104: filter cutoff
|
|
|
|
case 104: // CC 104: filter cutoff
|
|
|
|
configuration.dexed[instance_id].filter_cutoff = map(inValue, 0, 0x7f, FILTER_CUTOFF_MIN, FILTER_CUTOFF_MAX); |
|
|
|
configuration.dexed[instance_id].filter_cutoff = map(inValue, 0, 0x7f, FILTER_CUTOFF_MIN, FILTER_CUTOFF_MAX); |
|
|
|
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]->fx.Cutoff = mapfloat(configuration.dexed[instance_id].filter_cutoff, FILTER_CUTOFF_MIN, FILTER_CUTOFF_MAX, 1.0, 0.0); |
|
|
|
//eeprom_write();
|
|
|
|
|
|
|
|
break; |
|
|
|
break; |
|
|
|
case 105: // CC 105: delay time
|
|
|
|
case 105: // CC 105: delay time
|
|
|
|
configuration.fx.delay_time = map(inValue, 0, 0x7f, DELAY_TIME_MIN, DELAY_TIME_MAX); |
|
|
|
configuration.fx.delay_time = map(inValue, 0, 0x7f, DELAY_TIME_MIN, DELAY_TIME_MAX); |
|
|
|
delay_r.delay(0, configuration.fx.delay_time * 10); |
|
|
|
delay_r.delay(0, configuration.fx.delay_time * 10); |
|
|
|
delay_l.delay(0, configuration.fx.delay_time * 10); |
|
|
|
delay_l.delay(0, configuration.fx.delay_time * 10); |
|
|
|
//eeprom_write();
|
|
|
|
|
|
|
|
case 106: // CC 106: delay feedback
|
|
|
|
case 106: // CC 106: delay feedback
|
|
|
|
configuration.fx.delay_feedback = map(inValue, 0, 0x7f, DELAY_FEEDBACK_MIN , DELAY_FEEDBACK_MAX); |
|
|
|
configuration.fx.delay_feedback = map(inValue, 0, 0x7f, DELAY_FEEDBACK_MIN , DELAY_FEEDBACK_MAX); |
|
|
|
//delay_fb_mixer_r.gain(0, 1.0); // original signal
|
|
|
|
//delay_fb_mixer_r.gain(0, 1.0); // original signal
|
|
|
|
delay_fb_mixer_r.gain(1, mapfloat(configuration.fx.delay_feedback, DELAY_FEEDBACK_MIN, DELAY_FEEDBACK_MAX, 0.0, 1.0)); // amount of feedback
|
|
|
|
delay_fb_mixer_r.gain(1, mapfloat(configuration.fx.delay_feedback, DELAY_FEEDBACK_MIN, DELAY_FEEDBACK_MAX, 0.0, 1.0)); // amount of feedback
|
|
|
|
//delay_fb_mixer_l.gain(0, 1.0); // original signal
|
|
|
|
//delay_fb_mixer_l.gain(0, 1.0); // original signal
|
|
|
|
delay_fb_mixer_l.gain(1, mapfloat(configuration.fx.delay_feedback, DELAY_FEEDBACK_MIN, DELAY_FEEDBACK_MAX, 0.0, 1.0)); // amount of feedback
|
|
|
|
delay_fb_mixer_l.gain(1, mapfloat(configuration.fx.delay_feedback, DELAY_FEEDBACK_MIN, DELAY_FEEDBACK_MAX, 0.0, 1.0)); // amount of feedback
|
|
|
|
//eeprom_write();
|
|
|
|
|
|
|
|
break; |
|
|
|
break; |
|
|
|
case 107: // CC 107: delay volume
|
|
|
|
case 107: // CC 107: delay volume
|
|
|
|
configuration.dexed[instance_id].delay_send = map(inValue, 0, 0x7f, DELAY_SEND_MIN, DELAY_SEND_MAX); |
|
|
|
configuration.dexed[instance_id].delay_send = map(inValue, 0, 0x7f, DELAY_SEND_MIN, DELAY_SEND_MAX); |
|
|
|
master_mixer_r.gain(DELAY, mapfloat(configuration.fx.delay_level, DELAY_LEVEL_MIN, DELAY_LEVEL_MAX, 0.0, 1.0)); |
|
|
|
master_mixer_r.gain(DELAY, mapfloat(configuration.fx.delay_level, DELAY_LEVEL_MIN, DELAY_LEVEL_MAX, 0.0, 1.0)); |
|
|
|
master_mixer_l.gain(DELAY, mapfloat(configuration.fx.delay_level, DELAY_LEVEL_MIN, DELAY_LEVEL_MAX, 0.0, 1.0)); |
|
|
|
master_mixer_l.gain(DELAY, mapfloat(configuration.fx.delay_level, DELAY_LEVEL_MIN, DELAY_LEVEL_MAX, 0.0, 1.0)); |
|
|
|
//eeprom_write();
|
|
|
|
|
|
|
|
break; |
|
|
|
break; |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
case 120: |
|
|
|
case 120: |
|
|
@ -825,11 +729,9 @@ void handleControlChange(byte inChannel, byte inCtrl, byte inValue) |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 126: |
|
|
|
case 126: |
|
|
|
MicroDexed[instance_id]->setMonoMode(true); |
|
|
|
MicroDexed[instance_id]->setMonoMode(true); |
|
|
|
//eeprom_write();
|
|
|
|
|
|
|
|
break; |
|
|
|
break; |
|
|
|
case 127: |
|
|
|
case 127: |
|
|
|
MicroDexed[instance_id]->setMonoMode(false); |
|
|
|
MicroDexed[instance_id]->setMonoMode(false); |
|
|
|
//eeprom_write();
|
|
|
|
|
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -1591,6 +1493,112 @@ bool eeprom_get_performance() |
|
|
|
return (true); |
|
|
|
return (true); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
|
|
|
|
PARAMETER-HELPERS |
|
|
|
|
|
|
|
******************************************************************************/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void set_fx_params(void) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
master_mixer_r.gain(CHORUS, mapfloat(configuration.fx.chorus_level, CHORUS_LEVEL_MIN, CHORUS_LEVEL_MAX, 0.0, 1.0)); |
|
|
|
|
|
|
|
master_mixer_l.gain(CHORUS, mapfloat(configuration.fx.chorus_level, CHORUS_LEVEL_MIN, CHORUS_LEVEL_MAX, 0.0, 1.0)); |
|
|
|
|
|
|
|
master_mixer_r.gain(DELAY, mapfloat(configuration.fx.delay_level, DELAY_LEVEL_MIN, DELAY_LEVEL_MAX, 0.0, 1.0)); |
|
|
|
|
|
|
|
master_mixer_l.gain(DELAY, mapfloat(configuration.fx.delay_level, DELAY_LEVEL_MIN, DELAY_LEVEL_MAX, 0.0, 1.0)); |
|
|
|
|
|
|
|
master_mixer_r.gain(REVERB, mapfloat(configuration.fx.reverb_level, REVERB_LEVEL_MIN, REVERB_LEVEL_MAX, 0.0, 1.0)); |
|
|
|
|
|
|
|
master_mixer_l.gain(REVERB, mapfloat(configuration.fx.reverb_level, REVERB_LEVEL_MIN, REVERB_LEVEL_MAX, 0.0, 1.0)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if defined(USE_FX) |
|
|
|
|
|
|
|
// DELAY
|
|
|
|
|
|
|
|
delay_r.delay(0, mapfloat(configuration.fx.delay_time * 10, DELAY_TIME_MIN, DELAY_TIME_MAX, 0.0, float(DELAY_TIME_MAX))); |
|
|
|
|
|
|
|
delay_l.delay(0, mapfloat(configuration.fx.delay_time * 10, DELAY_TIME_MIN, DELAY_TIME_MAX, 0.0, float(DELAY_TIME_MAX))); |
|
|
|
|
|
|
|
// delay_fb_mixer is the feedback-adding mixer
|
|
|
|
|
|
|
|
delay_fb_mixer_r.gain(0, 1.0); // original signal
|
|
|
|
|
|
|
|
delay_fb_mixer_r.gain(1, mapfloat(configuration.fx.delay_feedback, DELAY_FEEDBACK_MIN, DELAY_FEEDBACK_MAX, 0.0, 1.0)); // amount of feedback
|
|
|
|
|
|
|
|
delay_fb_mixer_l.gain(0, 1.0); // original signal
|
|
|
|
|
|
|
|
delay_fb_mixer_l.gain(1, mapfloat(configuration.fx.delay_feedback, DELAY_FEEDBACK_MIN, DELAY_FEEDBACK_MAX, 0.0, 1.0)); // amount of feedback
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// CHORUS
|
|
|
|
|
|
|
|
switch (configuration.fx.chorus_waveform) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
case 0: |
|
|
|
|
|
|
|
chorus_modulator.begin(WAVEFORM_TRIANGLE); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case 1: |
|
|
|
|
|
|
|
chorus_modulator.begin(WAVEFORM_SINE); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
default: |
|
|
|
|
|
|
|
chorus_modulator.begin(WAVEFORM_TRIANGLE); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
chorus_modulator.phase(0); |
|
|
|
|
|
|
|
chorus_modulator.frequency(configuration.fx.chorus_frequency / 10.0); |
|
|
|
|
|
|
|
chorus_modulator.amplitude(mapfloat(configuration.fx.chorus_depth, CHORUS_DEPTH_MIN, CHORUS_DEPTH_MAX, 0.0, 1.0)); |
|
|
|
|
|
|
|
chorus_modulator.offset(0.0); |
|
|
|
|
|
|
|
#if MOD_FILTER_OUTPUT == MOD_BUTTERWORTH_FILTER_OUTPUT |
|
|
|
|
|
|
|
// Butterworth filter, 12 db/octave
|
|
|
|
|
|
|
|
modchorus_filter_r.setLowpass(0, MOD_FILTER_CUTOFF_HZ, 0.707); |
|
|
|
|
|
|
|
modchorus_filter_l.setLowpass(0, MOD_FILTER_CUTOFF_HZ, 0.707); |
|
|
|
|
|
|
|
#elif MOD_FILTER_OUTPUT == MOD_LINKWITZ_RILEY_FILTER_OUTPUT |
|
|
|
|
|
|
|
// Linkwitz-Riley filter, 48 dB/octave
|
|
|
|
|
|
|
|
modchorus_filter_r.setLowpass(0, MOD_FILTER_CUTOFF_HZ, 0.54); |
|
|
|
|
|
|
|
modchorus_filter_r.setLowpass(1, MOD_FILTER_CUTOFF_HZ, 1.3); |
|
|
|
|
|
|
|
modchorus_filter_r.setLowpass(2, MOD_FILTER_CUTOFF_HZ, 0.54); |
|
|
|
|
|
|
|
modchorus_filter_r.setLowpass(3, MOD_FILTER_CUTOFF_HZ, 1.3); |
|
|
|
|
|
|
|
modchorus_filter_l.setLowpass(0, MOD_FILTER_CUTOFF_HZ, 0.54); |
|
|
|
|
|
|
|
modchorus_filter_l.setLowpass(1, MOD_FILTER_CUTOFF_HZ, 1.3); |
|
|
|
|
|
|
|
modchorus_filter_l.setLowpass(2, MOD_FILTER_CUTOFF_HZ, 0.54); |
|
|
|
|
|
|
|
modchorus_filter_l.setLowpass(3, MOD_FILTER_CUTOFF_HZ, 1.3); |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// REVERB
|
|
|
|
|
|
|
|
freeverb_r.roomsize(mapfloat(configuration.fx.reverb_roomsize, REVERB_ROOMSIZE_MIN, REVERB_ROOMSIZE_MAX, 0.0, 1.0)); |
|
|
|
|
|
|
|
freeverb_r.damping(mapfloat(configuration.fx.reverb_damping, REVERB_DAMPING_MIN, REVERB_DAMPING_MAX, 0.0, 1.0)); |
|
|
|
|
|
|
|
freeverb_l.roomsize(mapfloat(configuration.fx.reverb_roomsize, REVERB_ROOMSIZE_MIN, REVERB_ROOMSIZE_MAX, 0.0, 1.0)); |
|
|
|
|
|
|
|
freeverb_l.damping(mapfloat(configuration.fx.reverb_damping, REVERB_DAMPING_MIN, REVERB_DAMPING_MAX, 0.0, 1.0)); |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void set_voiceconfig_params(uint8_t instance_id) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
#if defined(USE_FX) |
|
|
|
|
|
|
|
// INIT REVERB
|
|
|
|
|
|
|
|
reverb_send_mixer_r.gain(instance_id, mapfloat(configuration.dexed[instance_id].reverb_send, REVERB_SEND_MIN, REVERB_SEND_MAX, 0.0, 1.0)); |
|
|
|
|
|
|
|
reverb_send_mixer_l.gain(instance_id, mapfloat(configuration.dexed[instance_id].reverb_send, REVERB_SEND_MIN, REVERB_SEND_MAX, 0.0, 1.0)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// INIT DELAY
|
|
|
|
|
|
|
|
delay_send_mixer_r.gain(instance_id, mapfloat(configuration.dexed[instance_id].delay_send, DELAY_SEND_MIN, DELAY_SEND_MAX, 0.0, 1.0)); |
|
|
|
|
|
|
|
delay_send_mixer_l.gain(instance_id, mapfloat(configuration.dexed[instance_id].delay_send, DELAY_SEND_MIN, DELAY_SEND_MAX, 0.0, 1.0)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// INIT CHORUS
|
|
|
|
|
|
|
|
chorus_send_mixer_r.gain(instance_id, mapfloat(configuration.dexed[instance_id].chorus_send, CHORUS_SEND_MIN, CHORUS_SEND_MAX, 0.0, 1.0)); |
|
|
|
|
|
|
|
chorus_send_mixer_l.gain(instance_id, mapfloat(configuration.dexed[instance_id].chorus_send, CHORUS_SEND_MIN, CHORUS_SEND_MAX, 0.0, 1.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(); |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Dexed output level
|
|
|
|
|
|
|
|
dexed_level[instance_id]->gain(mapfloat(configuration.dexed[instance_id].sound_intensity, SOUND_INTENSITY_MIN, SOUND_INTENSITY_MAX, 0.0, SOUND_INTENSITY_AMP_MAX)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// PANORAMA
|
|
|
|
|
|
|
|
mono2stereo[instance_id]->panorama(mapfloat(configuration.dexed[instance_id].pan, PANORAMA_MIN, PANORAMA_MAX, -1.0, 1.0)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void set_sys_params(void) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
// MONO/STEREO
|
|
|
|
|
|
|
|
if (configuration.sys.mono == 0) |
|
|
|
|
|
|
|
modchorus_inverter.gain(-1.0); // stereo mode
|
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
modchorus_inverter.gain(1.0); // mono mode
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// set initial volume
|
|
|
|
|
|
|
|
set_volume(configuration.sys.vol, configuration.sys.mono); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
/******************************************************************************
|
|
|
|
HELPERS |
|
|
|
HELPERS |
|
|
|
******************************************************************************/ |
|
|
|
******************************************************************************/ |
|
|
|