diff --git a/src/detail/vst3/parameter.cpp b/src/detail/vst3/parameter.cpp index 8c4ace7d..40c934ff 100644 --- a/src/detail/vst3/parameter.cpp +++ b/src/detail/vst3/parameter.cpp @@ -123,7 +123,7 @@ Vst3Parameter* Vst3Parameter::create( v.defaultNormalizedValue = (info->default_value - info->min_value) / param_range; if ((info->flags & CLAP_PARAM_IS_STEPPED) || (info->flags & CLAP_PARAM_IS_ENUM)) { - auto steps = param_range + 1; + auto steps = param_range; v.stepCount = steps; } else @@ -166,15 +166,15 @@ Vst3Parameter* Vst3Parameter::create(uint8_t bus, uint8_t channel, uint8_t cc, V if (cc == Vst::ControllerNumbers::kCtrlProgramChange) { v.flags |= Vst::ParameterInfo::kIsProgramChange | Vst::ParameterInfo::kCanAutomate; - v.stepCount = 128; + v.stepCount = 127; } v.defaultNormalizedValue = 0; - v.stepCount = 128; + v.stepCount = 127; if (cc == Vst::ControllerNumbers::kPitchBend) { - v.stepCount = 16384; + v.stepCount = 16383; } auto result = new Vst3Parameter(v, bus, channel, cc); diff --git a/src/detail/vst3/parameter.h b/src/detail/vst3/parameter.h index 2f8e1881..f75a2e11 100644 --- a/src/detail/vst3/parameter.h +++ b/src/detail/vst3/parameter.h @@ -54,7 +54,7 @@ class Vst3Parameter : public Steinberg::Vst::Parameter { if (info.stepCount > 0) { - return (vst3value * info.stepCount) + min_value; + return (vst3value * info.stepCount + 1) + min_value; } return (vst3value * (max_value - min_value)) + min_value; } @@ -63,7 +63,7 @@ class Vst3Parameter : public Steinberg::Vst::Parameter auto& info = this->getInfo(); if (info.stepCount > 0) { - return (clapvalue - min_value) / float(info.stepCount); + return (clapvalue - min_value) / float(info.stepCount + 1); } return (clapvalue - min_value) / (max_value - min_value); }