Where to put initial startup parameter values for AAX?

I think here is the answer!!

Pro Tools is reacting differently when you have automateable parameters. Just tried the same gain demo with my NonAutomatableAudioParameterFloat class.

The Generic Editor won’t even show you the slider but you can have a look at the console. Problem is, the gain value still gets overwritten somewhere between prepareToPlay() and processBlock()

#pragma once


class NonAutomatableAudioParameterFloat : public AudioParameterFloat  {
    
public:
    
    NonAutomatableAudioParameterFloat(const String& parameterID,
                                    const String& parameterName,
                                    NormalisableRange<float> normalisableRange,
                                    float defaultValue,
                                    const String& parameterLabel = String(),
                                    Category parameterCategory = AudioProcessorParameter::genericParameter,
                                    std::function<String(float value, int maximumStringLength)> stringFromValue = nullptr,
                                    std::function<float(const String& text)> valueFromString = nullptr)
    : AudioParameterFloat(parameterID, parameterName, normalisableRange, defaultValue)
    {}
    
    NonAutomatableAudioParameterFloat(String parameterID,
                                      String parameterName,
                                      float minValue,
                                      float maxValue,
                                      float defaultValue)
    : AudioParameterFloat(parameterID, parameterName, minValue, maxValue, defaultValue)
    {}
    
    
    bool isAutomatable() const override {
        return false;
    }
    
};


//==============================================================================
class GainProcessor  : public AudioProcessor
{
public:

    //==============================================================================
    GainProcessor()
        : AudioProcessor (BusesProperties().withInput  ("Input",  AudioChannelSet::stereo())
                                           .withOutput ("Output", AudioChannelSet::stereo()))
    {
        addParameter (gain = new NonAutomatableAudioParameterFloat ("gain", "Gain", 0.0f, 1.0f, 0.5f));
        
    }

    ~GainProcessor() {}

    //==============================================================================
    void prepareToPlay (double, int) override {
        float randomValue = Random::getSystemRandom().nextFloat();
        gain->setValueNotifyingHost(randomValue);
        DBG("PREPARE TO PLAY - Random Val: " << randomValue << " Gain Value: " << *gain);
    }
    void releaseResources() override {}

    void processBlock (AudioBuffer<float>& buffer, MidiBuffer&) override
    {
        DBG("PROCESSBLOCK - Gain: "  << *gain);
        buffer.applyGain (*gain);
    }

    //==============================================================================
    AudioProcessorEditor* createEditor() override          { return new GenericAudioProcessorEditor (*this); }
    bool hasEditor() const override                        { return true;   }

    //==============================================================================
    const String getName() const override                  { return "Gain PlugIn"; }
    bool acceptsMidi() const override                      { return false; }
    bool producesMidi() const override                     { return false; }
    double getTailLengthSeconds() const override           { return 0; }

    //==============================================================================
    int getNumPrograms() override                          { return 1; }
    int getCurrentProgram() override                       { return 0; }
    void setCurrentProgram (int) override                  {}
    const String getProgramName (int) override             { return {}; }
    void changeProgramName (int, const String&) override   {}

    //==============================================================================
    void getStateInformation (MemoryBlock& destData) override
    {
        DBG("GET STATE - Value: " << *gain);
        
        MemoryOutputStream (destData, true).writeFloat (*gain);
    }

    void setStateInformation (const void* data, int sizeInBytes) override
    {
        MemoryInputStream mis {data, static_cast<size_t>(sizeInBytes), true};
        float value = mis.readFloat();
        gain->setValueNotifyingHost(value);
        DBG("SET STATE - Value: " << value);
    }

    //==============================================================================
    bool isBusesLayoutSupported (const BusesLayout& layouts) const override
    {
        const auto& mainInLayout  = layouts.getChannelSet (true,  0);
        const auto& mainOutLayout = layouts.getChannelSet (false, 0);

        return (mainInLayout == mainOutLayout && (! mainInLayout.isDisabled()));
    }

private:
    //==============================================================================
    NonAutomatableAudioParameterFloat* gain;

    //==============================================================================
    JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (GainProcessor)
};