From 262d597df7a33df0d0d7e47c5f1415cedd3627fc Mon Sep 17 00:00:00 2001 From: AnClark Liu Date: Wed, 17 Apr 2024 17:23:14 +0800 Subject: [PATCH] plugin: Obtain param default value on initParameter() During plugin initialization, we can directly invoke CCetoneSynth::getParameter() to get default parameter value, as at that time only the default program is loaded. --- src/CetoneSynthDPF.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CetoneSynthDPF.cpp b/src/CetoneSynthDPF.cpp index 16ea48b..3e47c34 100644 --- a/src/CetoneSynthDPF.cpp +++ b/src/CetoneSynthDPF.cpp @@ -7,7 +7,7 @@ void CCetoneSynth::initParameter(uint32_t index, Parameter& parameter) // Fallback to classic VST 2.4 param range (0.0 ~ 1.0), to fit with Cetone's own param handlers. parameter.ranges.min = 0.0f; parameter.ranges.max = 1.0f; - parameter.ranges.def = 0.5f; + parameter.ranges.def = getParameter(index); // Must set parameter.symbol, this is the unique ID of each parameter. // If not set, you can neither save presets nor reset to factory default, in VST3 and CLAP!