|
|
@ -46,6 +46,8 @@ AudioSourceMicroDexed* MicroDexed[NUM_DEXED]; |
|
|
|
AudioEffectDelay delay1; |
|
|
|
AudioEffectDelay delay1; |
|
|
|
AudioEffectModulatedDelay modchorus; |
|
|
|
AudioEffectModulatedDelay modchorus; |
|
|
|
AudioSynthWaveform modulator; |
|
|
|
AudioSynthWaveform modulator; |
|
|
|
|
|
|
|
AudioMixer4 chorus_mixer; |
|
|
|
|
|
|
|
AudioMixer4 delay_mixer; |
|
|
|
AudioMixer4 delay_fb_mixer; |
|
|
|
AudioMixer4 delay_fb_mixer; |
|
|
|
AudioMixer4 master_mixer_r; |
|
|
|
AudioMixer4 master_mixer_r; |
|
|
|
AudioMixer4 master_mixer_l; |
|
|
|
AudioMixer4 master_mixer_l; |
|
|
@ -57,83 +59,87 @@ AudioOutputUSB usb1; |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
AudioEffectStereoMono stereomono1; |
|
|
|
AudioEffectStereoMono stereomono1; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
uint8_t nDynamic = 0; |
|
|
|
|
|
|
|
#ifdef USE_REVERB |
|
|
|
|
|
|
|
AudioConnection * dynamicConnections[NUM_DEXED * 7]; |
|
|
|
|
|
|
|
#else |
|
|
|
|
|
|
|
AudioConnection * dynamicConnections[NUM_DEXED * 6]; |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
void create_audio_connections(AudioSourceMicroDexed &d, uint8_t instance_id) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
dynamicConnections[nDynamic++] = new AudioConnection(d, peak1); |
|
|
|
|
|
|
|
#if defined(USE_REVERB) |
|
|
|
|
|
|
|
dynamicConnections[nDynamic++] = new AudioConnection(d, 0, reverb_mixer, instance_id); |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
dynamicConnections[nDynamic++] = new AudioConnection(d, 0, delay_mixer, instance_id); |
|
|
|
|
|
|
|
dynamicConnections[nDynamic++] = new AudioConnection(d, 0, chorus_mixer, instance_id); |
|
|
|
|
|
|
|
dynamicConnections[nDynamic++] = new AudioConnection(d, 0 , master_mixer_r, 0); |
|
|
|
|
|
|
|
dynamicConnections[nDynamic++] = new AudioConnection(d, 0 , master_mixer_l, 0); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Audio connections
|
|
|
|
// Audio connections
|
|
|
|
AudioConnection patchCord1(modulator, 0, modchorus, 1); |
|
|
|
AudioConnection patchCord1(modulator, 0, modchorus, 1); |
|
|
|
|
|
|
|
AudioConnection patchCord2(chorus_mixer, 0, modchorus, 0); |
|
|
|
|
|
|
|
AudioConnection patchCord3(delay_mixer, 0, delay_fb_mixer, 0); |
|
|
|
|
|
|
|
AudioConnection patchCord4(delay_fb_mixer, delay1); |
|
|
|
|
|
|
|
AudioConnection patchCord5(delay1, 0, delay_fb_mixer, 1); |
|
|
|
|
|
|
|
AudioConnection patchCord6(delay_mixer, 0, master_mixer_r, 2); |
|
|
|
|
|
|
|
AudioConnection patchCord7(delay_mixer, 0, master_mixer_l, 2); |
|
|
|
|
|
|
|
AudioConnection patchCord8(master_mixer_r, volume_r); |
|
|
|
|
|
|
|
AudioConnection patchCord9(master_mixer_l, volume_l); |
|
|
|
|
|
|
|
AudioConnection patchCord10(volume_r, 0, stereomono1, 0); |
|
|
|
|
|
|
|
AudioConnection patchCord11(volume_l, 0, stereomono1, 1); |
|
|
|
#if MOD_FILTER_OUTPUT != MOD_NO_FILTER_OUTPUT |
|
|
|
#if MOD_FILTER_OUTPUT != MOD_NO_FILTER_OUTPUT |
|
|
|
AudioFilterBiquad modchorus_filter; |
|
|
|
AudioFilterBiquad modchorus_filter; |
|
|
|
AudioConnection patchCord2(modchorus, modchorus_filter); |
|
|
|
AudioConnection patchCord12(modchorus, modchorus_filter); |
|
|
|
AudioConnection patchCord3(modchorus_filter, 0, master_mixer_r, 3); |
|
|
|
AudioConnection patchCord13(modchorus_filter, 0, master_mixer_r, 3); |
|
|
|
AudioConnection patchCord4(modchorus_filter, modchorus_inverter); |
|
|
|
AudioConnection patchCord14(modchorus_filter, modchorus_inverter); |
|
|
|
AudioConnection patchCord5(modchorus_inverter, 0, master_mixer_l, 3); |
|
|
|
AudioConnection patchCord15(modchorus_inverter, 0, master_mixer_l, 3); |
|
|
|
#else |
|
|
|
#else |
|
|
|
AudioConnection patchCord6(modchorus, 0, master_mixer_r, 3); |
|
|
|
AudioConnection patchCord16(modchorus, 0, master_mixer_r, 3); |
|
|
|
AudioConnection patchCord7(modchorus, modchorus_inverter); |
|
|
|
AudioConnection patchCord17(modchorus, modchorus_inverter); |
|
|
|
AudioConnection patchCord8(modchorus_inverter, 0, master_mixer_l, 3); |
|
|
|
AudioConnection patchCord18(modchorus_inverter, 0, master_mixer_l, 3); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
#if defined(USE_REVERB) |
|
|
|
#if defined(USE_REVERB) |
|
|
|
|
|
|
|
AudioMixer4 reverb_mixer; |
|
|
|
AudioEffectFreeverbStereo freeverbs1; |
|
|
|
AudioEffectFreeverbStereo freeverbs1; |
|
|
|
AudioConnection patchCord9(freeverbs1, 0, master_mixer_r, 1); |
|
|
|
AudioConnection patchCord19(reverb_mixer, 0, freeverbs1, 0); |
|
|
|
AudioConnection patchCord10(freeverbs1, 1, master_mixer_l, 1); |
|
|
|
AudioConnection patchCord20(freeverbs1, 0, master_mixer_r, 1); |
|
|
|
|
|
|
|
AudioConnection patchCord21(freeverbs1, 1, master_mixer_l, 1); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
AudioConnection patchCord11(delay_fb_mixer, delay1); |
|
|
|
|
|
|
|
AudioConnection patchCord12(delay1, 0, delay_fb_mixer, 1); |
|
|
|
|
|
|
|
AudioConnection patchCord13(delay1, 0, master_mixer_r, 2); |
|
|
|
|
|
|
|
AudioConnection patchCord14(delay1, 0, master_mixer_l, 2); |
|
|
|
|
|
|
|
AudioConnection patchCord15(master_mixer_r, volume_r); |
|
|
|
|
|
|
|
AudioConnection patchCord16(master_mixer_l, volume_l); |
|
|
|
|
|
|
|
AudioConnection patchCord17(volume_r, 0, stereomono1, 0); |
|
|
|
|
|
|
|
AudioConnection patchCord18(volume_l, 0, stereomono1, 1); |
|
|
|
|
|
|
|
#ifdef AUDIO_DEVICE_USB |
|
|
|
#ifdef AUDIO_DEVICE_USB |
|
|
|
AudioConnection patchCord19(stereomono1, 0, usb1, 0); |
|
|
|
AudioConnection patchCord22(stereomono1, 0, usb1, 0); |
|
|
|
AudioConnection patchCord20(stereomono1, 1, usb1, 1); |
|
|
|
AudioConnection patchCord23(stereomono1, 1, usb1, 1); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
#if defined(TEENSY_AUDIO_BOARD) |
|
|
|
#if defined(TEENSY_AUDIO_BOARD) |
|
|
|
AudioOutputI2S i2s1; |
|
|
|
AudioOutputI2S i2s1; |
|
|
|
AudioConnection patchCord21(stereomono1, 0, i2s1, 0); |
|
|
|
AudioConnection patchCord24(stereomono1, 0, i2s1, 0); |
|
|
|
AudioConnection patchCord22(stereomono1, 1, i2s1, 1); |
|
|
|
AudioConnection patchCord25(stereomono1, 1, i2s1, 1); |
|
|
|
AudioControlSGTL5000 sgtl5000_1; |
|
|
|
AudioControlSGTL5000 sgtl5000_1; |
|
|
|
#elif defined (I2S_AUDIO_ONLY) |
|
|
|
#elif defined (I2S_AUDIO_ONLY) |
|
|
|
AudioOutputI2S i2s1; |
|
|
|
AudioOutputI2S i2s1; |
|
|
|
AudioConnection patchCord23(stereomono1, 0, i2s1, 0); |
|
|
|
AudioConnection patchCord26(stereomono1, 0, i2s1, 0); |
|
|
|
AudioConnection patchCord24(stereomono1, 1, i2s1, 1); |
|
|
|
AudioConnection patchCord27(stereomono1, 1, i2s1, 1); |
|
|
|
#elif defined(TGA_AUDIO_BOARD) |
|
|
|
#elif defined(TGA_AUDIO_BOARD) |
|
|
|
AudioOutputI2S i2s1; |
|
|
|
AudioOutputI2S i2s1; |
|
|
|
AudioConnection patchCord25(stereomono1, 0, i2s1, 0); |
|
|
|
AudioConnection patchCord28(stereomono1, 0, i2s1, 0); |
|
|
|
AudioConnection patchCord26(stereomono1, 1, i2s1, 1); |
|
|
|
AudioConnection patchCord29(stereomono1, 1, i2s1, 1); |
|
|
|
AudioControlWM8731master wm8731_1; |
|
|
|
AudioControlWM8731master wm8731_1; |
|
|
|
#elif defined(PT8211_AUDIO) |
|
|
|
#elif defined(PT8211_AUDIO) |
|
|
|
AudioOutputPT8211 pt8211_1; |
|
|
|
AudioOutputPT8211 pt8211_1; |
|
|
|
AudioConnection patchCord27(stereomono1, 0, pt8211_1, 0); |
|
|
|
AudioConnection patchCord30(stereomono1, 0, pt8211_1, 0); |
|
|
|
AudioConnection patchCord28(stereomono1, 1, pt8211_1, 1); |
|
|
|
AudioConnection patchCord31(stereomono1, 1, pt8211_1, 1); |
|
|
|
#elif defined(TEENSY_DAC_SYMMETRIC) |
|
|
|
#elif defined(TEENSY_DAC_SYMMETRIC) |
|
|
|
AudioOutputAnalogStereo dacOut; |
|
|
|
AudioOutputAnalogStereo dacOut; |
|
|
|
AudioMixer4 invMixer; |
|
|
|
AudioMixer4 invMixer; |
|
|
|
AudioConnection patchCord29(stereomono1, 0, dacOut , 0); |
|
|
|
AudioConnection patchCord32(stereomono1, 0, dacOut , 0); |
|
|
|
AudioConnection patchCord30(stereomono1, 1, invMixer, 0); |
|
|
|
AudioConnection patchCord33(stereomono1, 1, invMixer, 0); |
|
|
|
AudioConnection patchCord31(invMixer, 0, dacOut , 1); |
|
|
|
AudioConnection patchCord34(invMixer, 0, dacOut , 1); |
|
|
|
#else |
|
|
|
#else |
|
|
|
AudioOutputAnalogStereo dacOut; |
|
|
|
AudioOutputAnalogStereo dacOut; |
|
|
|
AudioConnection patchCord32(stereomono1, 0, dacOut, 0); |
|
|
|
AudioConnection patchCord35(stereomono1, 0, dacOut, 0); |
|
|
|
AudioConnection patchCord33(stereomono1, 1, dacOut, 1); |
|
|
|
AudioConnection patchCord36(stereomono1, 1, dacOut, 1); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
#ifdef USE_REVERB |
|
|
|
|
|
|
|
AudioConnection * dynamicConnections[NUM_DEXED * 6]; |
|
|
|
|
|
|
|
#else |
|
|
|
|
|
|
|
AudioConnection * dynamicConnections[NUM_DEXED * 5]; |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
int nDynamic = 0; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void create_audio_connections(AudioSourceMicroDexed &d) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
dynamicConnections[nDynamic++] = new AudioConnection(d, peak1); |
|
|
|
|
|
|
|
dynamicConnections[nDynamic++] = new AudioConnection(d, 0, delay_fb_mixer, 0); |
|
|
|
|
|
|
|
dynamicConnections[nDynamic++] = new AudioConnection(d, 0, modchorus, 0); |
|
|
|
|
|
|
|
dynamicConnections[nDynamic++] = new AudioConnection(d, 0 , master_mixer_r, 0); |
|
|
|
|
|
|
|
dynamicConnections[nDynamic++] = new AudioConnection(d, 0 , master_mixer_l, 0); |
|
|
|
|
|
|
|
#if defined(USE_REVERB) |
|
|
|
|
|
|
|
dynamicConnections[nDynamic++] = new AudioConnection(d, 0, freeverbs1, 0); |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool sd_card_available = false; |
|
|
|
bool sd_card_available = false; |
|
|
|
uint8_t max_loaded_banks = 0; |
|
|
|
uint8_t max_loaded_banks = 0; |
|
|
@ -217,7 +223,7 @@ void setup() |
|
|
|
Serial.print(F("Creating MicroDexed instance ")); |
|
|
|
Serial.print(F("Creating MicroDexed instance ")); |
|
|
|
Serial.print(i, DEC); |
|
|
|
Serial.print(i, DEC); |
|
|
|
MicroDexed[i] = new AudioSourceMicroDexed(SAMPLE_RATE); |
|
|
|
MicroDexed[i] = new AudioSourceMicroDexed(SAMPLE_RATE); |
|
|
|
//create_audio_connections(*MicroDexed[i]);
|
|
|
|
create_audio_connections(*MicroDexed[i], i); |
|
|
|
Serial.println(F("... created")); |
|
|
|
Serial.println(F("... created")); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -350,28 +356,30 @@ void setup() |
|
|
|
|
|
|
|
|
|
|
|
#ifdef USE_REVERB |
|
|
|
#ifdef USE_REVERB |
|
|
|
// INIT REVERB
|
|
|
|
// INIT REVERB
|
|
|
|
|
|
|
|
for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) |
|
|
|
|
|
|
|
reverb_mixer.gain(instance_id, 0.0); |
|
|
|
|
|
|
|
master_mixer_r.gain(REVERB, 1.0); |
|
|
|
|
|
|
|
master_mixer_l.gain(REVERB, 1.0); |
|
|
|
freeverbs1.roomsize(mapfloat(configuration.reverb_roomsize, REVERB_ROOMSIZE_MIN, REVERB_ROOMSIZE_MAX, 0.0, 1.0)); |
|
|
|
freeverbs1.roomsize(mapfloat(configuration.reverb_roomsize, REVERB_ROOMSIZE_MIN, REVERB_ROOMSIZE_MAX, 0.0, 1.0)); |
|
|
|
freeverbs1.damping(mapfloat(configuration.reverb_damping, REVERB_DAMPING_MIN, REVERB_DAMPING_MAX, 0.0, 1.0)); |
|
|
|
freeverbs1.damping(mapfloat(configuration.reverb_damping, REVERB_DAMPING_MIN, REVERB_DAMPING_MAX, 0.0, 1.0)); |
|
|
|
for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
master_mixer_r.gain(REVERB, mapfloat(configuration.dexed[instance_id].reverb_level, REVERB_LEVEL_MIN, REVERB_LEVEL_MAX, 0.0, 1.0)); |
|
|
|
|
|
|
|
master_mixer_l.gain(REVERB, mapfloat(configuration.dexed[instance_id].reverb_level, REVERB_LEVEL_MIN, REVERB_LEVEL_MAX, 0.0, 1.0)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
// INIT DELAY
|
|
|
|
// INIT DELAY
|
|
|
|
|
|
|
|
for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) |
|
|
|
|
|
|
|
delay_mixer.gain(instance_id, 0.0); |
|
|
|
|
|
|
|
master_mixer_r.gain(DELAY, 1.0); |
|
|
|
|
|
|
|
master_mixer_l.gain(DELAY, 1.0); |
|
|
|
delay1.delay(0, mapfloat(configuration.delay_time, DELAY_TIME_MIN, DELAY_TIME_MAX, 0.0, float(DELAY_TIME_MAX))); |
|
|
|
delay1.delay(0, mapfloat(configuration.delay_time, DELAY_TIME_MIN, DELAY_TIME_MAX, 0.0, float(DELAY_TIME_MAX))); |
|
|
|
// delay_fb_mixer is the feedback-adding mixer
|
|
|
|
// delay_fb_mixer is the feedback-adding mixer
|
|
|
|
//delay_fb_mixer.gain(0, 1.0 - (mapfloat(configuration.delay_feedback, DELAY_FEEDBACK_MIN, DELAY_FEEDBACK_MAX, 0.0, 1.0))); // original signal
|
|
|
|
//delay_fb_mixer.gain(0, 1.0 - (mapfloat(configuration.delay_feedback, DELAY_FEEDBACK_MIN, DELAY_FEEDBACK_MAX, 0.0, 1.0))); // original signal
|
|
|
|
delay_fb_mixer.gain(0, 1.0); // original signal
|
|
|
|
delay_fb_mixer.gain(0, 1.0); // original signal
|
|
|
|
delay_fb_mixer.gain(1, mapfloat(configuration.delay_feedback, DELAY_FEEDBACK_MIN, DELAY_FEEDBACK_MAX, 0.0, 1.0)); // amount of feedback
|
|
|
|
delay_fb_mixer.gain(1, mapfloat(configuration.delay_feedback, DELAY_FEEDBACK_MIN, DELAY_FEEDBACK_MAX, 0.0, 1.0)); // amount of feedback
|
|
|
|
for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
master_mixer_r.gain(DELAY, mapfloat(configuration.dexed[instance_id].delay_level, DELAY_LEVEL_MIN, DELAY_LEVEL_MAX, 0.0, 1.0)); |
|
|
|
|
|
|
|
master_mixer_l.gain(DELAY, mapfloat(configuration.dexed[instance_id].delay_level, DELAY_LEVEL_MIN, DELAY_LEVEL_MAX, 0.0, 1.0)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// INIT CHORUS
|
|
|
|
// INIT CHORUS
|
|
|
|
|
|
|
|
for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) |
|
|
|
|
|
|
|
chorus_mixer.gain(instance_id, 0.0); |
|
|
|
|
|
|
|
master_mixer_r.gain(CHORUS, 1.0); |
|
|
|
|
|
|
|
master_mixer_l.gain(CHORUS, 1.0); |
|
|
|
switch (configuration.chorus_waveform) |
|
|
|
switch (configuration.chorus_waveform) |
|
|
|
{ |
|
|
|
{ |
|
|
|
case 0: |
|
|
|
case 0: |
|
|
@ -402,9 +410,6 @@ void setup() |
|
|
|
modchorus_inverter.gain(1.0); // mono mode
|
|
|
|
modchorus_inverter.gain(1.0); // mono mode
|
|
|
|
for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) |
|
|
|
for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) |
|
|
|
{ |
|
|
|
{ |
|
|
|
master_mixer_r.gain(CHORUS, mapfloat(configuration.dexed[instance_id].chorus_level, CHORUS_LEVEL_MIN, CHORUS_LEVEL_MAX, 0.0, 1.0)); |
|
|
|
|
|
|
|
master_mixer_l.gain(CHORUS, mapfloat(configuration.dexed[instance_id].chorus_level, CHORUS_LEVEL_MIN, CHORUS_LEVEL_MAX, 0.0, 1.0)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
soften_filter_res[instance_id].init(configuration.dexed[instance_id].filter_resonance); |
|
|
|
soften_filter_res[instance_id].init(configuration.dexed[instance_id].filter_resonance); |
|
|
|
soften_filter_cut[instance_id].init(configuration.dexed[instance_id].filter_cutoff); |
|
|
|
soften_filter_cut[instance_id].init(configuration.dexed[instance_id].filter_cutoff); |
|
|
|
MicroDexed[instance_id]->fx.Gain = mapfloat(configuration.dexed[instance_id].loudness, LOUDNESS_MIN, LOUDNESS_MAX, 0.0, 1.0); |
|
|
|
MicroDexed[instance_id]->fx.Gain = mapfloat(configuration.dexed[instance_id].loudness, LOUDNESS_MIN, LOUDNESS_MAX, 0.0, 1.0); |
|
|
@ -414,10 +419,7 @@ void setup() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// set initial volume and pan (read from EEPROM)
|
|
|
|
// set initial volume and pan (read from EEPROM)
|
|
|
|
for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) |
|
|
|
set_volume(configuration.vol, configuration.pan, configuration.mono); |
|
|
|
{ |
|
|
|
|
|
|
|
set_volume(configuration.vol, configuration.dexed[instance_id].pan, configuration.mono); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
soften_volume.init(configuration.vol); |
|
|
|
soften_volume.init(configuration.vol); |
|
|
|
|
|
|
|
|
|
|
|
#if defined (DEBUG) && defined (SHOW_CPU_LOAD_MSEC) |
|
|
|
#if defined (DEBUG) && defined (SHOW_CPU_LOAD_MSEC) |
|
|
@ -556,10 +558,8 @@ void loop() |
|
|
|
} |
|
|
|
} |
|
|
|
if (soften_volume.running()) |
|
|
|
if (soften_volume.running()) |
|
|
|
{ |
|
|
|
{ |
|
|
|
for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) |
|
|
|
set_volume(soften_volume.value(), configuration.pan, configuration.mono); |
|
|
|
{ |
|
|
|
|
|
|
|
set_volume(soften_volume.value(), configuration.dexed[instance_id].pan, configuration.mono); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
#ifdef DEBUG |
|
|
|
#ifdef DEBUG |
|
|
|
Serial.print(F("Volume: ")); |
|
|
|
Serial.print(F("Volume: ")); |
|
|
|
Serial.print(configuration.vol, DEC); |
|
|
|
Serial.print(configuration.vol, DEC); |
|
|
@ -650,8 +650,8 @@ void handleControlChange(byte inChannel, byte inCtrl, byte inValue) |
|
|
|
soften_volume.update(configuration.vol, SOFTEN_VALUE_CHANGE_STEPS); |
|
|
|
soften_volume.update(configuration.vol, SOFTEN_VALUE_CHANGE_STEPS); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 10: // Pan
|
|
|
|
case 10: // Pan
|
|
|
|
configuration.dexed[instance_id].pan = map(inValue, 0, 0x7f, PANORAMA_MIN, PANORAMA_MAX); |
|
|
|
configuration.pan = map(inValue, 0, 0x7f, PANORAMA_MIN, PANORAMA_MAX); |
|
|
|
set_volume(configuration.vol, configuration.dexed[instance_id].pan, configuration.mono); |
|
|
|
set_volume(configuration.vol, configuration.pan, configuration.mono); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 32: // BankSelect LSB
|
|
|
|
case 32: // BankSelect LSB
|
|
|
|
configuration.dexed[instance_id].bank = inValue; |
|
|
|
configuration.dexed[instance_id].bank = inValue; |
|
|
@ -684,9 +684,9 @@ void handleControlChange(byte inChannel, byte inCtrl, byte inValue) |
|
|
|
delay_fb_mixer.gain(0, 1.0 - configuration.delay_feedback / 100.0); // original signalbreak;
|
|
|
|
delay_fb_mixer.gain(0, 1.0 - configuration.delay_feedback / 100.0); // original signalbreak;
|
|
|
|
break; |
|
|
|
break; |
|
|
|
case 107: // CC 107: delay volume
|
|
|
|
case 107: // CC 107: delay volume
|
|
|
|
configuration.dexed[instance_id].delay_level = map(inValue, 0, 0x7f, DELAY_LEVEL_MIN, DELAY_LEVEL_MAX); |
|
|
|
configuration.dexed[instance_id].delay_send = map(inValue, 0, 0x7f, DELAY_SEND_MIN, DELAY_SEND_MAX); |
|
|
|
master_mixer_r.gain(DELAY, configuration.dexed[instance_id].delay_level / 100.0); |
|
|
|
master_mixer_r.gain(DELAY, configuration.dexed[instance_id].delay_send / 100.0); |
|
|
|
master_mixer_l.gain(2, configuration.dexed[instance_id].delay_level / 100.0); |
|
|
|
master_mixer_l.gain(2, configuration.dexed[instance_id].delay_send / 100.0); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 120: |
|
|
|
case 120: |
|
|
|
MicroDexed[instance_id]->panic(); |
|
|
|
MicroDexed[instance_id]->panic(); |
|
|
@ -1053,14 +1053,14 @@ void set_volume(uint8_t v, int8_t p, uint8_t m) |
|
|
|
//configuration.dexed[instance_id].pan = p; // TODO: Fixing pan per Dexed
|
|
|
|
//configuration.dexed[instance_id].pan = p; // TODO: Fixing pan per Dexed
|
|
|
|
for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) |
|
|
|
for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) |
|
|
|
{ |
|
|
|
{ |
|
|
|
configuration.dexed[instance_id].pan = p; |
|
|
|
configuration.pan = p; |
|
|
|
} |
|
|
|
} |
|
|
|
configuration.mono = m; |
|
|
|
configuration.mono = m; |
|
|
|
|
|
|
|
|
|
|
|
uint16_t tmp = v / 100.0 * 1023.0 + 0.5; |
|
|
|
uint16_t tmp = v / 100.0 * 1023.0 + 0.5; |
|
|
|
for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) |
|
|
|
for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) |
|
|
|
{ |
|
|
|
{ |
|
|
|
tmp2 = mapfloat(configuration.dexed[instance_id].pan, PANORAMA_MIN, PANORAMA_MAX, 0.0, 1.0); |
|
|
|
tmp2 = mapfloat(configuration.pan, PANORAMA_MIN, PANORAMA_MAX, 0.0, 1.0); |
|
|
|
} |
|
|
|
} |
|
|
|
float tmp3 = (float)(tmp * (tmp + 2)) / (float)(1 << 20); |
|
|
|
float tmp3 = (float)(tmp * (tmp + 2)) / (float)(1 << 20); |
|
|
|
|
|
|
|
|
|
|
@ -1094,26 +1094,20 @@ void set_volume(uint8_t v, int8_t p, uint8_t m) |
|
|
|
stereomono1.stereo(false); |
|
|
|
stereomono1.stereo(false); |
|
|
|
for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) |
|
|
|
for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) |
|
|
|
{ |
|
|
|
{ |
|
|
|
configuration.dexed[instance_id].pan = 0.5; |
|
|
|
configuration.pan = 0.5; |
|
|
|
} |
|
|
|
} |
|
|
|
modchorus_inverter.gain(1.0); // stereo mode
|
|
|
|
modchorus_inverter.gain(1.0); // stereo mode
|
|
|
|
break; |
|
|
|
break; |
|
|
|
case 2: // mono right
|
|
|
|
case 2: // mono right
|
|
|
|
volume_l.gain(0.0); |
|
|
|
volume_l.gain(0.0); |
|
|
|
stereomono1.stereo(false); |
|
|
|
stereomono1.stereo(false); |
|
|
|
for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) |
|
|
|
configuration.pan = 0.5; |
|
|
|
{ |
|
|
|
|
|
|
|
configuration.dexed[instance_id].pan = 0.5; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
modchorus_inverter.gain(1.0); // stereo mode
|
|
|
|
modchorus_inverter.gain(1.0); // stereo mode
|
|
|
|
break; |
|
|
|
break; |
|
|
|
case 3: // mono left
|
|
|
|
case 3: // mono left
|
|
|
|
volume_r.gain(0.0); |
|
|
|
volume_r.gain(0.0); |
|
|
|
stereomono1.stereo(false); |
|
|
|
stereomono1.stereo(false); |
|
|
|
for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) |
|
|
|
configuration.pan = 0.5; |
|
|
|
{ |
|
|
|
|
|
|
|
configuration.dexed[instance_id].pan = 0.5; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
modchorus_inverter.gain(1.0); // stereo mode
|
|
|
|
modchorus_inverter.gain(1.0); // stereo mode
|
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
@ -1177,9 +1171,9 @@ void initial_values_from_eeprom(bool init) |
|
|
|
configuration.dexed[instance_id].bank %= MAX_BANKS; |
|
|
|
configuration.dexed[instance_id].bank %= MAX_BANKS; |
|
|
|
configuration.dexed[instance_id].voice %= MAX_VOICES; |
|
|
|
configuration.dexed[instance_id].voice %= MAX_VOICES; |
|
|
|
configuration.dexed[instance_id].pan %= PANORAMA_MAX; |
|
|
|
configuration.dexed[instance_id].pan %= PANORAMA_MAX; |
|
|
|
configuration.dexed[instance_id].reverb_level %= REVERB_LEVEL_MAX; |
|
|
|
configuration.dexed[instance_id].reverb_send %= REVERB_SEND_MAX; |
|
|
|
configuration.dexed[instance_id].chorus_level %= CHORUS_LEVEL_MAX; |
|
|
|
configuration.dexed[instance_id].chorus_send %= CHORUS_SEND_MAX; |
|
|
|
configuration.dexed[instance_id].delay_level %= DELAY_LEVEL_MAX; |
|
|
|
configuration.dexed[instance_id].delay_send %= DELAY_SEND_MAX; |
|
|
|
configuration.dexed[instance_id].filter_cutoff %= FILTER_CUTOFF_MAX; |
|
|
|
configuration.dexed[instance_id].filter_cutoff %= FILTER_CUTOFF_MAX; |
|
|
|
configuration.dexed[instance_id].filter_resonance %= FILTER_RESONANCE_MAX; |
|
|
|
configuration.dexed[instance_id].filter_resonance %= FILTER_RESONANCE_MAX; |
|
|
|
configuration.dexed[instance_id].loudness %= LOUDNESS_MAX; |
|
|
|
configuration.dexed[instance_id].loudness %= LOUDNESS_MAX; |
|
|
@ -1231,6 +1225,7 @@ void init_configuration(void) |
|
|
|
configuration.instance_mode = INSTANCE_MODE_DEFAULT; |
|
|
|
configuration.instance_mode = INSTANCE_MODE_DEFAULT; |
|
|
|
configuration.instance_splitpoint = INSTANCE_SPLITPOINT_DEFAULT; |
|
|
|
configuration.instance_splitpoint = INSTANCE_SPLITPOINT_DEFAULT; |
|
|
|
configuration.vol = VOLUME_DEFAULT; |
|
|
|
configuration.vol = VOLUME_DEFAULT; |
|
|
|
|
|
|
|
configuration.pan = PANORAMA_DEFAULT; |
|
|
|
configuration.mono = MONO_DEFAULT; |
|
|
|
configuration.mono = MONO_DEFAULT; |
|
|
|
configuration.reverb_roomsize = REVERB_ROOMSIZE_DEFAULT; |
|
|
|
configuration.reverb_roomsize = REVERB_ROOMSIZE_DEFAULT; |
|
|
|
configuration.reverb_damping = REVERB_DAMPING_DEFAULT; |
|
|
|
configuration.reverb_damping = REVERB_DAMPING_DEFAULT; |
|
|
@ -1244,10 +1239,9 @@ void init_configuration(void) |
|
|
|
configuration.dexed[instance_id].midi_channel = DEFAULT_MIDI_CHANNEL; |
|
|
|
configuration.dexed[instance_id].midi_channel = DEFAULT_MIDI_CHANNEL; |
|
|
|
configuration.dexed[instance_id].bank = SYSEXBANK_DEFAULT; |
|
|
|
configuration.dexed[instance_id].bank = SYSEXBANK_DEFAULT; |
|
|
|
configuration.dexed[instance_id].voice = SYSEXSOUND_DEFAULT; |
|
|
|
configuration.dexed[instance_id].voice = SYSEXSOUND_DEFAULT; |
|
|
|
configuration.dexed[instance_id].pan = PANORAMA_DEFAULT; |
|
|
|
configuration.dexed[instance_id].reverb_send = REVERB_SEND_DEFAULT; |
|
|
|
configuration.dexed[instance_id].reverb_level = REVERB_LEVEL_DEFAULT; |
|
|
|
configuration.dexed[instance_id].chorus_send = CHORUS_SEND_DEFAULT; |
|
|
|
configuration.dexed[instance_id].chorus_level = CHORUS_LEVEL_DEFAULT; |
|
|
|
configuration.dexed[instance_id].delay_send = DELAY_SEND_DEFAULT; |
|
|
|
configuration.dexed[instance_id].delay_level = DELAY_LEVEL_DEFAULT; |
|
|
|
|
|
|
|
configuration.dexed[instance_id].filter_cutoff = FILTER_CUTOFF_DEFAULT; |
|
|
|
configuration.dexed[instance_id].filter_cutoff = FILTER_CUTOFF_DEFAULT; |
|
|
|
configuration.dexed[instance_id].filter_resonance = FILTER_RESONANCE_DEFAULT; |
|
|
|
configuration.dexed[instance_id].filter_resonance = FILTER_RESONANCE_DEFAULT; |
|
|
|
configuration.dexed[instance_id].loudness = LOUDNESS_DEFAULT; |
|
|
|
configuration.dexed[instance_id].loudness = LOUDNESS_DEFAULT; |
|
|
@ -1360,6 +1354,7 @@ void show_configuration(void) |
|
|
|
Serial.print(F("Instance Mode ")); Serial.println(configuration.instance_mode, DEC); |
|
|
|
Serial.print(F("Instance Mode ")); Serial.println(configuration.instance_mode, DEC); |
|
|
|
Serial.print(F("Instance Splitpoint ")); Serial.println(configuration.instance_splitpoint, DEC); |
|
|
|
Serial.print(F("Instance Splitpoint ")); Serial.println(configuration.instance_splitpoint, DEC); |
|
|
|
Serial.print(F("Volume ")); Serial.println(configuration.vol, DEC); |
|
|
|
Serial.print(F("Volume ")); Serial.println(configuration.vol, DEC); |
|
|
|
|
|
|
|
Serial.print(F("Panorama ")); Serial.println(configuration.pan, DEC); |
|
|
|
Serial.print(F("Mono ")); Serial.println(configuration.mono, DEC); |
|
|
|
Serial.print(F("Mono ")); Serial.println(configuration.mono, DEC); |
|
|
|
Serial.print(F("Reverb Roomsize ")); Serial.println(configuration.reverb_roomsize, DEC); |
|
|
|
Serial.print(F("Reverb Roomsize ")); Serial.println(configuration.reverb_roomsize, DEC); |
|
|
|
Serial.print(F("Reverb Damping ")); Serial.println(configuration.reverb_damping, DEC); |
|
|
|
Serial.print(F("Reverb Damping ")); Serial.println(configuration.reverb_damping, DEC); |
|
|
@ -1377,10 +1372,9 @@ void show_configuration(void) |
|
|
|
Serial.print(F(" MIDI-Channel ")); Serial.println(configuration.dexed[instance_id].midi_channel, DEC); |
|
|
|
Serial.print(F(" MIDI-Channel ")); Serial.println(configuration.dexed[instance_id].midi_channel, DEC); |
|
|
|
Serial.print(F(" Bank ")); Serial.println(configuration.dexed[instance_id].bank, DEC); |
|
|
|
Serial.print(F(" Bank ")); Serial.println(configuration.dexed[instance_id].bank, DEC); |
|
|
|
Serial.print(F(" Voice ")); Serial.println(configuration.dexed[instance_id].voice, DEC); |
|
|
|
Serial.print(F(" Voice ")); Serial.println(configuration.dexed[instance_id].voice, DEC); |
|
|
|
Serial.print(F(" Panorama ")); Serial.println(configuration.dexed[instance_id].pan, DEC); |
|
|
|
Serial.print(F(" Reverb Send ")); Serial.println(configuration.dexed[instance_id].reverb_send, DEC); |
|
|
|
Serial.print(F(" Reverb Level ")); Serial.println(configuration.dexed[instance_id].reverb_level, DEC); |
|
|
|
Serial.print(F(" Chorus Send ")); Serial.println(configuration.dexed[instance_id].chorus_send, DEC); |
|
|
|
Serial.print(F(" Chorus Level ")); Serial.println(configuration.dexed[instance_id].chorus_level, DEC); |
|
|
|
Serial.print(F(" Delay Send ")); Serial.println(configuration.dexed[instance_id].delay_send, DEC); |
|
|
|
Serial.print(F(" Delay Level ")); Serial.println(configuration.dexed[instance_id].delay_level, DEC); |
|
|
|
|
|
|
|
Serial.print(F(" Filter Cutoff ")); Serial.println(configuration.dexed[instance_id].filter_cutoff, 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(" Filter Resonance ")); Serial.println(configuration.dexed[instance_id].filter_resonance, DEC); |
|
|
|
Serial.print(F(" Loudness ")); Serial.println(configuration.dexed[instance_id].loudness, DEC); |
|
|
|
Serial.print(F(" Loudness ")); Serial.println(configuration.dexed[instance_id].loudness, DEC); |
|
|
|