COCKOS
CONFEDERATED FORUMS
Cockos : REAPER : NINJAM : Forums
Forum Home : Register : FAQ : Members List : Search :
Old 04-06-2015, 05:43 PM   #1
random_id
Human being with feelings
 
random_id's Avatar
 
Join Date: May 2012
Location: PA, USA
Posts: 356
Default Crazy buttons

I am having an issue with certain buttons on RTAS and AAX. What is happening is that the buttons will no longer switch to the next selection when pressed. I am not sure what is happening, since it is only affecting certain buttons.

Right now, I am trying to debug a button (7 positions). It will cycle through about 2 or 3 positions, and then it won't switch anymore. I am trying to step through everything, but I still can't figure it out.

Any ideas?
__________________
Website: LVC-Audio
random_id is offline   Reply With Quote
Old 04-07-2015, 06:28 AM   #2
random_id
Human being with feelings
 
random_id's Avatar
 
Join Date: May 2012
Location: PA, USA
Posts: 356
Default

OK, I might have found a solution to my problem, but I don't know what ramifications it may have.

In IPlugAAX.cpp (WDL-OL), there is an UpdateParameterNormalizedValue() function. If I comment out the following it appears to work.
Code:
    // if (GetGUI())
    // {
    //   GetGUI()->SetParameterFromPlug(paramIdx, iValue, true);
    // }

    //    OnParamChange(paramIdx);
I think OnParamChange() is being called from multiple locations before the normalized value of the control (mValue) is being set.

Is anyone able to check this. I think you could figure it out by running AAX in debug mode and checking how many times OnParamChange() is being called when you click an ISwitchControl() (regardless of the number of switch positions).

I will do more testing. If I leave it commented out, I am not sure if that will impact preset recalls or automation. I also need to check RTAS to see if the issue occurs there.
__________________
Website: LVC-Audio
random_id is offline   Reply With Quote
Old 04-08-2015, 09:54 AM   #3
bozmillar
Human being with feelings
 
bozmillar's Avatar
 
Join Date: Sep 2009
Posts: 623
Default

I'm not sure if this is related to your issue or not, but I've found that if i call anything other than InitDouble on a parameter in PT, it doesn't work correctly. It's been a long time since I've looked in to the issue so I don't remember exactly what happens, but I know if I call initInt or InitEnum or initBool, the controls don't work in PT the way they should.

I get around this by just calling initDouble with every param in PT.
__________________
http://www.bozdigitallabs.com
bozmillar is offline   Reply With Quote
Old 04-14-2015, 10:52 AM   #4
pylorca
Human being with feelings
 
Join Date: Apr 2009
Posts: 191
Default

A similar problem https://github.com/olilarkin/wdl-ol/issues/18
pylorca is offline   Reply With Quote
Old 05-25-2015, 10:05 AM   #5
gstuff
Human being with feelings
 
Join Date: Feb 2014
Posts: 63
Default

I found that to get InitBool parameters to work in RTAS I needed to populate the display text values eg:

GetParam(kLFBypass)->SetDisplayText(0, "Off");
GetParam(kLFBypass)->SetDisplayText(1, "On");


In IPlugProcess.cpp::EffectInit - CPluginControl_List controls are created for kTypeEnum and kTypeBool types,
which I assume counts the number of display strings passed in to set the number of control states.
If there aren't any strings, it just defaults to one state so you can't select it.

Last edited by gstuff; 05-25-2015 at 10:13 AM.
gstuff is offline   Reply With Quote
Old 06-30-2015, 12:59 PM   #6
pylorca
Human being with feelings
 
Join Date: Apr 2009
Posts: 191
Default

Quote:
Originally Posted by random_id View Post
OK, I might have found a solution to my problem, but I don't know what ramifications it may have.

In IPlugAAX.cpp (WDL-OL), there is an UpdateParameterNormalizedValue() function. If I comment out the following it appears to work.
Code:
    // if (GetGUI())
    // {
    //   GetGUI()->SetParameterFromPlug(paramIdx, iValue, true);
    // }

    //    OnParamChange(paramIdx);
If you comment these lines of code, you can't use automations from pt.

About the bug,
for example, on int parameters (can be bool, enum, integer), 3 positions (0,1,2)

Normalized --- position

for aax internals:
0.0 to 0.49 --- 0
0.5 to 0.99 --- 1
1.0 --- 2

for Iplug:
0.0 to 0.24 --- 0
0.25 to 0.75 --- 1
0.76 to 1 --- 2
pylorca is offline   Reply With Quote
Old 06-30-2015, 01:47 PM   #7
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,645
Default

Quote:
Originally Posted by pylorca View Post
Normalized --- position

for aax internals:
0.0 to 0.49 --- 0
0.5 to 0.99 --- 1
1.0 --- 2

for Iplug:
0.0 to 0.24 --- 0
0.25 to 0.75 --- 1
0.76 to 1 --- 2
Hmm, both are mathematically wrong, but AAX is just plain stupid. For 3 values I would expect this:

>=0 && <1/3 --- 0
>=1/3 && <2/3 --- 1
>=2/3 && <=1 -- 2
Tale is offline   Reply With Quote
Old 06-30-2015, 03:36 PM   #8
olilarkin
Human being with feelings
 
Join Date: Apr 2009
Location: Berlin, Germany
Posts: 1,248
Default

need to look at this at some point. Don't have PT10 any more for RTAS which makes it more tricky. The issue may be something to do with PT params being 32bit values when IPlug's are 64bits
__________________
VirtualCZ | Endless Series | iPlug2 | Linkedin | Facebook
olilarkin is offline   Reply With Quote
Old 07-03-2015, 12:49 PM   #9
pylorca
Human being with feelings
 
Join Date: Apr 2009
Posts: 191
Default

I've found the problem, But I don't know how to fix it...

On IPlugAAX::InformHostOfParamChange(int idx, double normalizedValue)
PT and Iplug normalized values does not match:

Code:
idbg: InformHostOfParamChange GetParam(i)->GetNormalized()=0.000000000000000000
idbg: InformHostOfParamChange normalizedValue=0.000000000000000000

idbg: InformHostOfParamChange GetParam(i)->GetNormalized()=0.250000000000000000
idbg: InformHostOfParamChange normalizedValue=0.250000000000000000

idbg: InformHostOfParamChange GetParam(i)->GetNormalized()=0.500000000000000000
idbg: InformHostOfParamChange normalizedValue=0.500000000058207661

idbg: InformHostOfParamChange GetParam(i)->GetNormalized()=0.750000000000000000
idbg: InformHostOfParamChange normalizedValue=0.750000000116415322

idbg: InformHostOfParamChange GetParam(i)->GetNormalized()=1.000000000000000000
idbg: InformHostOfParamChange normalizedValue=0.999999999941792339
The output dbg was generated by a printf inside the method, the example param: GetParam(kSw4)->InitEnum("ksw4", 0, 4, "");
but it happens with al param types.
pylorca 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 07:16 AM.


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