|
|
@ -228,7 +228,7 @@ AudioConnection patchCord[] = { |
|
|
|
uint8_t nDynamic = 0; |
|
|
|
uint8_t nDynamic = 0; |
|
|
|
#if MOD_FILTER_OUTPUT != MOD_NO_FILTER_OUTPUT |
|
|
|
#if MOD_FILTER_OUTPUT != MOD_NO_FILTER_OUTPUT |
|
|
|
AudioConnection* dynamicConnections[NUM_DEXED * 16 + NUM_DRUMS * 4]; |
|
|
|
AudioConnection* dynamicConnections[NUM_DEXED * 16 + NUM_DRUMS * 4]; |
|
|
|
#elif MOD_FILTER_OUTPUT == MOD_NO_FILTER_OUTPUT |
|
|
|
#elif MOD_FILTER_OUTPUT == MOD_NO_FILTER_OUTPUT |
|
|
|
AudioConnection* dynamicConnections[NUM_DEXED * 15 + NUM_DRUMS * 4]; |
|
|
|
AudioConnection* dynamicConnections[NUM_DEXED * 15 + NUM_DRUMS * 4]; |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
FLASHMEM void create_audio_dexed_chain(uint8_t instance_id) { |
|
|
|
FLASHMEM void create_audio_dexed_chain(uint8_t instance_id) { |
|
|
@ -242,7 +242,7 @@ FLASHMEM void create_audio_dexed_chain(uint8_t instance_id) { |
|
|
|
chorus_mixer[instance_id] = new AudioMixer<2>(); |
|
|
|
chorus_mixer[instance_id] = new AudioMixer<2>(); |
|
|
|
delay_fb_mixer[instance_id] = new AudioMixer<2>(); |
|
|
|
delay_fb_mixer[instance_id] = new AudioMixer<2>(); |
|
|
|
#if defined(USE_DELAY_8M) |
|
|
|
#if defined(USE_DELAY_8M) |
|
|
|
delay_fx[instance_id] = new AudioEffectDelayExternal8(DELAY_MAX_TIME); |
|
|
|
delay_fx[instance_id] = new AudioEffectDelayExternal8(3, DELAY_MAX_TIME); |
|
|
|
#else |
|
|
|
#else |
|
|
|
delay_fx[instance_id] = new AudioEffectDelay(); |
|
|
|
delay_fx[instance_id] = new AudioEffectDelay(); |
|
|
|
#endif |
|
|
|
#endif |
|
|
@ -574,6 +574,7 @@ void setup() { |
|
|
|
Serial.println(F("SD card not accessable.")); |
|
|
|
Serial.println(F("SD card not accessable.")); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
|
|
|
|
Serial.println(F("SD card found.")); |
|
|
|
check_and_create_directories(); |
|
|
|
check_and_create_directories(); |
|
|
|
|
|
|
|
|
|
|
|
for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) { |
|
|
|
for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) { |
|
|
@ -982,7 +983,7 @@ void handleNoteOff(byte inChannel, byte inNumber, byte inVelocity) { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// EPiano
|
|
|
|
// EPiano
|
|
|
|
if (configuration.epiano.midi_channel == MIDI_CHANNEL_OMNI || configuration.epiano.midi_channel == inChannel) { |
|
|
|
if (configuration.epiano.midi_channel == MIDI_CHANNEL_OMNI || configuration.epiano.midi_channel == inChannel) { |
|
|
|
if (inNumber >= configuration.epiano.lowest_note && inNumber <= configuration.epiano.highest_note) { |
|
|
|
if (inNumber >= configuration.epiano.lowest_note && inNumber <= configuration.epiano.highest_note) { |
|
|
|
ep.noteOff(inNumber + configuration.epiano.transpose - 24); |
|
|
|
ep.noteOff(inNumber + configuration.epiano.transpose - 24); |
|
|
@ -1004,7 +1005,7 @@ void handleControlChange(byte inChannel, byte inCtrl, byte inValue) { |
|
|
|
inCtrl = constrain(inCtrl, 0, 127); |
|
|
|
inCtrl = constrain(inCtrl, 0, 127); |
|
|
|
inValue = constrain(inValue, 0, 127); |
|
|
|
inValue = constrain(inValue, 0, 127); |
|
|
|
|
|
|
|
|
|
|
|
// EPiano
|
|
|
|
// EPiano
|
|
|
|
if (configuration.epiano.midi_channel == MIDI_CHANNEL_OMNI || configuration.epiano.midi_channel == inChannel) |
|
|
|
if (configuration.epiano.midi_channel == MIDI_CHANNEL_OMNI || configuration.epiano.midi_channel == inChannel) |
|
|
|
ep.processMidiController(inCtrl, inValue); |
|
|
|
ep.processMidiController(inCtrl, inValue); |
|
|
|
|
|
|
|
|
|
|
@ -1569,56 +1570,11 @@ void handleTuneRequest(void) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void handleClock(void) { |
|
|
|
void handleClock(void) { |
|
|
|
if (midi_bpm_counter % 24 == 0) { |
|
|
|
; |
|
|
|
midi_bpm = (60000.0f / float(midi_bpm_timer) + 0.5); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (_midi_bpm > -1 && _midi_bpm != midi_bpm) { |
|
|
|
|
|
|
|
#ifdef DEBUG |
|
|
|
|
|
|
|
Serial.print(F("MIDI Clock: ")); |
|
|
|
|
|
|
|
Serial.print(midi_bpm); |
|
|
|
|
|
|
|
Serial.print(F(" bpm (")); |
|
|
|
|
|
|
|
Serial.print(midi_bpm_timer, DEC); |
|
|
|
|
|
|
|
Serial.println(F("ms per quarter)")); |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
1 1/16 = 6 ticks / 0.0625 |
|
|
|
|
|
|
|
2 1/16T = 9 ticks / 0.09375 |
|
|
|
|
|
|
|
3 1/8 = 12 ticks / 0.125 |
|
|
|
|
|
|
|
4 1/8T = 18 ticks / 0.1875 |
|
|
|
|
|
|
|
5 1/4 = 24 ticks / 0.25 |
|
|
|
|
|
|
|
6 1/4T = 36 ticks / 0.375 |
|
|
|
|
|
|
|
7 1/2 = 48 ticks / 0.5 |
|
|
|
|
|
|
|
8 1/2T = 72 ticks / 0.75 |
|
|
|
|
|
|
|
9 1/1 = 96 ticks / 1.0 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) { |
|
|
|
|
|
|
|
if (configuration.fx.delay_sync[instance_id] > 0) { |
|
|
|
|
|
|
|
uint16_t midi_sync_delay_time = uint16_t(60000.0 * midi_ticks_factor[configuration.fx.delay_sync[instance_id]] / float(midi_bpm) + 0.5); |
|
|
|
|
|
|
|
delay_fx[instance_id]->delay(0, constrain(midi_sync_delay_time, DELAY_TIME_MIN * 10, DELAY_TIME_MAX * 10)); |
|
|
|
|
|
|
|
#ifdef DEBUG |
|
|
|
|
|
|
|
Serial.print(F("Setting Delay-Sync of instance ")); |
|
|
|
|
|
|
|
Serial.print(instance_id); |
|
|
|
|
|
|
|
Serial.print(F(" to ")); |
|
|
|
|
|
|
|
Serial.print(constrain(midi_sync_delay_time, DELAY_TIME_MIN * 10, DELAY_TIME_MAX * 10), DEC); |
|
|
|
|
|
|
|
Serial.println(F(" ms")); |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_midi_bpm = midi_bpm; |
|
|
|
|
|
|
|
midi_bpm_counter = 0; |
|
|
|
|
|
|
|
midi_bpm_timer = 0; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
midi_bpm_counter++; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void handleStart(void) { |
|
|
|
void handleStart(void) { |
|
|
|
midi_bpm_timer = 0; |
|
|
|
; |
|
|
|
midi_bpm_counter = 0; |
|
|
|
|
|
|
|
_midi_bpm = -1; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void handleContinue(void) { |
|
|
|
void handleContinue(void) { |
|
|
@ -1804,11 +1760,9 @@ void check_configuration_fx(void) { |
|
|
|
configuration.fx.chorus_waveform[instance_id] = constrain(configuration.fx.chorus_waveform[instance_id], CHORUS_WAVEFORM_MIN, CHORUS_WAVEFORM_MAX); |
|
|
|
configuration.fx.chorus_waveform[instance_id] = constrain(configuration.fx.chorus_waveform[instance_id], CHORUS_WAVEFORM_MIN, CHORUS_WAVEFORM_MAX); |
|
|
|
configuration.fx.chorus_depth[instance_id] = constrain(configuration.fx.chorus_depth[instance_id], CHORUS_DEPTH_MIN, CHORUS_DEPTH_MAX); |
|
|
|
configuration.fx.chorus_depth[instance_id] = constrain(configuration.fx.chorus_depth[instance_id], CHORUS_DEPTH_MIN, CHORUS_DEPTH_MAX); |
|
|
|
configuration.fx.chorus_level[instance_id] = constrain(configuration.fx.chorus_level[instance_id], CHORUS_LEVEL_MIN, CHORUS_LEVEL_MAX); |
|
|
|
configuration.fx.chorus_level[instance_id] = constrain(configuration.fx.chorus_level[instance_id], CHORUS_LEVEL_MIN, CHORUS_LEVEL_MAX); |
|
|
|
if (configuration.fx.delay_sync[instance_id] == 0) |
|
|
|
configuration.fx.delay_time[instance_id] = constrain(configuration.fx.delay_time[instance_id], DELAY_TIME_MIN, DELAY_TIME_MAX); |
|
|
|
configuration.fx.delay_time[instance_id] = constrain(configuration.fx.delay_time[instance_id], DELAY_TIME_MIN, DELAY_TIME_MAX); |
|
|
|
|
|
|
|
configuration.fx.delay_feedback[instance_id] = constrain(configuration.fx.delay_feedback[instance_id], DELAY_FEEDBACK_MIN, DELAY_FEEDBACK_MAX); |
|
|
|
configuration.fx.delay_feedback[instance_id] = constrain(configuration.fx.delay_feedback[instance_id], DELAY_FEEDBACK_MIN, DELAY_FEEDBACK_MAX); |
|
|
|
configuration.fx.delay_level[instance_id] = constrain(configuration.fx.delay_level[instance_id], DELAY_LEVEL_MIN, DELAY_LEVEL_MAX); |
|
|
|
configuration.fx.delay_level[instance_id] = constrain(configuration.fx.delay_level[instance_id], DELAY_LEVEL_MIN, DELAY_LEVEL_MAX); |
|
|
|
configuration.fx.delay_sync[instance_id] = constrain(configuration.fx.delay_sync[instance_id], DELAY_SYNC_MIN, DELAY_SYNC_MAX); |
|
|
|
|
|
|
|
configuration.fx.reverb_send[instance_id] = constrain(configuration.fx.reverb_send[instance_id], REVERB_SEND_MIN, REVERB_SEND_MAX); |
|
|
|
configuration.fx.reverb_send[instance_id] = constrain(configuration.fx.reverb_send[instance_id], REVERB_SEND_MIN, REVERB_SEND_MAX); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -1968,7 +1922,6 @@ void init_configuration(void) { |
|
|
|
configuration.fx.delay_time[instance_id] = DELAY_TIME_DEFAULT / 10; |
|
|
|
configuration.fx.delay_time[instance_id] = DELAY_TIME_DEFAULT / 10; |
|
|
|
configuration.fx.delay_feedback[instance_id] = DELAY_FEEDBACK_DEFAULT; |
|
|
|
configuration.fx.delay_feedback[instance_id] = DELAY_FEEDBACK_DEFAULT; |
|
|
|
configuration.fx.delay_level[instance_id] = DELAY_LEVEL_DEFAULT; |
|
|
|
configuration.fx.delay_level[instance_id] = DELAY_LEVEL_DEFAULT; |
|
|
|
configuration.fx.delay_sync[instance_id] = DELAY_SYNC_DEFAULT; |
|
|
|
|
|
|
|
configuration.fx.reverb_send[instance_id] = REVERB_SEND_DEFAULT; |
|
|
|
configuration.fx.reverb_send[instance_id] = REVERB_SEND_DEFAULT; |
|
|
|
|
|
|
|
|
|
|
|
MicroDexed[instance_id]->ControllersRefresh(); |
|
|
|
MicroDexed[instance_id]->ControllersRefresh(); |
|
|
@ -2047,12 +2000,8 @@ void set_fx_params(void) { |
|
|
|
delay_fb_mixer[instance_id]->gain(1, midi_volume_transform(map(configuration.fx.delay_feedback[instance_id], DELAY_FEEDBACK_MIN, DELAY_FEEDBACK_MAX, 0, 127))); |
|
|
|
delay_fb_mixer[instance_id]->gain(1, midi_volume_transform(map(configuration.fx.delay_feedback[instance_id], DELAY_FEEDBACK_MIN, DELAY_FEEDBACK_MAX, 0, 127))); |
|
|
|
if (configuration.fx.delay_level[selected_instance_id] <= DELAY_LEVEL_MIN) |
|
|
|
if (configuration.fx.delay_level[selected_instance_id] <= DELAY_LEVEL_MIN) |
|
|
|
delay_fx[instance_id]->disable(0); |
|
|
|
delay_fx[instance_id]->disable(0); |
|
|
|
else if (configuration.fx.delay_sync[instance_id] == 0) |
|
|
|
else |
|
|
|
delay_fx[instance_id]->delay(0, constrain(configuration.fx.delay_time[instance_id], DELAY_TIME_MIN, DELAY_TIME_MAX) * 10); |
|
|
|
delay_fx[instance_id]->delay(0, constrain(configuration.fx.delay_time[instance_id], DELAY_TIME_MIN, DELAY_TIME_MAX) * 10); |
|
|
|
if (configuration.fx.delay_sync[instance_id] > 0) { |
|
|
|
|
|
|
|
uint16_t midi_sync_delay_time = uint16_t(60000.0 * midi_ticks_factor[configuration.fx.delay_sync[instance_id]] / midi_bpm); |
|
|
|
|
|
|
|
delay_fx[instance_id]->delay(0, constrain(midi_sync_delay_time, DELAY_TIME_MIN, DELAY_TIME_MAX * 10)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// REVERB SEND
|
|
|
|
// REVERB SEND
|
|
|
|
reverb_mixer_r.gain(instance_id, volume_transform(mapfloat(configuration.fx.reverb_send[instance_id], REVERB_SEND_MIN, REVERB_SEND_MAX, 0.0, VOL_MAX_FLOAT))); |
|
|
|
reverb_mixer_r.gain(instance_id, volume_transform(mapfloat(configuration.fx.reverb_send[instance_id], REVERB_SEND_MIN, REVERB_SEND_MAX, 0.0, VOL_MAX_FLOAT))); |
|
|
@ -2754,8 +2703,6 @@ void show_configuration(void) { |
|
|
|
Serial.println(configuration.fx.delay_feedback[instance_id], DEC); |
|
|
|
Serial.println(configuration.fx.delay_feedback[instance_id], DEC); |
|
|
|
Serial.print(F(" Delay Level ")); |
|
|
|
Serial.print(F(" Delay Level ")); |
|
|
|
Serial.println(configuration.fx.delay_level[instance_id], DEC); |
|
|
|
Serial.println(configuration.fx.delay_level[instance_id], DEC); |
|
|
|
Serial.print(F(" Delay Sync ")); |
|
|
|
|
|
|
|
Serial.println(configuration.fx.delay_sync[instance_id], DEC); |
|
|
|
|
|
|
|
Serial.print(F(" Reverb Send ")); |
|
|
|
Serial.print(F(" Reverb Send ")); |
|
|
|
Serial.println(configuration.fx.reverb_send[instance_id], DEC); |
|
|
|
Serial.println(configuration.fx.reverb_send[instance_id], DEC); |
|
|
|
Serial.print(F(" Sound Intensity ")); |
|
|
|
Serial.print(F(" Sound Intensity ")); |
|
|
|