Plug-ins, Hosts, Apps,
Hardware, Soundware
Developers
(Brands)
Videos Groups
Whats's in?
Banks & Patches
Download & Upload
Music Search
KVR
   
KVR Forum » DSP and Plug-in Development
Thread Read
Cannot link effect parameter to fader on VSTGUI
suncica2222
KVRist
- profile
- pm
PostPosted: Sun Jul 24, 2011 12:48 pm reply with quote
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
^ Joined: 20 Sep 2007  Member: #160675  
asseca
KVRAF
- profile
- pm
- e-mail
PostPosted: Sun Jul 24, 2011 8:51 pm reply with quote
Use setParameterAutomated() instead of setParameter() ...
^ Joined: 29 Feb 2004  Member: #14598  
suncica2222
KVRist
- profile
- pm
PostPosted: Mon Jul 25, 2011 2:07 am reply with quote
asseca wrote:
Use setParameterAutomated() instead of setParameter() ...



in editor class or in effect class?
^ Joined: 20 Sep 2007  Member: #160675  
Nomad26
KVRist
- profile
- pm
- e-mail
- www
PostPosted: Mon Jul 25, 2011 6:03 am reply with quote
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);
}
^ Joined: 20 Jun 2006  Member: #111030  Location: Los Angeles
asseca
KVRAF
- profile
- pm
- e-mail
PostPosted: Mon Jul 25, 2011 7:17 am reply with quote
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().
^ Joined: 29 Feb 2004  Member: #14598  
arakula
KVRAF
- profile
- pm
- e-mail
- www
PostPosted: Mon Jul 25, 2011 8:08 am reply with quote
asseca wrote:
[...] Plugin->setParamameterAutomated().

Now that's cool new function Cool
----
"Until you spread your wings, you'll have no idea how far you can walk."
^ Joined: 16 Aug 2004  Member: #37236  Location: Vienna, Austria
asseca
KVRAF
- profile
- pm
- e-mail
PostPosted: Mon Jul 25, 2011 8:51 am reply with quote
arakula wrote:
asseca wrote:
[...] Plugin->setParamameterAutomated().

Now that's cool new function Cool
Embarassed effect->setParamameterAutomated() ...

Too fast copying from own code which bypasses the original effect->setParamameterAutomated() with custom code Wink
^ Joined: 29 Feb 2004  Member: #14598  
suncica2222
KVRist
- profile
- pm
PostPosted: Tue Jul 26, 2011 1:02 am reply with quote
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);
}
^ Joined: 20 Sep 2007  Member: #160675  
camsr
KVRAF
- profile
- pm
PostPosted: Fri Apr 06, 2012 1:01 pm reply with quote
Could someone give an example of how to do this with a variable, not just the parameters?
^ Joined: 16 Feb 2005  Member: #58183  
obiwanjacobi
KVRist
- profile
- pm
- e-mail
PostPosted: Sat Apr 07, 2012 3:55 am reply with quote
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. Razz

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.
Blog | VST.NET | MIDI.NET
^ Joined: 18 Jul 2007  Member: #155805  Location: Netherlands
AdmiralQuality
KVRAF
- profile
- pm
- e-mail
- www
PostPosted: Sat Apr 07, 2012 1:10 pm reply with quote
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. Razz

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.
^ Joined: 10 Oct 2005  Member: #83902  Location: Toronto, Canada
mystran
KVRAF
- profile
- pm
- e-mail
- www
PostPosted: Sat Apr 07, 2012 1:47 pm reply with quote
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.
----
<- my plugins | my music -> @Soundcloud
^ Joined: 11 Feb 2006  Member: #97939  Location: Helsinki, Finland
camsr
KVRAF
- profile
- pm
PostPosted: Sat Apr 07, 2012 1:56 pm reply with quote
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)?
----
^ Joined: 16 Feb 2005  Member: #58183  
camsr
KVRAF
- profile
- pm
PostPosted: Sat Apr 07, 2012 1:58 pm reply with quote
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.
----
^ Joined: 16 Feb 2005  Member: #58183  
All times are GMT - 8 Hours

Printable version
Page 1 of 1
Display posts from previous:   
ReplyNew TopicPrevious TopicNext Topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Username: Password:  
KVR Developer Challenge 2012