While developing a VST3 instrument plugin, I’m stuck with a major issue:
When notifying the host from the controller side using performEdit, some messages get lost in the forwarding and don’t reach the processor.
I checked that all parameter changes occur on the controller side. Calls for performEdit are correctly performed every time.
However, on the Processor side, sometimes parameter updates don’t appear in the process() method when parsing data.inputParameterChanges.
This happens in different DAWs, with different VST3 SDK versions.
Do you have any recommendation on how properly debug this, or maybe a simple example ?
I have never experienced this problem. Are you sure you call:
beginEdit(id);
then
performEdit(id);
performEdit(id);
performEdit(id);
...
then
endEdit(id);
I have encapsulated this sequence in a Editor concept, so that I don’t really have to think about it (beginEdit is done in constructor and endEdit in destructor).
Although now that I look at the code, it seems I also call setParamNormalized (see setValue method) in addition to performEdit.
Sorry to dig up this topic, but I’m still facing this issue.
It’s quite random and when I detect that the parameter update has not been forwarded, it’s already too late. Do you have any idea on how I can debug this properly ?
Is there a proper documentation on this topic somewhere ?
Ok, so I spent some time trying to narrow down the issue. The problem seems to be located in my processor’s process() method (see code in a previous comment).
I replaced my audio engine processing code with a basic sine wave generator. With this simple code, everything runs well, all parameter updates (sent from performEdit) seem to arrive properly in the inputParameterChanges queue.
Now, if I make a sleep() call for 5ms after the sinewave generation, the problem occurs very frequently.
Could the inputParameterChanges queue feeding be blocked when the process() method is doing too much work ?
Hi, I’m Japanese programmer, so sorry if my sentence is wrong, haha…
In my case, Even I don’t call sleep(), the problem occurs…
Yes I don’t use OpenGL, I use the common VSTGUIEditor.
My version is 3.7.5.
The latest version is 3.7.7, So I’ll try it tomorrow !
I have the issue even if I don’t call sleep() as well, that was a way of reproducing the issue easily, because it happens only sometimes.
Thanks for your info.
I’ve updated my VST3SDK to version 3.7.7, I’ll let you know if it solves the issue.
Hi, Unfortunately…the latest 3.7.7 also causes the same problem…yeah…
But I’m happy to report that I was able to solve the problem in my way!
In my case, when I turn the Knob, sometimes the notification does not reach the processor.
(This is especially true when I run Knob too fast).
So far, I have been calling performEdit() within a function called valueChanged() in Editor, but that did not work correctly.
(I think this is probably the normal way in most cases.)
But I called performEdit() on every knob dragging frame, It works!
I created a class that inherits from CAnimKnob and coded it to always send a notification while dragging.
To implement this, the CustomKnob class must have an instance of EditorController, which is necessary for notifications, so I register it as an argument when the Knob is initialized.
Then all, we have to do is override onMouseDown, onMouseMoved(), etc., and call performEdit() in them.
This is a bit tedious, but I hope it helps you.
If it’s not a control operation, but some special timing, you could use a timer.
In my case it also happens with buttons, not only knobs.
I use a custom based UI framework which does quite the same as the code you show in your image. Anyway, I will investigate more in details when I’ll have more time to assign to this issue.
Thanks a lot for letting me know, and glad you managed to solve it !
Yes, I’m sorry…
I forgot, yeah, my button also occurs.
Additionally, I needed to improve on my previous code.
I changed the way it as follows. →
1: Keep the control instance from arguments of valuechanged. (CControl*)
2: I provided a timer that notified the processor of the value of 1’s control for about 5 consecutive frames, and that definitely fixed the problem.