[Solved] Automation without GUI


#1

I’m playing with a plugin that gets its values from the automation control lanes - I can implement the GUI but they are superfluous to my needs.

Is it possible to have automation with associated GUI bits?


#2

I think that should be no problem. Just return false from MyAudioProcessor::hasEditor()

But you can also simply add the GenericAudioProcessorEditor instead of the MyAudioProcessorEditor from the boilerplate. That should populate sliders with the values automatically…


#3

OK, that’s good news.

If I return false from hasEditor() where would be best to implement the listener? Is it OK to implement along with the AudioProcessor class?


#4

Yes, the AudioProcessor can be a listener, like every other class. You are talking about AudioProcessorValueTreeState::Listener, right?


#5

Ye, that’s right.


#6

I’ve implemented this but get an exception

I added the public AudioProcessorValueTreeState::Listener to the AudioProcessor class

with
void parameterChanged(const String &parameterID, float newValue) override;
AudioProcessorValueTreeState parameters;

created a paramterChanged in my processor
void myAudioProcessor::parameterChanged(const String & parameterID, float newValue) { }

and then in the constructor
myAudioProcessor::myAudioProcessor()
: parameters(*this, nullptr)
{
parameters.createAndAddParameter("x", "X Coordinate", "",
NormalisableRange<float>(-1.0f, 1.0f, 0.0001f), 0.0,
[](float value) { return String(value, 4); }, nullptr);

parameters.addParameterListener("x", this);
myX = parameters.getRawParameterValue("x");

}

but the exception seems to throw on createAndAddParameter()

The exception is an assert
jassert (name.toString().isNotEmpty()); // Must have a valid property name!
at JUCE Assertion failure in juce_valuetree.cpp:737

any ideas?


#7

Did you initialize the ValueTree state after createAndAddParameter() calls?

myAudioProcessor::myAudioProcessor() : parameters(*this, nullptr)
{
    parameters.createAndAddParameter(...);

    parameters.state = ValueTree("some name for the state here");
}

#8

Thankyou Tony. Much appreciated.

I have just arrived at the observation myself!!! I was missing
parameters.state = ValueTree(“x”);


#9

With the new way of using APVTS

it’s no longer possible to miss out the initialization :slight_smile:


#10

@t0m, do I implement the listeners in the old way with the the new way of using APVTS?


#11

You can use the old way, but you’re also free to use the AudioProcessorParameter::Listener interface too.


#12

thanks @t0m, your thought on APVTS might be useful here too Unity Plugin & Parameters