COCKOS
CONFEDERATED FORUMS
Cockos : REAPER : NINJAM : Forums
Forum Home : Register : FAQ : Members List : Search :
Old 04-02-2016, 11:04 PM   #1
earlevel
Human being with feelings
 
Join Date: Dec 2015
Posts: 327
Default AAX problem automating buttons

I guess this is related to the bool (etc.) parameter issues, because I changes one control to double, and it worked:

My pushbuttons work just fine—until I automate them. Then they apparently follow the mouse up with another mouse up/down and the button essentially stays in the same state it started. Any thoughts? A little hard to get a handle on what problems still exist in wdl-ol, since the issues are spread over a few years—and any mention of AAX is sparse. Hoping I can stick with wdl-ol for these plug-ins...

(And nice forum search feature—search "aax"—nope, nothing here...have to google the forum...)
earlevel is offline   Reply With Quote
Old 04-03-2016, 03:48 AM   #2
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,045
Default

I have no info for you, sorry! However, I can say that Avid's NDA seems to prevent any serious public online discussion about AAX. Of course we can discuss Pro Tools features, but apparently we can't discuss the internal API calls behind these features... Anyway, I guess that is partly why it is hard to find much about AAX.

Last edited by Tale; 04-03-2016 at 04:57 AM.
Tale is offline   Reply With Quote
Old 04-03-2016, 09:43 AM   #3
earlevel
Human being with feelings
 
Join Date: Dec 2015
Posts: 327
Default

Yeah...well, I take my chances I'll see if I can figure this out today...
earlevel is offline   Reply With Quote
Old 04-03-2016, 10:17 AM   #4
olilarkin
Human being with feelings
 
Join Date: Apr 2009
Location: UK
Posts: 1,194
Default

check this branch may fix the issues https://github.com/olilarkin/wdl-ol/tree/AAXParams
__________________
VirtualCZ | pMix | Endless Series | iPlug2 | Linkedin | Facebook
Available for Audio Dev tuition via Skype (IPlug/JUCE/C++)
olilarkin is offline   Reply With Quote
Old 04-03-2016, 10:20 AM   #5
stw
Human being with feelings
 
stw's Avatar
 
Join Date: Apr 2012
Posts: 250
Default

I got some automation probs as well. I don't know if they're affiliated to your issue but both share the mouse up events somehow.
Unfortunately i couldn't find the reason behind but at least i could find a workaround for it.
Maybe it helps tracking down the cause... Good luck!

http://forum.cockos.com/showthread.php?t=168683
stw is offline   Reply With Quote
Old 04-03-2016, 11:19 AM   #6
earlevel
Human being with feelings
 
Join Date: Dec 2015
Posts: 327
Default

In the automation view, I see that the minimum value is "off", and the maximum value is "off". Even when I explicitly SetDIsplayText for max to be "on". So, it's probably something to do with the different interpretation of values, and that's why my button automatically cycle back to the off position when automation is enabled.

Add: Yes, definitely a discrepancy with all discrete controls. I have an 11-step control, 0-10. I can automate it, but both position 9 and 10 read out in PT as "9.00" (and yes it's an int control in steps of 1).

Last edited by earlevel; 04-03-2016 at 12:00 PM.
earlevel is offline   Reply With Quote
Old 04-03-2016, 01:52 PM   #7
earlevel
Human being with feelings
 
Join Date: Dec 2015
Posts: 327
Default

Quote:
Originally Posted by olilarkin View Post
check this branch may fix the issues https://github.com/olilarkin/wdl-ol/tree/AAXParams
Thanks, Oli, I didn't see this right away, but I've tested it now, and the the buttons behave correctly with this branch. I still have the issue that the maximum value of ints/bools is wrong in the automation display (off,off, etc.), taking a look at how to deal with that...
earlevel is offline   Reply With Quote
Old 04-03-2016, 02:25 PM   #8
earlevel
Human being with feelings
 
Join Date: Dec 2015
Posts: 327
Default

OK, it's easy to see that the problem with the text value that Pro Tools shows is an issue with rounding, by bringing up any Pro Tools plugin with automatable stepped controls.

Native AAX plugin: If you drag up, the switch to the next level comes half-way between levels (an on/off button switches to "on" at 50% and above). So, for an integer control with three steps, and readout 1,2,3, a proper plug-in switches from 1 to 2, dragging up from the bottom, as it crosses half the step height, ~25% (of height of automation lane), then to 3 at ~75%.

A similar parameter in wdl-ol switches 1 to 2 at ~50%, displaying "2", then switches next at ~100%, displaying..."2".

(This is true of idl-ol-AAXParams as well as wdl-ol. -AAXParams fixes the problem with buttons reverting to off when automated.)
earlevel is offline   Reply With Quote
Old 04-04-2016, 12:57 AM   #9
earlevel
Human being with feelings
 
Join Date: Dec 2015
Posts: 327
Default

This:
Code:
void IParam::GetDisplayForHost(double value, bool normalized, char* rDisplay, bool withDisplayText)
{
  if (normalized) value = FromNormalizedParam(value, mMin, mMax, mShape);

  if (withDisplayText)
  {
    const char* displayText = GetDisplayText( (int) value);  <=======
Change to:
Code:
    const char* displayText = GetDisplayText((int) (value + 0.5))
I'll take a closer look in the morning to make sure that doesn't hurt anything else, but I doubt it.
earlevel is offline   Reply With Quote
Old 04-11-2016, 02:58 PM   #10
earlevel
Human being with feelings
 
Join Date: Dec 2015
Posts: 327
Default

One additional change in GetDisplayForHost needed:
Code:
was:
    sprintf(rDisplay, "%d", int(displayValue));
new:
    sprintf(rDisplay, "%d", int(displayValue + 0.5));
All my controls seems to work fine without it, so I almost missed it, but found that a particularly large integer control (0-400) would display as max 399. It ends up PT was sending the plugin 399.99999990686774 (setting my control text to "400", due to my other fix, but giving "399" back to PT to display while dragging control points to max). I suppose PT is taking the plugin parameter's 0-400 range and calculating an increment to multiply by the the control point vertical—and falling short of max due to quantization.
earlevel is offline   Reply With Quote
Old 04-23-2016, 10:37 AM   #11
earlevel
Human being with feelings
 
Join Date: Dec 2015
Posts: 327
Default

Quote:
Originally Posted by olilarkin View Post
check this branch may fix the issues https://github.com/olilarkin/wdl-ol/tree/AAXParams
I've been using this, but...

First, it short-circuits and comments out the SetNumberOfSteps setup for the various parameter data types—essentially, everything becomes a double with 55 steps, as far as PT is concerned. This is not acceptable for my plugin. I started to code my own implementation, then realized the needed code is just commented out. Why? Is there a conflict with it and the other changes you've made?
earlevel is offline   Reply With Quote
Old 04-23-2016, 10:41 AM   #12
olilarkin
Human being with feelings
 
Join Date: Apr 2009
Location: UK
Posts: 1,194
Default

I haven't looked at this stuff for months i'm afraid and I can't remember exactly why that got commented out. I recently quit my day job I now have much more time to think about these things, so hoping to freshen up WDL-OL in the near future.
__________________
VirtualCZ | pMix | Endless Series | iPlug2 | Linkedin | Facebook
Available for Audio Dev tuition via Skype (IPlug/JUCE/C++)
olilarkin is offline   Reply With Quote
Old 04-23-2016, 11:14 AM   #13
earlevel
Human being with feelings
 
Join Date: Dec 2015
Posts: 327
Default

OK, thanks Oli.

If you don't mind giving me some guidance here, I'm new to GIT and I'm unsure about the best way to work with it. (I've used other version control systems, but it's been a while, lots different, and I was always fully in charge.)

First, I was having trouble doing what wanted (I wanted to work with wdl-oli master, but merge in AAXParams) via Xcode, so I went the command line route and merged AAXParams to my local repository of master. I've since downloaded and poked around a bit with GIT Desktop and GITKraken yesterday...

Now, I have several fixes and additions to IPlug, some for AAX, some general, and I'd like to contribute.

Maybe I need to take time to play with how pull requests function (I get the concept), perhaps that would answer my question, but I'm pretty pressed to actually get my plugins done, with limited time (have regular job).

I guess my main question is: Should I be modifying my local wdl-ol master, or should I create a branch and edit that? Which is the best way, considering I'd want to issue multiple pull requests in the future. (I'm not sure at this point whether pull requests target changes for specific commits—obviously I'd want to have separate pull requests for each logical change.)

Thanks
earlevel is offline   Reply With Quote
Old 04-23-2016, 12:47 PM   #14
earlevel
Human being with feelings
 
Join Date: Dec 2015
Posts: 327
Default

Quote:
Originally Posted by olilarkin View Post
I haven't looked at this stuff for months i'm afraid and I can't remember exactly why that got commented out.
There were some notes in the change history about things perhaps not being the "correct" way, maybe related to that. I uncommented (returning to what's in master) and it seems to work. I did have to make a change to AAX_CIPlugTaperDelegate to support my addition for a conversion curve callback to the plug (which moved From/ToNormalizedParam into IParam—I had to change the AAX_CIPlugTaperDelegate constructor to accept and keep the associated IParam pointer and use it for RealToNormalized/NormalizedToReal).
earlevel is offline   Reply With Quote
Old 04-28-2016, 01:35 AM   #15
earlevel
Human being with feelings
 
Join Date: Dec 2015
Posts: 327
Default

I'm seeing problems with ISwitchControls (and similar—buttons that you click on, click off). The button sets a 0.0, or a 1.0 value, and the number of steps are set correctly, so PT's automation shows a snap from "off" to "on". The automation records fine—click it on, records the step up, off, it records the step down. But on playback, PT sends back 0.99999999976716935 for one, and 0 for off—but won't sent the off to the plugin on playback.

Sure, I could modify the buttons to accept anything over half for on for the 0.999...problem, if that was it. On playback, IPlugAAX::UpdateParameterNormalizedValue gets the "on" state (0.999...), but it isn't even called for the "off" state. However, if I set the playback head to somewhere in the "on" state, UpdateParameterNormalizedValue is called and the button switches to on. And when I click in the off state, UpdateParameterNormalizedValue is called with 0 and the button switches off. It's just while playing back that the off never comes through.

Also, I get a similar problem for a switch that has more steps.
earlevel is offline   Reply With Quote
Old 04-29-2016, 03:30 PM   #16
earlevel
Human being with feelings
 
Join Date: Dec 2015
Posts: 327
Default

Quote:
Originally Posted by olilarkin View Post
I haven't looked at this stuff for months i'm afraid and I can't remember exactly why that got commented out.
Maybe it was commented out because it doesn't work right for enums/bools (but neither does AAXParams). I returned to the problem that I'd modified GetStringFromHost (for rounding) to work around the similar issues in AAXParams. Here's the AAX_CParameter instantiation for enum/bool in master:

Code:
        param = new AAX_CParameter<int>(paramID->Get(),
                                        AAX_CString(p->GetNameForHost()),
                                        (int)p->GetDefault(),
                                        AAX_CLinearTaperDelegate<int>((int)p->GetMin(), (int)p->GetMax()),
                                        AAX_CStringDisplayDelegate<int>(displayTexts),
                                        p->GetCanAutomate());
The problem is AAX_CLinearTaperDelegate<int>—there is no rounding. I still don't know why the host returns values like 0.99999999883584678, 0.39999999953433873, etc., but without rounding that causes several quirky issues with automation. It works with <int,1>, or I think the more proper way is AAX_CStateTaperDelegate<int> instead.
earlevel is offline   Reply With Quote
Old 04-29-2016, 03:38 PM   #17
olilarkin
Human being with feelings
 
Join Date: Apr 2009
Location: UK
Posts: 1,194
Default

Is this not something todo with the fact that PT uses 31bits for automation and iplug Params are 64bit
__________________
VirtualCZ | pMix | Endless Series | iPlug2 | Linkedin | Facebook
Available for Audio Dev tuition via Skype (IPlug/JUCE/C++)
olilarkin is offline   Reply With Quote
Old 04-29-2016, 05:11 PM   #18
earlevel
Human being with feelings
 
Join Date: Dec 2015
Posts: 327
Default

Quote:
Originally Posted by olilarkin View Post
Is this not something todo with the fact that PT uses 31bits for automation and iplug Params are 64bit
Yes, I did think of that, and it would explain the 0.9999..., but not some of the other step values that should come out fine in fixed point (0.50000000011641532, 0.24999999959254637, etc.). Anyway, it's unimportant except that the AAX_CLinearTaperDelegate wasn't the right thing in this case.

(The post was much longer and evolved quite a bit in my debugging session until I finally figured out the problem, and by then that sentence was unnecessary but missed getting deleted.)
earlevel 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 10:35 PM.


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