Hi all,
I'm using Juce to produce a VST plugin. Recently I've been wrestling with the issue of automation in Reaper - ordinarily I can solve most issues by sifting through the class references and various forum posts, but this time I am completely stumped.
The main problem that I'm having is that with Reaper I don't seem to get a setValue callback from the host when I try to record automation. I've condensed my subclass of AudioProcessorParameter to a much simpler class in order to facilitate debugging:
class SimpleParameter : public AudioProcessorParameter { public: SimpleParameter() : _value(0.0f) { } ~SimpleParameter() {} void setValue(float f) override { _value = f; } float getValue() const override { return _value; } String getName(int len) const override { String name = "myName"; return name.substring(0, len); } String getLabel() const override { return "ms"; } float getDefaultValue() const override { return 0.0f; } float getValueForText (const String& text) const override { return 0.0f; } private: float _value; };
The SimpleParameter is then added to the parameter list using the following call in the AudioProcessor constructor:
addParameter(new SimpleParameter());
For those of you who use Reaper, I am attempting to record automation as follows:
1) Insert->Virtual instrument on new track, and then select my VST plugin
2) Param->FX Parameter list->Show track envelope, and then pick my parameter
3) Right click on the new track, and select write mode
4) Click play and twiddle the knob on the envelope track
When I follow these steps for another VST (e.g. Cockos ReaSynth which comes with Reaper), I can clearly see the knob twiddles being recorded. However, when I do this for my VST, the recording flatlines at 0.0. I have set breakpoints in my simple parameter class - I can see that getValue is being called repetitively, but the breakpoint in setValue is never triggered.
Obviously if setValue is never called, getValue always returns the default value of 0.0, so the observed behaviour makes sense. However, I have read the class API a thousand times, and cannot for the life of me understand why setValue is not getting called. Is there anything wrong with my code? Any feedback or suggestions are most welcome.