Meta Parameters and AudioProcessorValueTreeState


#1

Hello mighty Jucers,
I have an AUVal failure with the following Message :

ERROR: Parameter values are different since last set - probable cause: a Meta Param Flag is NOT set on a parameter that will change values of other parameters.

This error makes sense to me, since I just set up a Delay Time Left/right and Delay Feedback Left/right that can be linked, as well as a Panic button that auto-resets the corresponding parameter to 0 on mouse up event.

My Problem : I am using AudioProcessorValeTreeState::CreateAndAddParameter to set up the parameters, and that returns a “standard” AudioProcessorParameter with isMetaParameter() returning false and as far as I know no setIsMetaParameter(bool isMeta) method.

My question : Is my only way out to abandon the createAndAddParameter path, then extend the AudioProcessorParameter and set up my boilerplate code for adding params to the processor and the ValueTreeState - OR - will it be possible to have a setIsMetaParameter(bool isMeta) on the “Standard” AudioProcessorParameter class in the future ?

thanks,
Michelangelo


#2

That’s a really good question!!

I faced the same problem when trying to create non-automatable parameters.
Unfortunately, I couldn’t find a solution :confused:

But this is something that I really would like to see addressed: The need of extending an AudioProcessorParameter based class (it has many virtual methods) prohibits you from using the AudioProcessorValueTreeState.

Is there a way out there? Not only for meta parameters, but using extended parameters classes at all?


#3

Hi there,
I am really stuck here , i.e. I am about to give up altogether the “CreateAndAddParameter” path and just do creation manually , with custom audioParameter classes where I can control the “isMeta” property.

Is this the right way?
Is there a better way?
Will AudioProcessorValueTreeState cover this in the close future?

I really wish to have more opinions on this , so forgive me if I dishonestly try to get attention with a cute cat playing a JUCE ball :slight_smile: It’s sunday after all.

Cheers and have a nice sunday.


#4

Here it is. Do I now get another cat pic?


#5

Nice. How do you make the meta aprameter change the other parameter efficiently?


#6

Hi there - sorry for the delay!
On the serious side : Tested and it works perfectly! auvall passes the plugin by setting my 4 linked params as meta. Thanks!

Less serious : It’s days I try to come up with a cat pic playing a juce ball, with the cat face mixed with your profile picture…but honestly I’m not there yet with the quality…maybe someday :slight_smile:


#7

Hi Matthieu - I probably do not have an “efficient” implementation, but here’s what I am coming up with as a “first” implementation.
Works OK on the UI - even though I admit I did not test it in extreme cases (e.g. left & right params both automated + link on->off & vice versa)

Here’s the fragment of my pluginprocessor::parameterchange implementation for a linked delay left/right param.
NOTE: bool linkDelayTimeParameterChange = plugin processor member initialised to false &only accessed in the parameterchanged method

Hope it’s helpful - If you have suggestions I’ll be happy to test them together :slight_smile:

….

else if(parameterID==DelayTimeLeftParamID){
    
    dspProcessor->setDelayTimeLeft(newValue);
    
    bool link = (parameters->getParameter(DelayTimeLinkID)->getValue() > 0.5f); // get the actual link param
    
    if(link && linkDelayTimeParameterChange)// right is calling me...ok done.
    {
        linkDelayTimeParameterChange_ = false;
    }
    else if (link) // left is initiating a move...notify right
    {
        linkDelayTimeParameterChange_ = true;
        AudioProcessorParameter* linkedParam = parameters->getParameter(DelayTimeRightParamID);
        // need to retrieve the actual param value, to avoid double skewing
        float thisValue = parameters->getParameter(DelayTimeLeftParamID)->getValue();
        linkedParam->setValueNotifyingHost(thisValue);
        
    }
}
else if(parameterID==DelayTimeRightParamID){

    dspProcessor->setDelayTimeRight(newValue);
    
    bool link = (parameters->getParameter(fefanto::SquareOne::DelayTimeLinkID)->getValue() > 0.5f);  // get the actual link param
    
    if( link && linkDelayTimeParameterChange)// left is calling me...ok done.
    {
        linkDelayTimeParameterChange_ = false;
    }
    else if (link) // right is initiating a move...notify left
    {
        linkDelayTimeParameterChange_ = true;
        AudioProcessorParameter* linkedParam = parameters->getParameter(DelayTimeLeftParamID);
        
        // need to retrieve the actual param value, to avoid double skewing
        float thisValue = parameters->getParameter(DelayTimeRightParamID)->getValue();
        linkedParam->setValueNotifyingHost(thisValue);
    }
    
    
}
….

#8

Would it be possible to add another flag for non-automatable parameters? Or give us an addParameter method so that we can add our own custom parameters? Thanks!


#9