Also the “best” way would be rather subjective… Personally I use the GUI component values in my plugin editors instead of grabbing the direct values from getRawParameterValue() or even accessing the tree parameters via tree.getParameter()->getValue().
Here I would say it’s “best” because it’s more predictable as to what value you can expect to see relative to the UI state… also there’s the whole topic of how JUCE’s parameters don’t provide thread synchronisation (warning, rather complex discussion!).
If you’re using raw parameter values from your editor they may likely be at a different vaule from the GUI state, since the GUI component values are only updated every so often from the APVTS and parameter attachment objects. These component value updates happen on the message thread so your code reading slider, button, etc. values will only happen either before they get a value update or after.
