Browse Source

MIDI-Map: Set param value without Engine smoothing, since MIDI-Map already filters it.

tags/v2.6.3
Andrew Belt 1 month ago
parent
commit
844b45057f
1 changed files with 11 additions and 4 deletions
  1. +11
    -4
      src/core/MIDIMap.cpp

+ 11
- 4
src/core/MIDIMap.cpp View File

@@ -115,16 +115,23 @@ struct MIDIMap : Module {
if (values[cc] < 0) if (values[cc] < 0)
continue; continue;
float value = values[cc] / 127.f; float value = values[cc] / 127.f;
// Detect behavior from MIDI buttons.

// Detect MIDI CC buttons
if (smooth && std::fabs(valueFilters[id].out - value) < 1.f) { if (smooth && std::fabs(valueFilters[id].out - value) < 1.f) {
// Smooth value with filter // Smooth value with filter
valueFilters[id].process(args.sampleTime * divider.getDivision(), value);
value = valueFilters[id].process(args.sampleTime * divider.getDivision(), value);
} }
else { else {
// Jump value
// Jump filter value, don't filter
valueFilters[id].out = value; valueFilters[id].out = value;
} }
paramQuantity->setScaledValue(valueFilters[id].out);

// Scale and snap value based on ParamQuantity
value = paramQuantity->fromScaled(value);
if (paramQuantity->snapEnabled)
value = std::round(value);
// Set param value without Engine smoothing, since it is already filtered.
APP->engine->setParamValue(module, paramId, value);
} }
} }




Loading…
Cancel
Save