|
|
@ -42,6 +42,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
// Audio engines
|
|
|
|
// Audio engines
|
|
|
|
AudioSourceMicroDexed* MicroDexed[NUM_DEXED]; |
|
|
|
AudioSourceMicroDexed* MicroDexed[NUM_DEXED]; |
|
|
|
|
|
|
|
AudioAmplifier* dexed_level[NUM_DEXED]; |
|
|
|
AudioEffectMonoStereo* mono2stereo[NUM_DEXED]; |
|
|
|
AudioEffectMonoStereo* mono2stereo[NUM_DEXED]; |
|
|
|
AudioAnalyzePeak microdexed_peak; |
|
|
|
AudioAnalyzePeak microdexed_peak; |
|
|
|
AudioMixer4 microdexed_peak_mixer; |
|
|
|
AudioMixer4 microdexed_peak_mixer; |
|
|
@ -169,14 +170,15 @@ AudioConnection patchCord34(stereo2mono, 1, dacOut, 1); |
|
|
|
//
|
|
|
|
//
|
|
|
|
uint8_t nDynamic = 0; |
|
|
|
uint8_t nDynamic = 0; |
|
|
|
#if defined(USE_FX) |
|
|
|
#if defined(USE_FX) |
|
|
|
AudioConnection * dynamicConnections[NUM_DEXED * 10]; |
|
|
|
AudioConnection * dynamicConnections[NUM_DEXED * 11]; |
|
|
|
#else |
|
|
|
#else |
|
|
|
AudioConnection * dynamicConnections[NUM_DEXED * 4]; |
|
|
|
AudioConnection * dynamicConnections[NUM_DEXED * 5]; |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
void create_audio_connections(AudioSourceMicroDexed &dexed, AudioEffectMonoStereo &mono2stereo, uint8_t instance_id) |
|
|
|
void create_audio_connections(AudioSourceMicroDexed &dexed, AudioEffectMonoStereo &mono2stereo, AudioAmplifier &dexed_level, uint8_t instance_id) |
|
|
|
{ |
|
|
|
{ |
|
|
|
dynamicConnections[nDynamic++] = new AudioConnection(dexed, 0, microdexed_peak_mixer, instance_id); |
|
|
|
dynamicConnections[nDynamic++] = new AudioConnection(dexed, 0, microdexed_peak_mixer, instance_id); |
|
|
|
dynamicConnections[nDynamic++] = new AudioConnection(dexed, 0, mono2stereo, 0); |
|
|
|
dynamicConnections[nDynamic++] = new AudioConnection(dexed, 0, dexed_level, 0); |
|
|
|
|
|
|
|
dynamicConnections[nDynamic++] = new AudioConnection(dexed_level, 0, mono2stereo, 0); |
|
|
|
dynamicConnections[nDynamic++] = new AudioConnection(mono2stereo, 0, dexed_mixer_r, instance_id); |
|
|
|
dynamicConnections[nDynamic++] = new AudioConnection(mono2stereo, 0, dexed_mixer_r, instance_id); |
|
|
|
dynamicConnections[nDynamic++] = new AudioConnection(mono2stereo, 1, dexed_mixer_l, instance_id); |
|
|
|
dynamicConnections[nDynamic++] = new AudioConnection(mono2stereo, 1, dexed_mixer_l, instance_id); |
|
|
|
#if defined(USE_FX) |
|
|
|
#if defined(USE_FX) |
|
|
@ -284,8 +286,9 @@ void setup() |
|
|
|
Serial.print(F("Creating MicroDexed instance ")); |
|
|
|
Serial.print(F("Creating MicroDexed instance ")); |
|
|
|
Serial.println(instance_id, DEC); |
|
|
|
Serial.println(instance_id, DEC); |
|
|
|
MicroDexed[instance_id] = new AudioSourceMicroDexed(SAMPLE_RATE); |
|
|
|
MicroDexed[instance_id] = new AudioSourceMicroDexed(SAMPLE_RATE); |
|
|
|
|
|
|
|
dexed_level[instance_id] = new AudioAmplifier(); |
|
|
|
mono2stereo[instance_id] = new AudioEffectMonoStereo(); |
|
|
|
mono2stereo[instance_id] = new AudioEffectMonoStereo(); |
|
|
|
create_audio_connections(*MicroDexed[instance_id], *mono2stereo[instance_id], instance_id); |
|
|
|
create_audio_connections(*MicroDexed[instance_id], *mono2stereo[instance_id], *dexed_level[instance_id], instance_id); |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
{ |
|
|
@ -464,13 +467,17 @@ void setup() |
|
|
|
// INIT CHORUS
|
|
|
|
// 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_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)); |
|
|
|
chorus_send_mixer_l.gain(instance_id, mapfloat(configuration.dexed[instance_id].chorus_send, CHORUS_SEND_MIN, CHORUS_SEND_MAX, 0.0, 1.0)); |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// DEXED FILTER
|
|
|
|
// DEXED FILTER
|
|
|
|
MicroDexed[instance_id]->fx.Gain = mapfloat(configuration.dexed[instance_id].sound_intensity, SOUND_INTENSITY_MIN, SOUND_INTENSITY_MAX, 0.0, 1.0); |
|
|
|
//MicroDexed[instance_id]->fx.Gain = mapfloat(configuration.dexed[instance_id].sound_intensity, SOUND_INTENSITY_MIN, SOUND_INTENSITY_MAX, 0.0, 1.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.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]->fx.Cutoff = mapfloat(configuration.dexed[instance_id].filter_cutoff, FILTER_CUTOFF_MIN, FILTER_CUTOFF_MAX, 1.0, 0.0); |
|
|
|
MicroDexed[instance_id]->doRefreshVoice(); |
|
|
|
MicroDexed[instance_id]->doRefreshVoice(); |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Dexed output level
|
|
|
|
|
|
|
|
dexed_level[instance_id]->gain(1.0); |
|
|
|
|
|
|
|
|
|
|
|
// PANORAMA
|
|
|
|
// PANORAMA
|
|
|
|
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)); |
|
|
@ -727,7 +734,11 @@ void handleControlChange(byte inChannel, byte inCtrl, byte inValue) |
|
|
|
Serial.println(F("VOLUME CC")); |
|
|
|
Serial.println(F("VOLUME CC")); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
configuration.dexed[instance_id].sound_intensity = map(inValue, 0, 0x7f, SOUND_INTENSITY_MIN, SOUND_INTENSITY_MAX); |
|
|
|
configuration.dexed[instance_id].sound_intensity = map(inValue, 0, 0x7f, SOUND_INTENSITY_MIN, SOUND_INTENSITY_MAX); |
|
|
|
|
|
|
|
#ifdef USE_FX |
|
|
|
MicroDexed[instance_id]->fx.Gain = mapfloat(configuration.dexed[instance_id].sound_intensity, SOUND_INTENSITY_MIN, SOUND_INTENSITY_MAX, 0.0, 1.0); |
|
|
|
MicroDexed[instance_id]->fx.Gain = mapfloat(configuration.dexed[instance_id].sound_intensity, SOUND_INTENSITY_MIN, SOUND_INTENSITY_MAX, 0.0, 1.0); |
|
|
|
|
|
|
|
#else |
|
|
|
|
|
|
|
dexed_level[instance_id]->gain(mapfloat(configuration.dexed[instance_id].sound_intensity, SOUND_INTENSITY_MIN, SOUND_INTENSITY_MAX, 0.0, 2.0)); |
|
|
|
|
|
|
|
#endif |
|
|
|
eeprom_write(); |
|
|
|
eeprom_write(); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 10: // Pan
|
|
|
|
case 10: // Pan
|
|
|
@ -1304,12 +1315,13 @@ void initial_values_from_eeprom(bool init) |
|
|
|
delay_fb_mixer_l.gain(1, mapfloat(configuration.delay_feedback, DELAY_FEEDBACK_MIN, DELAY_FEEDBACK_MAX, 0.0, 1.0)); // amount of feedback
|
|
|
|
delay_fb_mixer_l.gain(1, mapfloat(configuration.delay_feedback, DELAY_FEEDBACK_MIN, DELAY_FEEDBACK_MAX, 0.0, 1.0)); // amount of feedback
|
|
|
|
reverb_send_mixer_r.gain(instance_id, configuration.dexed[instance_id].reverb_send / 100.0); |
|
|
|
reverb_send_mixer_r.gain(instance_id, configuration.dexed[instance_id].reverb_send / 100.0); |
|
|
|
reverb_send_mixer_l.gain(instance_id, configuration.dexed[instance_id].reverb_send / 100.0); |
|
|
|
reverb_send_mixer_l.gain(instance_id, configuration.dexed[instance_id].reverb_send / 100.0); |
|
|
|
#endif |
|
|
|
// MicroDexed[instance_id]->fx.Gain = configuration.dexed[instance_id].sound_intensity / 100.0;
|
|
|
|
MicroDexed[instance_id]->setOPs(configuration.dexed[instance_id].op_enabled); |
|
|
|
MicroDexed[instance_id]->fx.Gain = 1.0; |
|
|
|
|
|
|
|
|
|
|
|
MicroDexed[instance_id]->fx.Gain = configuration.dexed[instance_id].sound_intensity / 100.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.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]->fx.Cutoff = mapfloat(configuration.dexed[instance_id].filter_cutoff, FILTER_CUTOFF_MIN, FILTER_CUTOFF_MAX, 1.0, 0.0); |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
MicroDexed[instance_id]->setOPs(configuration.dexed[instance_id].op_enabled); |
|
|
|
|
|
|
|
dexed_level[instance_id]->gain(mapfloat(configuration.dexed[instance_id].sound_intensity, SOUND_INTENSITY_MIN, SOUND_INTENSITY_MAX, 0.0, 2.0)); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
Serial.println(F("OK, loaded!")); |
|
|
|
Serial.println(F("OK, loaded!")); |
|
|
|