|
|
@ -49,6 +49,8 @@ Bounce but[2] = {Bounce(BUT_L_PIN, BUT_DEBOUNCE_MS), Bounce(BUT_R_PIN, BUT_DEBOU |
|
|
|
elapsedMillis master_timer; |
|
|
|
elapsedMillis master_timer; |
|
|
|
uint8_t ui_state = UI_MAIN; |
|
|
|
uint8_t ui_state = UI_MAIN; |
|
|
|
uint8_t ui_main_state = UI_MAIN_VOICE; |
|
|
|
uint8_t ui_main_state = UI_MAIN_VOICE; |
|
|
|
|
|
|
|
#else |
|
|
|
|
|
|
|
float mapfloat(float val, float in_min, float in_max, float out_min, float out_max); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
AudioPlayQueue queue1; |
|
|
|
AudioPlayQueue queue1; |
|
|
@ -407,8 +409,9 @@ void loop() |
|
|
|
if (master_timer >= TIMER_UI_HANDLING_MS) |
|
|
|
if (master_timer >= TIMER_UI_HANDLING_MS) |
|
|
|
{ |
|
|
|
{ |
|
|
|
master_timer -= TIMER_UI_HANDLING_MS; |
|
|
|
master_timer -= TIMER_UI_HANDLING_MS; |
|
|
|
|
|
|
|
#ifdef I2C_DISPLAY |
|
|
|
handle_ui(); |
|
|
|
handle_ui(); |
|
|
|
|
|
|
|
#endif |
|
|
|
} |
|
|
|
} |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
@ -456,7 +459,9 @@ void handleControlChange(byte inChannel, byte inCtrl, byte inValue) |
|
|
|
if (inValue < MAX_BANKS) |
|
|
|
if (inValue < MAX_BANKS) |
|
|
|
{ |
|
|
|
{ |
|
|
|
configuration.bank = inValue; |
|
|
|
configuration.bank = inValue; |
|
|
|
|
|
|
|
#ifdef I2C_DISPLAY |
|
|
|
handle_ui(); |
|
|
|
handle_ui(); |
|
|
|
|
|
|
|
#endif |
|
|
|
} |
|
|
|
} |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 1: |
|
|
|
case 1: |
|
|
@ -496,27 +501,37 @@ void handleControlChange(byte inChannel, byte inCtrl, byte inValue) |
|
|
|
case 103: // CC 103: filter resonance
|
|
|
|
case 103: // CC 103: filter resonance
|
|
|
|
effect_filter_resonance = map(inValue, 0, 127, 0, ENC_FILTER_RES_STEPS); |
|
|
|
effect_filter_resonance = map(inValue, 0, 127, 0, ENC_FILTER_RES_STEPS); |
|
|
|
dexed->fx.Reso = 1.0 - float(effect_filter_resonance) / ENC_FILTER_RES_STEPS; |
|
|
|
dexed->fx.Reso = 1.0 - float(effect_filter_resonance) / ENC_FILTER_RES_STEPS; |
|
|
|
|
|
|
|
#ifdef I2C_DISPLAY |
|
|
|
handle_ui(); |
|
|
|
handle_ui(); |
|
|
|
|
|
|
|
#endif |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 104: // CC 104: filter cutoff
|
|
|
|
case 104: // CC 104: filter cutoff
|
|
|
|
effect_filter_cutoff = map(inValue, 0, 127, 0, ENC_FILTER_CUT_STEPS); |
|
|
|
effect_filter_cutoff = map(inValue, 0, 127, 0, ENC_FILTER_CUT_STEPS); |
|
|
|
dexed->fx.Cutoff = 1.0 - float(effect_filter_cutoff) / ENC_FILTER_CUT_STEPS; |
|
|
|
dexed->fx.Cutoff = 1.0 - float(effect_filter_cutoff) / ENC_FILTER_CUT_STEPS; |
|
|
|
|
|
|
|
#ifdef I2C_DISPLAY |
|
|
|
handle_ui(); |
|
|
|
handle_ui(); |
|
|
|
|
|
|
|
#endif |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 105: // CC 105: delay time
|
|
|
|
case 105: // CC 105: delay time
|
|
|
|
effect_delay_time = map(inValue, 0, 127, 0, ENC_DELAY_TIME_STEPS); |
|
|
|
effect_delay_time = map(inValue, 0, 127, 0, ENC_DELAY_TIME_STEPS); |
|
|
|
delay1.delay(0, mapfloat(effect_delay_time, 0, ENC_DELAY_TIME_STEPS, 0.0, DELAY_MAX_TIME)); |
|
|
|
delay1.delay(0, mapfloat(effect_delay_time, 0, ENC_DELAY_TIME_STEPS, 0.0, DELAY_MAX_TIME)); |
|
|
|
|
|
|
|
#ifdef I2C_DISPLAY |
|
|
|
handle_ui(); |
|
|
|
handle_ui(); |
|
|
|
|
|
|
|
#endif |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 106: // CC 106: delay feedback
|
|
|
|
case 106: // CC 106: delay feedback
|
|
|
|
effect_delay_feedback = map(inValue, 0, 127, 0, ENC_DELAY_FB_STEPS); |
|
|
|
effect_delay_feedback = map(inValue, 0, 127, 0, ENC_DELAY_FB_STEPS); |
|
|
|
mixer1.gain(1, mapfloat(float(effect_delay_feedback), 0, ENC_DELAY_FB_STEPS, 0.0, 1.0)); |
|
|
|
mixer1.gain(1, mapfloat(float(effect_delay_feedback), 0, ENC_DELAY_FB_STEPS, 0.0, 1.0)); |
|
|
|
|
|
|
|
#ifdef I2C_DISPLAY |
|
|
|
handle_ui(); |
|
|
|
handle_ui(); |
|
|
|
|
|
|
|
#endif |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 107: // CC 107: delay volume
|
|
|
|
case 107: // CC 107: delay volume
|
|
|
|
effect_delay_volume = map(inValue, 0, 127, 0, ENC_DELAY_VOLUME_STEPS); |
|
|
|
effect_delay_volume = map(inValue, 0, 127, 0, ENC_DELAY_VOLUME_STEPS); |
|
|
|
mixer2.gain(1, mapfloat(effect_delay_volume, 0, ENC_DELAY_VOLUME_STEPS, 0.0, 1.0)); // delay tap1 signal (with added feedback)
|
|
|
|
mixer2.gain(1, mapfloat(effect_delay_volume, 0, ENC_DELAY_VOLUME_STEPS, 0.0, 1.0)); // delay tap1 signal (with added feedback)
|
|
|
|
|
|
|
|
#ifdef I2C_DISPLAY |
|
|
|
handle_ui(); |
|
|
|
handle_ui(); |
|
|
|
|
|
|
|
#endif |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 120: |
|
|
|
case 120: |
|
|
|
dexed->panic(); |
|
|
|
dexed->panic(); |
|
|
@ -553,7 +568,9 @@ void handleProgramChange(byte inChannel, byte inProgram) |
|
|
|
if (inProgram < MAX_VOICES) |
|
|
|
if (inProgram < MAX_VOICES) |
|
|
|
{ |
|
|
|
{ |
|
|
|
load_sysex(configuration.bank, inProgram); |
|
|
|
load_sysex(configuration.bank, inProgram); |
|
|
|
|
|
|
|
#ifdef I2C_DISPLAY |
|
|
|
handle_ui(); |
|
|
|
handle_ui(); |
|
|
|
|
|
|
|
#endif |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|