Cannot link effect parameter to fader on VSTGUI
-
- KVRist
- 60 posts since 20 Sep, 2007
Like I said I cant link fader from gui to change params of effect.
It is VST SDK 2.4
I cant find in tuts or docs how I ma suppose to do that? Obviously I have to have some reference of editor class in effect class.
I guess setParameter() is the function to update effects params value from faders positions.
void mdaDelay::setParameter(VstInt32 index, float value)
Here are complete .cpp files:
effect.cpp:
http://codepad.org/tDwfI4ps
editor.cpp
http://codepad.org/oBuzrzOu
It is VST SDK 2.4
I cant find in tuts or docs how I ma suppose to do that? Obviously I have to have some reference of editor class in effect class.
I guess setParameter() is the function to update effects params value from faders positions.
void mdaDelay::setParameter(VstInt32 index, float value)
Here are complete .cpp files:
effect.cpp:
http://codepad.org/tDwfI4ps
editor.cpp
http://codepad.org/oBuzrzOu
-
- KVRist
- Topic Starter
- 60 posts since 20 Sep, 2007
asseca wrote:Use setParameterAutomated() instead of setParameter() ...
in editor class or in effect class?
-
- KVRist
- 38 posts since 21 Jun, 2006 from Los Angeles
Looks like you don't send the parameter change to the editor, try this :
void mdaDelay::setParameter(VstInt32 index, float value)
{
// your code goes here.....
// update the editor
if (editor)
((AEffGUIEditor*)editor)->setParameter (index, value);
}
void mdaDelay::setParameter(VstInt32 index, float value)
{
// your code goes here.....
// update the editor
if (editor)
((AEffGUIEditor*)editor)->setParameter (index, value);
}
-
- KVRAF
- 1981 posts since 29 Feb, 2004
In CPluginEditor::valueChanged(), which is automatically called when a user changes a value by moving a control on the GUI, you call Plugin->setParamameterAutomated().suncica2222 wrote:asseca wrote:Use setParameterAutomated() instead of setParameter() ...
in editor class or in effect class?
-
- KVRAF
- 1940 posts since 16 Aug, 2004 from Vienna, Austria
-
- KVRAF
- 1981 posts since 29 Feb, 2004
arakula wrote:Now that's cool new functionasseca wrote:[...] Plugin->setParamameterAutomated().
Too fast copying from own code which bypasses the original effect->setParamameterAutomated() with custom code
-
- KVRist
- Topic Starter
- 60 posts since 20 Sep, 2007
thank you all
this is the right answer
this is the right answer
Nomad26 wrote:Looks like you don't send the parameter change to the editor, try this :
void mdaDelay::setParameter(VstInt32 index, float value)
{
// your code goes here.....
// update the editor
if (editor)
((AEffGUIEditor*)editor)->setParameter (index, value);
}
-
- KVRian
- 522 posts since 19 Jul, 2007 from Netherlands
I disagree.suncica2222 wrote:
this is the right answer
Nomad26 wrote:Looks like you don't send the parameter change to the editor, try this :
void mdaDelay::setParameter(VstInt32 index, float value)
{
// your code goes here.....
// update the editor
if (editor)
((AEffGUIEditor*)editor)->setParameter (index, value);
}
To my mind the DSP part of your plugin NEVER calls into the UI. The UI calls into the DSP part, but in a non-blocking way, if in any way possible.
So may I suggest that you queue up the parameter changes from the DSP component and let the UI read from that. You could even employ two queues and swap out references to minimize locking.
You should also call the setParameterAutomated (from the UI) to notify the host of that parameter value change.
-
AdmiralQuality AdmiralQuality https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=83902
- Banned
- 6657 posts since 10 Oct, 2005 from Toronto, Canada
That's the way it's done in the VST SDK examples, so I'd say that makes it "legal".obiwanjacobi wrote:I disagree.suncica2222 wrote:
this is the right answer
Nomad26 wrote:Looks like you don't send the parameter change to the editor, try this :
void mdaDelay::setParameter(VstInt32 index, float value)
{
// your code goes here.....
// update the editor
if (editor)
((AEffGUIEditor*)editor)->setParameter (index, value);
}![]()
To my mind the DSP part of your plugin NEVER calls into the UI. The UI calls into the DSP part, but in a non-blocking way, if in any way possible.
So may I suggest that you queue up the parameter changes from the DSP component and let the UI read from that. You could even employ two queues and swap out references to minimize locking.
You should also call the setParameterAutomated (from the UI) to notify the host of that parameter value change.
And camsr, I'm not sure what you're asking. Parameters ARE variables.
- KVRAF
- 8476 posts since 12 Feb, 2006 from Helsinki, Finland
I used to PostMessage from setParameter and it worked fine, but have since migrated to just polling changes from the UI with a timer; more predictable performance and none of the locking headache.obiwanjacobi wrote: To my mind the DSP part of your plugin NEVER calls into the UI. The UI calls into the DSP part, but in a non-blocking way, if in any way possible.
-
- KVRAF
- 7577 posts since 17 Feb, 2005
How do I give the effect class scope inside the editor class? Or am I thinking wrong? I figure it needs a pointer but I don't know how. So far, all I have to bring variables from the effect into the editor is:
EffectEditor temp* = static_cast<EffectEditor*>(editor)
and then to assign...
temp->variable
I actually don't remember if I did it this way exactly, but I had to put this into processReplacing and it looked real ugly. I don't quite understand scope yet so any help is appreciated.
In the static_cast above, could the expression be (effect)?
EffectEditor temp* = static_cast<EffectEditor*>(editor)
and then to assign...
temp->variable
I actually don't remember if I did it this way exactly, but I had to put this into processReplacing and it looked real ugly. I don't quite understand scope yet so any help is appreciated.
In the static_cast above, could the expression be (effect)?
-
- KVRAF
- 7577 posts since 17 Feb, 2005
That's exactly what I am doing with VSTGL and the draw() function. But making a simple peak meter is being a headache with the asynchronous updates.mystran wrote:I used to PostMessage from setParameter and it worked fine, but have since migrated to just polling changes from the UI with a timer; more predictable performance and none of the locking headache.obiwanjacobi wrote: To my mind the DSP part of your plugin NEVER calls into the UI. The UI calls into the DSP part, but in a non-blocking way, if in any way possible.

