From e2efb698e045c67b7f7032b6b05661937b07cf15 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Mon, 4 Oct 2021 17:06:08 +0200 Subject: [PATCH] VST3: fix discrete parameters Some plugins have a min/max range of 1, for stepwise enumerated values of a control. e.g. waves maps note-names this way. https://discourse.ardour.org/t/106429/ --- libs/ardour/vst3_plugin.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libs/ardour/vst3_plugin.cc b/libs/ardour/vst3_plugin.cc index 57d72ef720..6f66839ad4 100644 --- a/libs/ardour/vst3_plugin.cc +++ b/libs/ardour/vst3_plugin.cc @@ -1631,7 +1631,7 @@ VST3PI::get_parameter_descriptor (uint32_t port, ParameterDescriptor& desc) cons desc.normal = _controller->normalizedParamToPlain (id, p.normal); desc.toggled = 1 == p.steps; desc.logarithmic = false; - desc.integer_step = p.steps > 1 ? p.steps : 0; + desc.integer_step = p.steps > 1 && (desc.upper - desc.lower) == p.steps; desc.sr_dependent = false; desc.enumeration = p.is_enum; desc.label = p.label; @@ -1640,6 +1640,9 @@ VST3PI::get_parameter_descriptor (uint32_t port, ParameterDescriptor& desc) cons } else if (p.unit == "Hz") { desc.unit = ARDOUR::ParameterDescriptor::HZ; } + if (p.steps > 1) { + desc.rangesteps = 1 + p.steps; + } FUnknownPtr extra_ctrl (_controller); if (extra_ctrl && port != designated_bypass_port ()) {