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 b2abc9f12fa5fa03014cf210b4ea17f4acea4690
parent 4eadf87f607cc26ece3da8e56abc12421cad19a9
Author: dsp56300 <dsp56300@users.noreply.github.com>
Date:   Fri, 25 Oct 2024 07:37:45 +0200

prevent that some plugin format implementations bounce back value changes immediately back to the parameter that is sending a value change

Diffstat:
Mdoc/changelog.txt | 3++-
Msource/jucePluginLib/parameter.cpp | 21+++++++++++++++++----
Msource/jucePluginLib/parameter.h | 2++
3 files changed, 21 insertions(+), 5 deletions(-)

diff --git a/doc/changelog.txt b/doc/changelog.txt @@ -10,7 +10,6 @@ Framework: - [Imp] Added new entry to 'Skins' submenu to open the skins folder in the default file browser - - [Imp] All MacOS builds now included a script to remove quaratine attributes - [Imp] The default skin folder has changed. Custom skins are now supposed to be in: @@ -32,6 +31,8 @@ Framework: - [Fix] FX plugins didn't apply latency when being processed as bypassed, causing the signal to appear early +- [Fix] Tooltips didn't refresh correctly in some hosts / plugin formats + NodalRed2x: diff --git a/source/jucePluginLib/parameter.cpp b/source/jucePluginLib/parameter.cpp @@ -102,21 +102,21 @@ namespace pluginLib { ScopedChangeGesture g(*this); setUnnormalizedValue(juce::roundToInt(convertFrom0to1(_value)), _origin); - sendValueChangedMessageToListeners(_value); + notifyHost(_value); } void Parameter::setUnnormalizedValueNotifyingHost(const float _value, const Origin _origin) { ScopedChangeGesture g(*this); setUnnormalizedValue(juce::roundToInt(_value), _origin); - sendValueChangedMessageToListeners(convertTo0to1(_value)); + notifyHost(convertTo0to1(_value)); } void Parameter::setUnnormalizedValueNotifyingHost(const int _value, const Origin _origin) { ScopedChangeGesture g(*this); setUnnormalizedValue(_value, _origin); - sendValueChangedMessageToListeners(convertTo0to1(static_cast<float>(_value))); + notifyHost(convertTo0to1(static_cast<float>(_value))); } void Parameter::setRateLimitMilliseconds(const uint32_t _ms) @@ -162,6 +162,12 @@ namespace pluginLib void Parameter::setValue(const float _newValue) { + // some plugin formats (VST3 for example) bounce back immediately, skip this, we don't + // want it and VST2 doesn't do it either so why does Juce for VST3? + // It's not the host, it's the Juce VST3 implementation + if(m_notifyingHost) + return; + setUnnormalizedValue(juce::roundToInt(convertFrom0to1(_newValue)), Origin::HostAutomation); } @@ -219,7 +225,14 @@ namespace pluginLib m_changingDerivedValues = false; } - juce::String Parameter::genId(const Description& d, const int part, const int uniqueId) + void Parameter::notifyHost(const float _value) + { + m_notifyingHost = true; + sendValueChangedMessageToListeners(_value); + m_notifyingHost = false; + } + + juce::String Parameter::genId(const Description& d, const int part, const int uniqueId) { if(uniqueId > 0) return juce::String::formatted("%d_%d_%d_%d", static_cast<int>(d.page), part, d.index, uniqueId); diff --git a/source/jucePluginLib/parameter.h b/source/jucePluginLib/parameter.h @@ -110,6 +110,7 @@ namespace pluginLib static uint64_t milliseconds(); void sendParameterChangeDelayed(ParamValue _value, uint32_t _uniqueId); void forwardToDerived(const int _newValue); + void notifyHost(float _value); int clampValue(int _value) const; @@ -132,5 +133,6 @@ namespace pluginLib bool m_isLocked = false; ParameterLinkType m_linkType = None; uint32_t m_changeGestureCount = 0; + bool m_notifyingHost = false; }; }