COCKOS
CONFEDERATED FORUMS
Cockos : REAPER : NINJAM : Forums
Forum Home : Register : FAQ : Members List : Search :

Go Back   Cockos Incorporated Forums > Other Software Discussion > WDL users forum

Reply
 
Thread Tools Display Modes
Old 10-27-2020, 09:57 AM   #1
Nonlinear
Human being with feelings
 
Join Date: Apr 2018
Posts: 363
Default SetCanAutomate() and Bool/Int parameters not working right in VST2 - SOLVED

Just discovered some new problems in iPlug - oddly enough in an "old" standard, VST2.

I have several parameters that SHOULD be hidden from automation using SetCanAutomate(false) but yet they still show up in DAWs as automatable parameters.

I also have several parameters declared as "Bool" and "Int" types but they do not snap to discrete values in automation lanes, they have a continuous range 0.0-1.0.

Both of these issues ONLY happen in VST2 - everything works as it should in VST3, AU and AAX versions.

Anyone come across these issues? Must be something in iPlugVST but what?

Last edited by Nonlinear; 11-01-2020 at 05:00 PM.
Nonlinear is offline   Reply With Quote
Old 10-31-2020, 10:09 AM   #2
Nonlinear
Human being with feelings
 
Join Date: Apr 2018
Posts: 363
Default

It turns out the reason SetCanAutomate() doesn't work in VST2 is because it was never implemented in iPlugVST.cpp

Thank you to TALE for suggesting the fix!

WAS:
Code:
case effCanBeAutomated:
      {
          return 1;
      }
CHANGE TO:
Code:
case effCanBeAutomated:
	{
		if (idx >= 0 && idx < _this->NParams())
		{
			return (_this->GetParam(idx)->GetCanAutomate() ? 1 : 0);
		}
		return 0;
	}

Still no explanation of why Bool/Int types don't work right. VST2 seems to make all parameters float types (Double) with continuous vs. discrete values.

Last edited by Nonlinear; 11-01-2020 at 08:56 AM.
Nonlinear is offline   Reply With Quote
Old 11-01-2020, 09:15 AM   #3
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,150
Default

Quote:
Originally Posted by Nonlinear View Post
Still no explanation of why Bool/Int types don't work right. VST2 seems to make all parameters Double type with continuous vs. discrete values.
It's probably because effGetParameterProperties isn't implemented. To fix this you could do something like this:

Code:
case effGetParameterProperties:
{
    if (ptr && idx >= 0 && idx < _this->NParams())
    {
        VstParameterProperties* pp = (VstParameterProperties*) ptr;
        IParam* pParam = _this->GetParam(idx);
        strcpy(pp->label, pParam->GetNameForHost());
        switch (pParam->Type())
        {
            case IParam::kTypeBool:
            {
                pp->flags = kVstParameterIsSwitch;
                break;
            }
            // case IParam::kTypeInt:
            case IParam::kTypeEnum:
            {
                pp->flags = kVstParameterUsesIntegerMinMax | kVstParameterUsesIntStep;
                pp->minInteger = (int) pParam->GetMin();
                pp->maxInteger = (int) pParam->GetMax();
                pp->largeStepInteger = pp->stepInteger = 1;
                break;
            }
        }
        return 1;
    }
    return 0;
}
Note that you could do the same for kTypeInt as for kTypeEnum, but IMHO int automation is better off being treated like float. Also note that changing this *might* mess up existing automation, depending on the host.
Tale is offline   Reply With Quote
Old 11-01-2020, 02:10 PM   #4
Nonlinear
Human being with feelings
 
Join Date: Apr 2018
Posts: 363
Default

Tale,

Thank you so much for taking the time to develop this code and post it here. Much appreciated. 👍
Nonlinear 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:11 PM.


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