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-07-2020, 07:18 PM   #1
Ric Vega
Human being with feelings
 
Join Date: May 2020
Posts: 19
Default IPlug 2: how to set "mono -> stereo"?

Hi everyone.

I have a simple question. How to get your plugin to give you the "mono -> stereo" option? I thought it would be just a matter of changing the line:

#define PLUG_CHANNEL_IO "1-1 2-2"

to..

#define PLUG_CHANNEL_IO "1-1 1-2 2-2"

..in "config.h" (i.e. adding the 1-2 option). However this doesn't seem to be enough.

So, assuming I start by duplicating the IPlugEffect project.. how can I then let the plugin include the "mono -> stereo" option?

Thanks.

I'm using logic by the way.

(note: I've looked in several threads that are more or less related to the IO channels subjects, but without any luck)
Ric Vega is offline   Reply With Quote
Old 10-28-2020, 04:49 PM   #2
Ric Vega
Human being with feelings
 
Join Date: May 2020
Posts: 19
Default

Anyone?

l still haven't figured this out. l thought the solution would have been a trivial one.

Surely WDL supports "mono -> stereo", right?
Ric Vega is offline   Reply With Quote
Old 11-01-2020, 02:18 PM   #3
Nonlinear
Human being with feelings
 
Join Date: Apr 2018
Posts: 396
Default

I haven’t worked with iPlug2 but the code you have asked about here looks like iPlug1.

1-1 1-2 2-2 should work - but I did have a lot of trouble getting iPlug1 sidechaining to work in Logic (similar I/O issues). Please see my posts on this forum about sidechains in Audio Units. I understand you are not asking about sidechains but maybe you will find a nugget in there that might help you with 1-2.


BTW - I don’t know this for a fact but it appears that Logic’s plugin validation process actually passes a signal into the plugin and checks for support of all stated configurations. If your input/output read pointers are not set up right it will fail validation. Again, check the posts here about AU channel routing.

Last edited by Nonlinear; 11-01-2020 at 09:29 PM.
Nonlinear is offline   Reply With Quote
Old 11-01-2020, 10:03 PM   #4
Ric Vega
Human being with feelings
 
Join Date: May 2020
Posts: 19
Default

Yes, I have read extensively about the IO issues in this forum. And you're right about Logic, some 3rd party plugins have had issues keeping support for their special IO configurations. It may be that Logic's evaluation has become stricter than before, especially after 10.5..

I am going to try with the most minimal plugin, to make sure I am not getting it wrong somewhere and see if I can ultimately make it work.

Thanks for your advice. I will keep searching for the cause of the problem.
Ric Vega is offline   Reply With Quote
Old 11-02-2020, 11:54 AM   #5
Nonlinear
Human being with feelings
 
Join Date: Apr 2018
Posts: 396
Default

Quote:
Originally Posted by Ric Vega View Post
I am going to try with the most minimal plugin, to make sure I am not getting it wrong somewhere and see if I can ultimately make it work.
Yes, that is how I went about it as well.

I believe iPlug requires I/O stereo pairs even if only processing mono. Again, I am not using iPlug2 but just as an I/O test you might try something like this:

Code:
  STEREOOUT = IsOutChannelConnected(1);
  in2ic = IsInChannelConnected(1);
 
  in1 = inputs[0];//--------------Mono in/out
  in2 = inputs[0];
  
  out1 = outputs[0];
  out2 = outputs[0];
  
  if(!in2ic && STEREOOUT)//-------Mono in/ stereo out
  {
    in1 = inputs[0];
    in2 = inputs[0];

    out1 = outputs[0];
    out2 = outputs[1];
  }
  
  if(in2ic && STEREOOUT)//--------Stereo in/out
  {
    in1 = inputs[0];
    in2 = inputs[1];
    
    out1 = outputs[0];
    out2 = outputs[1];
  }
  
 	for (int s = 0; s < nFrames; ++s, ++in1, ++in2, ++out1, ++out2)
	{
		leftin = *in1;
		rightin = *in2;

		*out1 = leftin;
		*out2 = rightin;
        }
ALSO - VERY IMPORTANT - make sure you reboot your Mac between build tests. Just refreshing the plugin manager in Logic doesn't always seem to pick up changes. Delete your AudioUnits cache folder before rebooting to make sure Logic loads your newest build and not some previous one!

I have found that getting plugins to work in Logic can be quite a PITA. A plugin can pass validation and still refuse to load. IMO, that is a major flaw in Logic's validation process. If it says it's good it should work!

Last edited by Nonlinear; 11-02-2020 at 12:05 PM.
Nonlinear is offline   Reply With Quote
Old 11-02-2020, 03:32 PM   #6
Ric Vega
Human being with feelings
 
Join Date: May 2020
Posts: 19
Default

Thank you, l will try this code and see what happens!

Fortunately though, l haven't had problems with Logic updating the plugin as l make it. lPlug2 builds directly on the Components folder and all updates are immediately recognised by the host. In fact l do the opposite, l remove "clear AU cache" from the Build Phases because it really wasn't necessary and it took a long time to load. (I always make sure to change some text here and there to be certain that it's running the latest version, though).

I raised this issue in the IPlug2 forum and at least Oli made sure that the plugin was correctly validated with the "1-1 1-2 2-2" configuration, the only problem being that -for some reason- Logic doesn't let you insert the "mono->stereo" version in the effects inserts.
Ric Vega is offline   Reply With Quote
Old 11-02-2020, 05:10 PM   #7
Nonlinear
Human being with feelings
 
Join Date: Apr 2018
Posts: 396
Default

On my system (Mojave) Reaper reads immediate build changes to AU plugins but Logic does not and requires a reboot. AFAIK this requirement began with High Sierra.

Quote:
Originally Posted by Ric Vega View Post
the plugin was correctly validated with the "1-1 1-2 2-2" configuration, the only problem being that -for some reason- Logic doesn't let you insert the "mono->stereo" version in the effects inserts.
Yes - and it’s frustrating! Logic can validate a plugin “All Passed” but yet it refuses to load and doesn’t tell you why. I’ve spent a lot of time trying to fix such situations. You will eventually get it solved. When you do please post here!

Last edited by Nonlinear; 11-02-2020 at 05:17 PM.
Nonlinear is offline   Reply With Quote
Old 11-02-2020, 09:09 PM   #8
Ric Vega
Human being with feelings
 
Join Date: May 2020
Posts: 19
Default

Quote:
Originally Posted by Nonlinear View Post
On my system (Mojave) Reaper reads immediate build changes to AU plugins but Logic does not and requires a reboot. AFAIK this requirement began with High Sierra.



Yes - and it’s frustrating! Logic can validate a plugin “All Passed” but yet it refuses to load and doesn’t tell you why. I’ve spent a lot of time trying to fix such situations. You will eventually get it solved. When you do please post here!
I will let you know if I find a solution!

but just now l've been having other problems.. validation crashing with this error:

"ERROR: Class Data fields aufx, Qnqr, 00526963 do not match component description"

where Qnqr is the plugin unique ID..

So yeah, Logic as starting to become a nightmare lately.. l don't even know where to start :/
Ric Vega is offline   Reply With Quote
Old 11-03-2020, 08:34 AM   #9
Ric Vega
Human being with feelings
 
Join Date: May 2020
Posts: 19
Default

Quote:
Originally Posted by Nonlinear View Post
You will eventually get it solved. When you do please post here!
I'm here to let you know that it finally works. The IPlug2 thread with the solution is here:

https://iplug2.discourse.group/t/imp...-stereo/240/11

Thanks again for all the help!
Ric Vega is offline   Reply With Quote
Old 11-03-2020, 09:56 AM   #10
Nonlinear
Human being with feelings
 
Join Date: Apr 2018
Posts: 396
Default

Quote:
Originally Posted by Ric Vega View Post
I'm here to let you know that it finally works. The IPlug2 thread with the solution is here:

https://iplug2.discourse.group/t/imp...-stereo/240/11

Thanks again for all the help!
Hmm...not sure what your code is doing - looks like it's all stereo processing (If (in/out) > 1). How are you setting up 1 in to 2 out?

Last edited by Nonlinear; 11-03-2020 at 10:42 AM.
Nonlinear is offline   Reply With Quote
Old 11-03-2020, 01:12 PM   #11
Ric Vega
Human being with feelings
 
Join Date: May 2020
Posts: 19
Default

Quote:
Originally Posted by Nonlinear View Post
Hmm...not sure what your code is doing - looks like it's all stereo processing (If (in/out) > 1). How are you setting up 1 in to 2 out?
I made a minimal plugin as l mentioned above in which I try the three main configurations (mono, stereo, and mono->stereo), if the plugin is stereo l merely swap the channels, if it's mono->stereo l apply the gain, and if it's mono l apply the inverse of the gain, that way l can check if the plugin is doing what is expected:

Code:
void Minimal2::ProcessBlock(sample** inputs, sample** outputs, int nFrames)
{
double gain = GetParam(kGain)->Value() / 100.;

// Stereo (swap L and R)
if (NInChansConnected() > 1)
{
    for (int s=0 ; s<nFrames ; ++s)
    {
        outputs[0][s] = inputs[1][s];
        outputs[1][s] = inputs[0][s];
    }
}

else
{   // Mono -> Stereo (apply gain)
    if (NOutChansConnected() > 1)
    {
        for (int s=0 ; s<nFrames ; ++s)
        {
            outputs[0][s] = inputs[0][s] * gain;
            outputs[1][s] = inputs[0][s] * gain;
        }
    }
    
    else
    {
        // Mono (apply inverse gain)
        for (int s=0 ; s<nFrames ; ++s)
        {
            outputs[0][s] = inputs[0][s] * (1.0 - gain);
        }
    }
}
}
Ric Vega is offline   Reply With Quote
Old 11-03-2020, 10:00 PM   #12
Nonlinear
Human being with feelings
 
Join Date: Apr 2018
Posts: 396
Default

OK - got it. I’m going to try this on iPlug1 and see if it works there. I haven’t had a need for 1-2 config yet but it will be good to have the capability. Thanks for posting.
Nonlinear is offline   Reply With Quote
Old 11-04-2020, 07:33 AM   #13
Ric Vega
Human being with feelings
 
Join Date: May 2020
Posts: 19
Default

Quote:
Originally Posted by Nonlinear View Post
OK - got it. I’m going to try this on iPlug1 and see if it works there. I haven’t had a need for 1-2 config yet but it will be good to have the capability. Thanks for posting.
Thank you for joining the thread
Ric Vega 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 01:58 AM.


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