AAX gain reduction meter

Hi,

I’m making a compressor plugin… for level meters and gain reduction I’m using ff_meters and it works perfect, but I’d also like to send the gain reduction values to Pro Tools gain reduction meter.

I’ve been looking into a NoiseGate.cpp mod example posted some time ago in the forum but it didn’t work for me, PT doesn’t show any reduction in the mixer/channel view.

In my plugin I’ve added a read-only parameter to my apvts

auto comp_gr = std::make_unique<juce::AudioParameterFloat>(juce::ParameterID("reduction", versionHint),
                                                           "Gain Reduction",
                                                            NormalisableRange<float> (0.0f, 1.0f),
                                                            1.0f,
                                                            juce::String(),
                                                               AudioProcessorParameter::compressorLimiterGainReductionMeter);

At the end of the processBlock:

// ff with gr
meterSourceOut.measureBlock(buffer);
meterSourceOut.setReductionLevel(gr);

// gr to pt
apvts.getParameter("reduction")->setValueNotifyingHost(gr);

This last line makes PT erratic; bypass button is blocked and the plugin is not working properly, but it doesn’t seems to affect apparently to the rest of VST3/AU hosts.

Thank you,
jc

pd. by the way I can’t attach Xcode13 to PT2021.6 Dev on macOS12.1, it crashes all the time.