kAudioUnitProperty ParameterStringFromValue support

if a plugin does not use the AudioProcessorParameter system, then AudioProcessor::getParameterText() should be called instead of String (value).

It’s l.488 of juce_AU_Wrapper.mm :

text = String (value);

should be replaced by something like :

text = juceFilter->getParameterText ((int) pv->inParamID, 1024);

Thanks for spotting this. I’ve fixed this on the develop branch however, the fix is not as straightforward as you might expect. AU’s kAudioUnitProperty_ParameterStringFromValue call will include the parameter value which needs to be converted and this may not be equal to the current value of the parameter. Therefore, I will fallback to String (value) if the current value of the parameter does not match the requested value - not sure if this is the right thing to do. Please let me know if I should revert this change.

arf. yes, that makes sense, but that won’t work unfortunately, because the values of the int/bool parameters are ‘rounded’ while the given one is not.
As a result, the strings shown in the automations in logic would sometimes be ok, sometimes not, so I think it’s best to revert yes.

I’m wondering if there would be any cases where always returning the param value would be a problem actually. do you know?

also note that it’s done this way in the aax wrapper (in GetParameterStringFromValue)

OK I’ll revert the commit.

1 Like