COCKOS
CONFEDERATED FORUMS
Cockos : REAPER : NINJAM : Forums
Forum Home : Register : FAQ : Members List : Search :
Old 12-18-2017, 02:51 AM   #1
Tunca
Human being with feelings
 
Join Date: Apr 2016
Posts: 152
Default Linking knobs

Hi,

I have an EQ plugin.It has L/R dual mono processing.But i want to it L/R link.

Any easy solution for this?

Thanks.
Tunca is offline   Reply With Quote
Old 12-18-2017, 03:37 PM   #2
Bobflip
Human being with feelings
 
Join Date: Nov 2016
Posts: 203
Default

You'll need to activate the meta flag for controls that are to be modified by other controls like this:

Code:
GetParam(kParameterNameL)->SetIsMeta(true);
GetParam(kParameterNameR)->SetIsMeta(true);
And then in OnParamChange set them like this:

Code:
case kParameterNameL: 
	GetGUI()->SetParameterFromPlug(kParameterNameR, GetParam(kParameterNameL)->Value(), false);
Bobflip is offline   Reply With Quote
Old 12-19-2017, 10:16 AM   #3
Tunca
Human being with feelings
 
Join Date: Apr 2016
Posts: 152
Default

Quote:
Originally Posted by Bobflip View Post
You'll need to activate the meta flag for controls that are to be modified by other controls like this:

Code:
GetParam(kParameterNameL)->SetIsMeta(true);
GetParam(kParameterNameR)->SetIsMeta(true);
And then in OnParamChange set them like this:

Code:
case kParameterNameL: 
	GetGUI()->SetParameterFromPlug(kParameterNameR, GetParam(kParameterNameL)->Value(), false);
Thanks!

But something is wrong,i guess...

When i link knobs,working great.But when i unlink,right knob still depending left knob.But it goes all the way up or down.

Am i doing something wrong?
Tunca is offline   Reply With Quote
Old 12-19-2017, 10:30 AM   #4
Bobflip
Human being with feelings
 
Join Date: Nov 2016
Posts: 203
Default

Well, the code I put in was pretty skeletal, you'll need to put your own if statements to check if Link is activated or not, and you also need to duplicate that code for the R knob, swapping the left and right parameter names over.
Bobflip is offline   Reply With Quote
Old 12-19-2017, 11:09 AM   #5
Tunca
Human being with feelings
 
Join Date: Apr 2016
Posts: 152
Default

Quote:
Originally Posted by Bobflip View Post
Well, the code I put in was pretty skeletal, you'll need to put your own if statements to check if Link is activated or not, and you also need to duplicate that code for the R knob, swapping the left and right parameter names over.
I did what you said.

Created mLink."true" or "false".Duplicated for R knob...

When i unlink,R knob going crazy while playing with L knob.
Tunca is offline   Reply With Quote
Old 12-19-2017, 11:10 AM   #6
Bobflip
Human being with feelings
 
Join Date: Nov 2016
Posts: 203
Default

You need to post code with these types of questions, at the moment the only answer we can give to "am I doing something wrong?" is "probably" ;-)
Bobflip is offline   Reply With Quote
Old 12-19-2017, 11:15 AM   #7
Tunca
Human being with feelings
 
Join Date: Apr 2016
Posts: 152
Default

Oh sorry.

Here is my codes...

Code:
    int Link = GetParam(kLink)->Value();
    if (Link == 0)
      mLink =  false;
    else if (Link == 1)
      mLink = true;
Code:
GetParam(kGainLL)->SetIsMeta(mLink);
GetParam(kGainLR)->SetIsMeta(mLink);
Code:
case kGainLL: 
	GetGUI()->SetParameterFromPlug(kGainLR, GetParam(kGainLL)->Value(), mLink);

case kGainLR: 
	GetGUI()->SetParameterFromPlug(kGainLL, GetParam(kGainLR)->Value(), mLink);
Tunca is offline   Reply With Quote
Old 12-19-2017, 11:29 AM   #8
Bobflip
Human being with feelings
 
Join Date: Nov 2016
Posts: 203
Default

This jumped out:

GetParam(kGainLL)->SetIsMeta(mLink);
GetParam(kGainLR)->SetIsMeta(mLink);

IsMeta is a flag rather than a parameter. change the mLink in the brackets to true.
Bobflip is offline   Reply With Quote
Old 12-20-2017, 03:03 AM   #9
Tunca
Human being with feelings
 
Join Date: Apr 2016
Posts: 152
Default

Quote:
Originally Posted by Bobflip View Post
This jumped out:

GetParam(kGainLL)->SetIsMeta(mLink);
GetParam(kGainLR)->SetIsMeta(mLink);

IsMeta is a flag rather than a parameter. change the mLink in the brackets to true.
Ok but still same.I can't use R knob when unlinked knobs.

R knob shows only all the way up or down.

R knob still depending L knob.If i play with R knob,there is no problem.But if i play with L knob,R knob moving,too while they are unlinked.
Tunca is offline   Reply With Quote
Old 12-20-2017, 03:08 AM   #10
Bobflip
Human being with feelings
 
Join Date: Nov 2016
Posts: 203
Default

It sounds like it's reading the parameter as an int rather than float. Have you set up the control with anything like this?

GetParam(kParamL)->InitDouble("Parameter L", 0.5, 0.0, 1.0, 0.01, "");
Bobflip is offline   Reply With Quote
Old 12-20-2017, 03:13 AM   #11
Tunca
Human being with feelings
 
Join Date: Apr 2016
Posts: 152
Default

Quote:
Originally Posted by Bobflip View Post
It sounds like it's reading the parameter as an int rather than float. Have you set up the control with anything like this?

GetParam(kParamL)->InitDouble("Parameter L", 0.5, 0.0, 1.0, 0.01, "");
Yes,i did like this.

Code:
  GetParam(kGainLL)->InitDouble("GainLL", 0., -18., 18., 0.01, "%");
  GetParam(kGainLL)->SetShape(1.);
  
  GetParam(kGainLR)->InitDouble("GainLR", 0., -18., 18., 0.01, "%");
  GetParam(kGainLR)->SetShape(1.);
Tunca is offline   Reply With Quote
Old 12-20-2017, 03:25 AM   #12
Bobflip
Human being with feelings
 
Join Date: Nov 2016
Posts: 203
Default

Not sure offhand what's causing the issue, but just noticed you also changed the 'false' in the SetParameterFromPlug calls to 'mLink'. It's worth looking over the definitions of these functions when you first use them to get a gist of the variables they require.

This one has a comment saying:
// Normalized means the value is in [0, 1].
void ClampControl(int paramIdx, double lo, double hi, bool normalized);
void SetParameterFromPlug(int paramIdx, double value, bool normalized);

Don't think it'll clear your problem up but it's worth correcting anyway.
Bobflip is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 02:25 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.