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 fa2561456963a31bcaf8395caa98a859e020c998
parent 867bf9148729524bf7dc09a049f4890128950480
Author: dsp56300 <dsp56300@users.noreply.github.com>
Date:   Sun, 21 Apr 2024 00:52:06 +0200

Merge branch 'oss/osirus' into oss/vavra

Diffstat:
Msource/jucePluginLib/controller.cpp | 17++++++++++++-----
Msource/jucePluginLib/parameter.cpp | 30+++++++++++++++---------------
Msource/jucePluginLib/patchdb/db.cpp | 2+-
3 files changed, 28 insertions(+), 21 deletions(-)

diff --git a/source/jucePluginLib/controller.cpp b/source/jucePluginLib/controller.cpp @@ -313,11 +313,18 @@ namespace pluginLib for (const auto& index : indices) { - auto* p = getParameter(index.second, _part); - if(!p) - return false; - - const auto v = getParameterValue(p); + auto* p = getParameter(index.second, _part); + if(!p) + return false; + auto* largestP = p; + // we might have more than 1 parameter per index, use the one with the largest range + const auto& derived = p->getDerivedParameters(); + for (const auto& parameter : derived) + { + if(parameter->getDescription().range.getLength() > p->getDescription().range.getLength()) + largestP = parameter; + } + const auto v = getParameterValue(largestP); _params.insert(std::make_pair(std::make_pair(index.first, p->getDescription().name), v)); } diff --git a/source/jucePluginLib/parameter.cpp b/source/jucePluginLib/parameter.cpp @@ -116,22 +116,22 @@ namespace pluginLib { const auto clampedValue = juce::roundToInt(m_range.getRange().clipValue(static_cast<float>(newValue))); - if (clampedValue == m_lastValue) - return; - - m_lastValue = clampedValue; - m_lastValueOrigin = _origin; - - if (notifyHost && getDescription().isPublic) + if (clampedValue != m_lastValue) { - beginChangeGesture(); - const auto v = convertTo0to1(static_cast<float>(clampedValue)); - setValueNotifyingHost(v, _origin); - endChangeGesture(); - } - else - { - m_value.setValue(clampedValue); + m_lastValue = clampedValue; + m_lastValueOrigin = _origin; + + if (notifyHost && getDescription().isPublic) + { + beginChangeGesture(); + const auto v = convertTo0to1(static_cast<float>(clampedValue)); + setValueNotifyingHost(v, _origin); + endChangeGesture(); + } + else + { + m_value.setValue(clampedValue); + } } if (m_changingDerivedValues) diff --git a/source/jucePluginLib/patchdb/db.cpp b/source/jucePluginLib/patchdb/db.cpp @@ -15,7 +15,7 @@ namespace pluginLib::patchDB { - static constexpr bool g_cacheEnabled = false; + static constexpr bool g_cacheEnabled = true; namespace {