Suggestion for custom display implementation

Hello

I want to port my Rack Extension which displays the volume as a history (https://pongasoft.com/rack-extensions/VAC6.html) in a custom display.

Is there any recommendation of the proper way to implement this in the VST world? I am using plain VST and VSTGUI 4. I understand I can create my own Control in VSTGUI 4 and I can draw whatever I want. So although I have not looked too much in details I believe the UI part should be OK.

What I am struggling with is how to pass (large amounts of) data between the processor and the controller: the processor analyzes the incoming audio and keeps a buffer (aka memory) of the volume for some amount of time. The UI displays this data in a window. What is the recommended way of passing this data around knowing that it is not a single value, but more like an array.

I understand that sharing data (aka the buffer) is not really recommended since it would have to be properly synchronized, potentially slowing down the processor waiting on the lock. I also understand that out parameters are single value only.

So how do people do in general (there are many VST plugins with complex UI representation, like phase, etc…).

Any pointer or recommendation much appreciated.

Thanks
Yan

Hi,
what you basically need to do is to use a lock free ring buffer on the audio processor side where you push your data on. The audio processor has a timer on the main thread that pulls the data from the ring buffer and sends the data to the edit controller via a message. The edit controller than can display the data in its editor.
Best is also to add a timestamp to your data, so that you can compensate on the UI side the latency of the audio, so that the user sees what the user hears.

I hope this helps
Cheers,
Arne

Thank you for the suggestion!

When you say “The audio processor has a timer on the main thread”, how do you create/setup a timer on the main thread?

Thank you
Yan

Does anybody has any suggestion on how to create/setup a timer on the main thread?

Thanks
Yan

Hi Yan,
the activate method from IAudioProcessor is guaranteed to be called on the main thread. Timer implementations can be found in the sdk either in base or in vstgui.

Cheers,
Arne

When you talk about the “activate” method from IAudioProcessor what are you referring to exactly? Looking at the interface (https://github.com/steinbergmedia/vst3_pluginterfaces/blob/4c8dc65879479fc36763fddfccd2b2da658d3c29/vst/ivstaudioprocessor.h#L244) there is no “activate” method.

Are you referring to “setupProcessing”? Are you referring to another method from Component like “initialize” or “setActive”?

Thanks
Yan

Hey Yan,
sorry, I meant the method setActive not activate.

Cheers,
Arne