Updating the UI after a Midi Event. Questions.

DSP, Plugin and Host development discussion.
Post Reply New Topic
RELATED
PRODUCTS

Post

Hi All,
I am working on my Delphi framework for VST3 and others. Not that there is much interest, but I do this for fun.
Now, I come to an interesting thing which I'd like to discuss.

So, suppose I want to implement a UI change on a Midi event, e.g. Note On (onscreen Keyboard) or MIDI_CC for Cutoff (Knob on UI).
Simple stated: I get the event in my VST and I redraw the control.
Well, most of you know that this will not work as the Midi Event is triggered from a NON-UI thread.

Now I have three questions. The first two questions are not VST3 specific but also apply to VST2).

First, when looking at the JUCE sourcecode I noticed (allready much earlier) they don't have any problem with this: They just repaint the VST all the time on a timer event.
Now that's a quick solution! But I am allways puzzled on that repaint thingie..(I believe they redraw 30FPs)
Isn't that time consuming (allthough it's the UI thread..) or am I seeing things wrong or, or...
They of course made that choice but I'd like to know the pro's and cons

Second question: I am using a pattern where I just poll (from the UI thread, timer) if parameters have changed and if so, redraw only that parameter. (The same pattern is used to redraw the keyboard). What do you think? Pro's Cons? Problems?

Third question: With VST3, Steinberg decided to remove the CC's from the input queue and you can only get them using 'the parameter trick'. What I notice in Reaper (I asked them but no reply..) is that indeed the parameters are triggered, but both from the EditController (CEditController.SetParamNormalized) and the Audioprocessor (Process event). To be precisely: When I have a knob turned I receive a lot of parameter changes in the Audioprocessor but not all in SetParameterNormalized.
In fact, I have the parameter hidden (flag kCanAutomate not set), but it is still called.
What are your experiences with this, maybe in some other Hosts?

Post

IEditController's setParamNormalized should only update UI value, it should not affect processing.

From VST3 pluginterfaces:

Code: Select all

	/** Sets the normalized value to the parameter associated to the paramID. The controller must never
	    pass this value-change back to the host via the IComponentHandler. It should update the according
		GUI element(s) only!*/
	virtual tresult PLUGIN_API setParamNormalized (ParamID id, ParamValue value) = 0;
See the last sentence in the comment.

Host must send additional updates for processing in IParameterChanges. If you check what Reaper sends for both, you will notice that values for UI sometimes are a bit forward in time, so it is even wrong when setParamNormalized affects processing. Moreover, if I remember correctly, if you notify host about parameter change, it will also send this change to the UI using setParamNormalized.

Post Reply

Return to “DSP and Plugin Development”