Fixing hanging notes when using a controller.

pull/32/head
Holger Wirtz 5 years ago
parent 7e4608b953
commit 148ac0a652
  1. 128
      MicroDexed.ino
  2. 2
      UI.hpp

@ -598,6 +598,11 @@ void handleControlChange(byte inChannel, byte inCtrl, byte inValue)
#endif #endif
configuration.performance.bank[instance_id] = constrain((inValue << 7)&configuration.performance.bank[instance_id], 0, MAX_BANKS - 1); configuration.performance.bank[instance_id] = constrain((inValue << 7)&configuration.performance.bank[instance_id], 0, MAX_BANKS - 1);
load_sd_voice(configuration.performance.bank[instance_id], configuration.performance.voice[instance_id], instance_id); load_sd_voice(configuration.performance.bank[instance_id], configuration.performance.voice[instance_id], instance_id);
if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_voice_select))
{
LCDML.OTHER_updateFunc();
LCDML.loop_menu();
}
break; break;
case 1: case 1:
#ifdef DEBUG #ifdef DEBUG
@ -635,6 +640,11 @@ 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
if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_sound_intensity))
{
LCDML.OTHER_updateFunc();
LCDML.loop_menu();
}
break; break;
case 10: // Pan case 10: // Pan
#ifdef DEBUG #ifdef DEBUG
@ -642,6 +652,11 @@ 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));
if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_panorama))
{
LCDML.OTHER_updateFunc();
LCDML.loop_menu();
}
break; break;
case 32: // BankSelect LSB case 32: // BankSelect LSB
#ifdef DEBUG #ifdef DEBUG
@ -649,6 +664,11 @@ void handleControlChange(byte inChannel, byte inCtrl, byte inValue)
#endif #endif
configuration.performance.bank[instance_id] = constrain(inValue, 0, MAX_BANKS - 1); configuration.performance.bank[instance_id] = constrain(inValue, 0, MAX_BANKS - 1);
load_sd_voice(configuration.performance.bank[instance_id], configuration.performance.voice[instance_id], instance_id); load_sd_voice(configuration.performance.bank[instance_id], configuration.performance.voice[instance_id], instance_id);
if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_voice_select))
{
LCDML.OTHER_updateFunc();
LCDML.loop_menu();
}
break; break;
case 64: case 64:
MicroDexed[instance_id]->setSustain(inValue > 63); MicroDexed[instance_id]->setSustain(inValue > 63);
@ -666,31 +686,61 @@ 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);
if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_portamento_mode))
{
LCDML.OTHER_updateFunc();
LCDML.loop_menu();
}
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);
if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_filter_resonance))
{
LCDML.OTHER_updateFunc();
LCDML.loop_menu();
}
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);
if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_filter_cutoff))
{
LCDML.OTHER_updateFunc();
LCDML.loop_menu();
}
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);
if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_delay_time))
{
LCDML.OTHER_updateFunc();
LCDML.loop_menu();
}
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
if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_delay_feedback))
{
LCDML.OTHER_updateFunc();
LCDML.loop_menu();
}
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));
if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_delay_level))
{
LCDML.OTHER_updateFunc();
LCDML.loop_menu();
}
break; break;
#endif #endif
case 120: case 120:
@ -709,9 +759,6 @@ void handleControlChange(byte inChannel, byte inCtrl, byte inValue)
MicroDexed[instance_id]->setMonoMode(false); MicroDexed[instance_id]->setMonoMode(false);
break; break;
} }
LCDML.OTHER_updateFunc();
LCDML.loop_menu();
} }
} }
} }
@ -753,11 +800,13 @@ void handleProgramChange(byte inChannel, byte inProgram)
#ifdef DISPLAY_LCD_SPI #ifdef DISPLAY_LCD_SPI
change_disp_sd(true); change_disp_sd(true);
#endif #endif
if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_voice_select))
{
LCDML.OTHER_updateFunc(); LCDML.OTHER_updateFunc();
LCDML.loop_menu(); LCDML.loop_menu();
} }
} }
}
} }
void handleSystemExclusive(byte * sysex, uint len) void handleSystemExclusive(byte * sysex, uint len)
@ -855,63 +904,125 @@ void handleSystemExclusive(byte * sysex, uint len)
case 65: case 65:
configuration.dexed[instance_id].pb_range = constrain(sysex[5], PB_RANGE_MIN, PB_RANGE_MAX); configuration.dexed[instance_id].pb_range = constrain(sysex[5], PB_RANGE_MIN, PB_RANGE_MAX);
MicroDexed[instance_id]->controllers.values_[kControllerPitchRange] = configuration.dexed[instance_id].pb_range; MicroDexed[instance_id]->controllers.values_[kControllerPitchRange] = configuration.dexed[instance_id].pb_range;
if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_pb_range))
{
LCDML.OTHER_updateFunc();
LCDML.loop_menu();
}
break; break;
case 66: case 66:
configuration.dexed[instance_id].pb_step = constrain(sysex[5], PB_STEP_MIN, PB_STEP_MAX); configuration.dexed[instance_id].pb_step = constrain(sysex[5], PB_STEP_MIN, PB_STEP_MAX);
MicroDexed[instance_id]->controllers.values_[kControllerPitchStep] = configuration.dexed[instance_id].pb_step; MicroDexed[instance_id]->controllers.values_[kControllerPitchStep] = configuration.dexed[instance_id].pb_step;
if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_pb_step))
{
LCDML.OTHER_updateFunc();
LCDML.loop_menu();
}
break; break;
case 67: case 67:
configuration.dexed[instance_id].portamento_mode = constrain(sysex[5], PORTAMENTO_MODE_MIN, PORTAMENTO_MODE_MAX); configuration.dexed[instance_id].portamento_mode = constrain(sysex[5], PORTAMENTO_MODE_MIN, PORTAMENTO_MODE_MAX);
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);
if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_portamento_mode))
{
LCDML.OTHER_updateFunc();
LCDML.loop_menu();
}
break; break;
case 68: case 68:
configuration.dexed[instance_id].portamento_glissando = constrain(sysex[5], PORTAMENTO_GLISSANDO_MIN, PORTAMENTO_GLISSANDO_MAX); configuration.dexed[instance_id].portamento_glissando = constrain(sysex[5], PORTAMENTO_GLISSANDO_MIN, PORTAMENTO_GLISSANDO_MAX);
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);
if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_portamento_glissando))
{
LCDML.OTHER_updateFunc();
LCDML.loop_menu();
}
break; break;
case 69: case 69:
configuration.dexed[instance_id].portamento_time = constrain(sysex[5], PORTAMENTO_TIME_MIN, PORTAMENTO_TIME_MAX); configuration.dexed[instance_id].portamento_time = constrain(sysex[5], PORTAMENTO_TIME_MIN, PORTAMENTO_TIME_MAX);
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);
if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_portamento_time))
{
LCDML.OTHER_updateFunc();
LCDML.loop_menu();
}
break; break;
case 70: case 70:
configuration.dexed[instance_id].mw_range = constrain(sysex[5], MW_RANGE_MIN, MW_RANGE_MAX); configuration.dexed[instance_id].mw_range = constrain(sysex[5], MW_RANGE_MIN, MW_RANGE_MAX);
MicroDexed[instance_id]->controllers.wheel.setRange(configuration.dexed[instance_id].mw_range); MicroDexed[instance_id]->controllers.wheel.setRange(configuration.dexed[instance_id].mw_range);
if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_mw_range))
{
LCDML.OTHER_updateFunc();
LCDML.loop_menu();
}
break; break;
case 71: case 71:
configuration.dexed[instance_id].mw_assign = constrain(sysex[5], MW_ASSIGN_MIN, MW_ASSIGN_MAX); configuration.dexed[instance_id].mw_assign = constrain(sysex[5], MW_ASSIGN_MIN, MW_ASSIGN_MAX);
MicroDexed[instance_id]->controllers.wheel.setTarget(configuration.dexed[instance_id].mw_assign); MicroDexed[instance_id]->controllers.wheel.setTarget(configuration.dexed[instance_id].mw_assign);
if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_mw_assign))
{
LCDML.OTHER_updateFunc();
LCDML.loop_menu();
}
break; break;
case 72: case 72:
configuration.dexed[instance_id].fc_range = constrain(sysex[5], FC_RANGE_MIN, FC_RANGE_MAX); configuration.dexed[instance_id].fc_range = constrain(sysex[5], FC_RANGE_MIN, FC_RANGE_MAX);
MicroDexed[instance_id]->controllers.foot.setRange(configuration.dexed[instance_id].fc_range); MicroDexed[instance_id]->controllers.foot.setRange(configuration.dexed[instance_id].fc_range);
if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_fc_range))
{
LCDML.OTHER_updateFunc();
LCDML.loop_menu();
}
break; break;
case 73: case 73:
configuration.dexed[instance_id].fc_assign = constrain(sysex[5], FC_ASSIGN_MIN, FC_ASSIGN_MAX); configuration.dexed[instance_id].fc_assign = constrain(sysex[5], FC_ASSIGN_MIN, FC_ASSIGN_MAX);
MicroDexed[instance_id]->controllers.foot.setTarget(configuration.dexed[instance_id].fc_assign); MicroDexed[instance_id]->controllers.foot.setTarget(configuration.dexed[instance_id].fc_assign);
if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_fc_assign))
{
LCDML.OTHER_updateFunc();
LCDML.loop_menu();
}
break; break;
case 74: case 74:
configuration.dexed[instance_id].bc_range = constrain(sysex[5], BC_RANGE_MIN, BC_RANGE_MAX); configuration.dexed[instance_id].bc_range = constrain(sysex[5], BC_RANGE_MIN, BC_RANGE_MAX);
MicroDexed[instance_id]->controllers.breath.setRange(configuration.dexed[instance_id].bc_range); MicroDexed[instance_id]->controllers.breath.setRange(configuration.dexed[instance_id].bc_range);
if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_bc_range))
{
LCDML.OTHER_updateFunc();
LCDML.loop_menu();
}
break; break;
case 75: case 75:
configuration.dexed[instance_id].bc_assign = constrain(sysex[5], BC_ASSIGN_MIN, BC_ASSIGN_MAX); configuration.dexed[instance_id].bc_assign = constrain(sysex[5], BC_ASSIGN_MIN, BC_ASSIGN_MAX);
MicroDexed[instance_id]->controllers.breath.setTarget(configuration.dexed[instance_id].bc_assign); MicroDexed[instance_id]->controllers.breath.setTarget(configuration.dexed[instance_id].bc_assign);
if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_bc_assign))
{
LCDML.OTHER_updateFunc();
LCDML.loop_menu();
}
break; break;
case 76: case 76:
configuration.dexed[instance_id].at_range = constrain(sysex[5], AT_RANGE_MIN, AT_RANGE_MAX); configuration.dexed[instance_id].at_range = constrain(sysex[5], AT_RANGE_MIN, AT_RANGE_MAX);
MicroDexed[instance_id]->controllers.at.setRange(configuration.dexed[instance_id].at_range); MicroDexed[instance_id]->controllers.at.setRange(configuration.dexed[instance_id].at_range);
if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_at_range))
{
LCDML.OTHER_updateFunc();
LCDML.loop_menu();
}
break; break;
case 77: case 77:
configuration.dexed[instance_id].at_assign = constrain(sysex[5], AT_ASSIGN_MIN, AT_ASSIGN_MAX); configuration.dexed[instance_id].at_assign = constrain(sysex[5], AT_ASSIGN_MIN, AT_ASSIGN_MAX);
MicroDexed[instance_id]->controllers.at.setTarget(configuration.dexed[instance_id].at_assign); MicroDexed[instance_id]->controllers.at.setTarget(configuration.dexed[instance_id].at_assign);
if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_at_assign))
{
LCDML.OTHER_updateFunc();
LCDML.loop_menu();
}
break; break;
default: default:
MicroDexed[instance_id]->data[sysex[4]] = sysex[5]; // set function parameter MicroDexed[instance_id]->data[sysex[4]] = sysex[5]; // set function parameter
break; break;
} }
MicroDexed[instance_id]->controllers.refresh(); MicroDexed[instance_id]->controllers.refresh();
LCDML.OTHER_updateFunc();
LCDML.loop_menu();
} }
#ifdef DEBUG #ifdef DEBUG
else else
@ -982,9 +1093,12 @@ void handleSystemExclusive(byte * sysex, uint len)
// show voice name // show voice name
strncpy(g_voice_name[instance_id], (char*)&sysex[151], VOICE_NAME_LEN - 1); strncpy(g_voice_name[instance_id], (char*)&sysex[151], VOICE_NAME_LEN - 1);
if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_voice_select))
{
LCDML.OTHER_updateFunc(); LCDML.OTHER_updateFunc();
LCDML.loop_menu(); LCDML.loop_menu();
} }
}
else if (len == 4104 && strlen(receive_bank_filename) > 0) else if (len == 4104 && strlen(receive_bank_filename) > 0)
{ {
int32_t bulk_checksum_calc = 0; int32_t bulk_checksum_calc = 0;

@ -143,10 +143,8 @@ enum {MENU_VOICE_BANK, MENU_VOICE_SOUND};
uint8_t menu_voice_select = MENU_VOICE_SOUND; uint8_t menu_voice_select = MENU_VOICE_SOUND;
void lcdml_menu_display(void); void lcdml_menu_display(void);
void lcdml_voice_menu_display(void);
void lcdml_menu_clear(void); void lcdml_menu_clear(void);
void lcdml_menu_control(void); void lcdml_menu_control(void);
void lcdml_voice_menu_control(void);
#ifdef USE_FX #ifdef USE_FX
void UI_func_reverb_roomsize(uint8_t param); void UI_func_reverb_roomsize(uint8_t param);
void UI_func_reverb_damping(uint8_t param); void UI_func_reverb_damping(uint8_t param);

Loading…
Cancel
Save