gearmulator

Emulation of classic VA synths of the late 90s/2000s that are based on Motorola 56300 family DSPs
Log | Files | Refs | Submodules | README | LICENSE

commit 22c7a87f24151aa9dc113680d8cdf5112f080bbf
parent 41648626d13fc3df6342d51e54449b39ae924547
Author: dsp56300 <dsp56300@users.noreply.github.com>
Date:   Thu,  1 Aug 2024 16:24:57 +0200

update sync and ringmod correctly via CC in UI

Diffstat:
Msource/nord/n2x/n2xJucePlugin/n2xController.cpp | 25++++++++++++++++++++-----
1 file changed, 20 insertions(+), 5 deletions(-)

diff --git a/source/nord/n2x/n2xJucePlugin/n2xController.cpp b/source/nord/n2x/n2xJucePlugin/n2xController.cpp @@ -121,12 +121,27 @@ namespace n2xJucePlugin if(paramIndices.empty()) return false; - for (const auto paramIndex : paramIndices) + const auto origin = midiEventSourceToParameterOrigin(_e.source); + + if(_e.b == n2x::ControlChange::CCSync) + { + // this controls both Sync and RingMod + // Sync = bit 0 + // RingMod = bit 1 + auto* paramSync = getParameter("Sync", _e.a & 0xf); + auto* paramRingMod = getParameter("RingMod", _e.a & 0xf); + paramSync->setValueFromSynth(_e.c & 1, origin); + paramRingMod->setUnnormalizedValue((_e.c>>1) & 1, origin); + } + else { - auto* param = getParameter(paramIndex); - assert(param && "parameter not found for control change"); - // TODO: part - param->setValueFromSynth(_e.c, midiEventSourceToParameterOrigin(_e.source)); + for (const auto paramIndex : paramIndices) + { + auto* param = getParameter(paramIndex); + assert(param && "parameter not found for control change"); + // TODO: part + param->setValueFromSynth(_e.c, origin); + } } return true;