From f626116bdcf0b3771df82e85be634b71d22ce508 Mon Sep 17 00:00:00 2001 From: jd-13 Date: Sat, 1 Aug 2020 16:01:13 +0100 Subject: [PATCH] Fix default parameter value scaling --- WECore/CoreJUCEPlugin/CoreAudioProcessor.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/WECore/CoreJUCEPlugin/CoreAudioProcessor.h b/WECore/CoreJUCEPlugin/CoreAudioProcessor.h index 547b949e..bf0fe1aa 100644 --- a/WECore/CoreJUCEPlugin/CoreAudioProcessor.h +++ b/WECore/CoreJUCEPlugin/CoreAudioProcessor.h @@ -88,6 +88,7 @@ namespace WECore::JUCEPlugin { /** @{ */ inline void registerParameter(AudioParameterFloat*& param, const String& name, + const ParameterDefinition::RangedParameter* range, float defaultValue, std::function setter); @@ -193,9 +194,10 @@ namespace WECore::JUCEPlugin { void CoreAudioProcessor::registerParameter(AudioParameterFloat*& param, const String& name, + const ParameterDefinition::RangedParameter* range, float defaultValue, std::function setter) { - param = new AudioParameterFloat(name, name, 0.0f, 1.0f, defaultValue); + param = new AudioParameterFloat(name, name, 0.0f, 1.0f, range->InternalToNormalised(defaultValue)); ParameterInterface interface = {[¶m]() { return param->get(); }, setter};