Cannot link effect parameter to fader on VSTGUI

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

Post

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

Post

Use setParameterAutomated() instead of setParameter() ...

Post

asseca wrote:Use setParameterAutomated() instead of setParameter() ...

in editor class or in effect class?

Post

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);
}

Post

suncica2222 wrote:
asseca wrote:Use setParameterAutomated() instead of setParameter() ...

in editor class or in effect class?
In CPluginEditor::valueChanged(), which is automatically called when a user changes a value by moving a control on the GUI, you call Plugin->setParamameterAutomated().

Post

asseca wrote:[...] Plugin->setParamameterAutomated().
Now that's cool new function 8-)
"Until you spread your wings, you'll have no idea how far you can walk." Image

Post

arakula wrote:
asseca wrote:[...] Plugin->setParamameterAutomated().
Now that's cool new function 8-)
:oops: effect->setParamameterAutomated() ...

Too fast copying from own code which bypasses the original effect->setParamameterAutomated() with custom code :wink:

Post

thank you all


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);
}

Post

Could someone give an example of how to do this with a variable, not just the parameters?

Post

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);
}
I disagree. :P

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.
Grtx, Marc Jacobi.
VST.NET | MIDI.NET

Post

obiwanjacobi wrote:
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);
}
I disagree. :P

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.
That's the way it's done in the VST SDK examples, so I'd say that makes it "legal". :shrug:

And camsr, I'm not sure what you're asking. Parameters ARE variables.

Post

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.
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.

Post

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)?

Post

mystran wrote:
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.
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.
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.

Post Reply

Return to “DSP and Plugin Development”