free-audio / clap-wrapper

Wrappers for using CLAP in other plugin environments
MIT License
124 stars 20 forks source link

CLAP_PARAM_IS_STEPPED parameter is not working properly #300

Closed lewloiwc closed 2 months ago

lewloiwc commented 2 months ago

When I make this (https://github.com/baconpaul/clap-c99-distortion) into a VST3 using the method described in Getting Started, parameters with CLAP_PARAM_IS_STEPPED don't work properly. Reaper → https://youtu.be/EfBnUljIXgg Bitwig → https://youtu.be/cVVahhtgy9o Live → https://youtu.be/S-7ci_UcmuE

In the CLAP I'm creating, parameters with CLAP_PARAM_IS_STEPPED also don't work properly, so I think it might be an issue with clap-wrapper. Can you reproduce this in your environment?

I'm using Windows 10, and for building, I'm using: Developer Command Prompt for VS 2022 Visual Studio 2022 Developer Command Prompt v17.10.5

defiantnerd commented 2 months ago

I have to redact my comment and check it out first:

defiantnerd commented 2 months ago

it seems that it is an issue with the value string, the parameter itself is working well (you can hear the three different settings). I'll check it out if I can reproduce that.

defiantnerd commented 2 months ago

I am able to reproduce it and this is the fix:

--- 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 + 1) + min_value;
+      return (vst3value * info.stepCount) + min_value;
     }
     return (vst3value * (max_value - min_value)) + min_value;
   }

I'll prepare a fix for the wrapper, too.