commit fc11811b0182441ba582474a710554708943cb92
parent f4b5e90042fbf93cde11cbd32b23dd1958cfad83
Author: Tal Aviram <me@talaviram.com>
Date: Fri, 20 Aug 2021 09:55:08 +0300
controller - parameter has ability to get value from synth without looping-back to synth.
Diffstat:
2 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/source/jucePlugin/VirusParameter.cpp b/source/jucePlugin/VirusParameter.cpp
@@ -24,6 +24,15 @@ namespace Virus
}
}
+ void Parameter::setValueFromSynth(int newValue, const bool notifyHost)
+ {
+ m_lastValue = newValue;
+ if (notifyHost)
+ setValueNotifyingHost(convertTo0to1(newValue));
+ else
+ m_value.setValue(newValue);
+ }
+
juce::String Parameter::genId(const Description &d, const int part)
{
return juce::String::formatted("%d_%d_%d", (int)d.page, part, d.index);
diff --git a/source/jucePlugin/VirusParameter.h b/source/jucePlugin/VirusParameter.h
@@ -56,6 +56,7 @@ namespace Virus
float getValue() const override { return m_value.getValue(); }
void setValue(float newValue) override { return m_value.setValue(newValue); };
+ void setValueFromSynth(int newValue, bool notifyHost = true);
float getDefaultValue() const override { return 0; /* maybe return from ROM state? */ }
float getValueForText(const juce::String &text) const override