gRPC and Parameter Units / Values

Hi, so I just got my handy on sushi and made my first steps with gRPC.
I want to control Parameters of a VST via gRPC. For Example, I have a Gain-Control, which Range is from -12 to +12 and which unit is dB. This is programmed in the Plugin itself.

Via gRPC, I only can control a parameter called “Gain” between 0 and 1 with no Unit dB.

Is there a way to get Range and unit from a gRPC call?
(My UI then could manage to display the right Values with unit itself)

Hi Syntheseba and welcome to the forums.
You can use the GetParameterValueInDomain() and GetParameterValueAsString() functions in the gRPC interface linked below. The last one is what most hosts use to display the value as it allows the plugin to format the value to a string, allowing arbitrary mappings.

Note if your plugin is a VST2 plugin, GetParameterValueInDomain in will just return the normalized 0-1 representation as the VST2.4 interface has little support for more advanced parameter mapping. GetParameterValueAsString() will still work fine though.

I just want to add that you could also use the
service ParameterController
{
rpc GetTrackParameters (TrackIdentifier) returns (ParameterInfoList) {}
rpc GetProcessorParameters (ProcessorIdentifier) returns (ParameterInfoList) {}

}

To get a list of all parameters on a track/processor which should include their unit and range if available.

Lastly I want to recommend taking a look at https://github.com/elk-audio/elkpy which has these function easily available in a python class :slight_smile:

1 Like

Hi Ruben & Gustav,

thanks for your reply. Okay, I just didn’t see the unit, it was there all the time.
But I still can’t get the correct range. I now compiled a VST3-Version of my very simple Gain-Plugin (I use JUCE). When I call ParameterController -> GetProcessorParameters for this Processor, min_domain_value always is 0 and max_domain_value is always 1.

But in my Juce-Plugin-Code I define an AudioParameterFloat with the third Parameter juce::NormalisableRange(0.0f, 4.0f), so I expect a 4 for max_domain_value. (see below)
Am I missing something?

BTW: GetParameterValueAsString works great, Thank you.

std::make_unique<juce::AudioParameterFloat> (
  "gain",
  "Gain",
  juce::NormalisableRange<float>(0.0f, 4.0f), // parameter range?
  1.f,
  "dB",
  juce::AudioProcessorParameter::genericParameter,
  [this] (float value, int) {
    juce::ignoreUnused(this);
    if(value == 0.0) return juce::String("-")+juce::String::fromUTF8(u8"\u221e"); // -∞
    return juce::String (linearToDecibel(value)); //linearToDecibel is a helperfunction that does the conversion
   }
)