Skip to content

Commit

Permalink
Merge commit '78e46ed' into steps-off-by-one
Browse files Browse the repository at this point in the history
  • Loading branch information
baconpaul committed Jun 11, 2024
2 parents c73aaf3 + 78e46ed commit 009186f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/detail/vst3/parameter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/detail/vst3/parameter.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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);
}
Expand Down

0 comments on commit 009186f

Please sign in to comment.