|
|
@ -419,8 +419,8 @@ void setup() |
|
|
|
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); |
|
|
|
MicroDexed[instance_id]->fx.Reso = mapfloat(FILTER_RESONANCE_MAX - 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(FILTER_CUTOFF_MAX - 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(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -527,38 +527,40 @@ void loop() |
|
|
|
// check for value changes and unused voices
|
|
|
|
// check for value changes and unused voices
|
|
|
|
soften_volume.tick(); |
|
|
|
soften_volume.tick(); |
|
|
|
|
|
|
|
|
|
|
|
for (uint8_t i = 0; i < NUM_DEXED; i++) |
|
|
|
for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) |
|
|
|
{ |
|
|
|
{ |
|
|
|
active_voices = MicroDexed[i]->getNumNotesPlaying(); |
|
|
|
active_voices = MicroDexed[instance_id]->getNumNotesPlaying(); |
|
|
|
|
|
|
|
|
|
|
|
soften_filter_res[i].tick(); |
|
|
|
soften_filter_res[instance_id].tick(); |
|
|
|
soften_filter_cut[i].tick(); |
|
|
|
soften_filter_cut[instance_id].tick(); |
|
|
|
|
|
|
|
|
|
|
|
if (soften_filter_res[i].running()) |
|
|
|
if (soften_filter_res[instance_id].running()) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// soften filter resonance value
|
|
|
|
// soften filter resonance value
|
|
|
|
MicroDexed[i]->fx.Reso = (FILTER_RESONANCE_MAX - soften_filter_res[i].value()) / 100.0; |
|
|
|
configuration.dexed[instance_id].filter_resonance=soften_filter_res[instance_id].value(); |
|
|
|
|
|
|
|
MicroDexed[instance_id]->fx.Reso = mapfloat(configuration.dexed[instance_id].filter_resonance, FILTER_CUTOFF_MIN, FILTER_CUTOFF_MAX, 1.0, 0.0); |
|
|
|
|
|
|
|
|
|
|
|
#ifdef DEBUG |
|
|
|
#ifdef DEBUG |
|
|
|
Serial.print(F("Filter-Resonance: ")); |
|
|
|
Serial.print(F("Filter-Resonance: ")); |
|
|
|
Serial.print(MicroDexed[i]->fx.Reso, 5); |
|
|
|
Serial.print(MicroDexed[instance_id]->fx.Reso, 5); |
|
|
|
Serial.print(F(" Filter-Resonance step: ")); |
|
|
|
Serial.print(F(" Filter-Resonance step: ")); |
|
|
|
Serial.print(soften_filter_res[i].steps()); |
|
|
|
Serial.print(soften_filter_res[instance_id].steps()); |
|
|
|
Serial.print(F(" Filter-Resonance diff: ")); |
|
|
|
Serial.print(F(" Filter-Resonance diff: ")); |
|
|
|
Serial.println(soften_filter_res[i].diff(), 5); |
|
|
|
Serial.println(soften_filter_res[instance_id].diff(), 5); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
} |
|
|
|
} |
|
|
|
// soften filter cutoff value
|
|
|
|
// soften filter cutoff value
|
|
|
|
if (soften_filter_cut[i].running()) |
|
|
|
if (soften_filter_cut[instance_id].running()) |
|
|
|
{ |
|
|
|
{ |
|
|
|
MicroDexed[i]->fx.Cutoff = (FILTER_CUTOFF_MAX - soften_filter_cut[i].value()) / 100.0; |
|
|
|
configuration.dexed[instance_id].filter_cutoff=soften_filter_cut[instance_id].value(); |
|
|
|
|
|
|
|
MicroDexed[instance_id]->fx.Cutoff = mapfloat(configuration.dexed[instance_id].filter_cutoff, FILTER_CUTOFF_MIN, FILTER_CUTOFF_MAX, 1.0, 0.0); |
|
|
|
#ifdef DEBUG |
|
|
|
#ifdef DEBUG |
|
|
|
Serial.print(F("Filter-Cutoff: ")); |
|
|
|
Serial.print(F("Filter-Cutoff: ")); |
|
|
|
Serial.print(MicroDexed[i]->fx.Cutoff, 5); |
|
|
|
Serial.print(MicroDexed[instance_id]->fx.Cutoff, 5); |
|
|
|
Serial.print(F(" Filter-Cutoff step: ")); |
|
|
|
Serial.print(F(" Filter-Cutoff step: ")); |
|
|
|
Serial.print(soften_filter_cut[i].steps()); |
|
|
|
Serial.print(soften_filter_cut[instance_id].steps()); |
|
|
|
Serial.print(F(" Filter-Cutoff diff: ")); |
|
|
|
Serial.print(F(" Filter-Cutoff diff: ")); |
|
|
|
Serial.println(soften_filter_cut[i].diff(), 5); |
|
|
|
Serial.println(soften_filter_cut[instance_id].diff(), 5); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -679,12 +681,12 @@ void handleControlChange(byte inChannel, byte inCtrl, byte inValue) |
|
|
|
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 = (100 - configuration.dexed[instance_id].filter_resonance) / 100.0;
|
|
|
|
//MicroDexed[instance_id]->fx.Reso = (100 - configuration.dexed[instance_id].filter_resonance) / 100.0;
|
|
|
|
soften_filter_res[instance_id].update(soften_filter_res[instance_id].value() + configuration.dexed[instance_id].filter_resonance, SOFTEN_VALUE_CHANGE_STEPS); |
|
|
|
soften_filter_res[instance_id].update(configuration.dexed[instance_id].filter_resonance, SOFTEN_VALUE_CHANGE_STEPS); |
|
|
|
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 = (100 - configuration.dexed[instance_id].filter_cutoff) / 100.0;
|
|
|
|
//MicroDexed[instance_id]->fx.Cutoff = (100 - configuration.dexed[instance_id].filter_cutoff) / 100.0;
|
|
|
|
soften_filter_cut[instance_id].update(soften_filter_cut[instance_id].value() + configuration.dexed[instance_id].filter_cutoff, SOFTEN_VALUE_CHANGE_STEPS); |
|
|
|
soften_filter_cut[instance_id].update(configuration.dexed[instance_id].filter_cutoff, SOFTEN_VALUE_CHANGE_STEPS); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 105: // CC 105: delay time
|
|
|
|
case 105: // CC 105: delay time
|
|
|
|
configuration.delay_time = map(inValue, 0, 0x7f, DELAY_TIME_MIN, DELAY_TIME_MAX); |
|
|
|
configuration.delay_time = map(inValue, 0, 0x7f, DELAY_TIME_MIN, DELAY_TIME_MAX); |
|
|
|