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 04-01-2020, 07:59 AM   #1
Nonlinear
Human being with feelings
 
Join Date: Apr 2018
Posts: 396
Default Sidechain pain - AU side chain issues SOLVED

I'm working to implement sidechaining in one of my plugins and I am finding it to be quite a challenge. What works in AAX and VST3 doesn't work in VST2; what works in one DAW doesn't work in another DAW, etc.

I have studied the SideChain example as well as every related thread on this forum but there doesn't seem to be a consensus on approach.

I have tried to make the plugin "self connecting" to sidechain signals by using the IsInChannelConnected() functions but as others here have commented it doesn't always work. Some hosts show connected to channels 3 & 4 of a “4-2” plugin, for example, but then don't apply signals there.

So I am wondering how everyone else is doing this. Is it necessary to put a "switch" on the plugin GUI to turn sidechaining on/off PLUS use the "4-2" configuration, etc.? Or is there an automatic sidechain detection approach that generally works everywhere?

Any tips greatly appreciated!

UPDATE - SOLVED by Tale! - please see posts at bottom of this thread

Last edited by Nonlinear; 08-06-2020 at 05:12 PM.
Nonlinear is offline   Reply With Quote
Old 04-02-2020, 03:16 AM   #2
olilarkin
Human being with feelings
 
Join Date: Apr 2009
Location: Berlin, Germany
Posts: 1,248
Default

side chain is quite the PITA

i still have to implement it for iPlug2
__________________
VirtualCZ | Endless Series | iPlug2 | Linkedin | Facebook
olilarkin is offline   Reply With Quote
Old 04-02-2020, 10:25 AM   #3
Nonlinear
Human being with feelings
 
Join Date: Apr 2018
Posts: 396
Default

Quote:
Originally Posted by olilarkin View Post
side chain is quite the PITA

i still have to implement it for iPlug2
One thing I have done that helped mitigate the issues was to place a "Side chain input" switch on the UI. That takes care of some of the internal switching issues (user selects internal or external side chain input).

This "switch" is common on plugins I use from other developers and is, perhaps, part of the trick to making side chaining work everywhere. It seems we can't rely on the signals from the hosts to do this switching. Maybe this is already well known here but just thought I'd mention it.

As far as iPlug1, it seems there are many interface issues in iPlugVST3.cpp. My side chain setup currently works in DAWs but it crashes Tracktions "Pluginval" with this error:

if (mScChans && numIns == 2) // numIns = num Input BUSes
Exception thrown at 0x00007FFDC3BEA859 in pluginval.exe: Microsoft C++ exception: std:: out_of_range at memory location 0x00000080A4AFCAD0.
if (mScChans && numIns == 2) // numIns = num Input BUSes
Exception thrown at 0x00007FFDC3BEA859 in pluginval.exe: Microsoft C++ exception: std:: out_of_range at memory location 0x00000080A4AFA5A0.

So there is an I/O issue somewhere - which is weird because it works! Any advice on what could be wrong here? Code in that block of iPlugVST3.cpp (setBusArrangements) seems to make sense.

Last edited by Nonlinear; 04-02-2020 at 11:21 AM.
Nonlinear is offline   Reply With Quote
Old 04-02-2020, 03:11 PM   #4
Nonlinear
Human being with feelings
 
Join Date: Apr 2018
Posts: 396
Default

Quick question - the "setBusArrangements" block in iPlugVST3.cpp has a final return value of "kResultFalse". The purpose of this block is to check and set up all the I/O buses - shouldn't the final result at the end of all the checking and set up be "kResultTrue"?

I have tried it both ways and it doesn't seem to make any difference. Why not?
Nonlinear is offline   Reply With Quote
Old 04-02-2020, 03:46 PM   #5
olilarkin
Human being with feelings
 
Join Date: Apr 2009
Location: Berlin, Germany
Posts: 1,248
Default

- I would suggest using the steinberg vst3 validator rather than pluginval for testing this stuff. It's made by steinberg for testing vst3 conformity.

- also I would not assume the WDL-OL "iPlug1" VST3 implementation is correct. Check the VST3 docs.

https://steinbergmedia.github.io/vst...stsdk/faq.html

- that return kResultFalse at the end, would not be hit in the case of correct busses, in which case the method returns kResultTrue at an earlier stage. In theory
__________________
VirtualCZ | Endless Series | iPlug2 | Linkedin | Facebook
olilarkin is offline   Reply With Quote
Old 04-02-2020, 06:42 PM   #6
Nonlinear
Human being with feelings
 
Join Date: Apr 2018
Posts: 396
Default

Quote:
Originally Posted by olilarkin View Post
- I would suggest using the steinberg vst3 validator rather than pluginval for testing this stuff. It's made by steinberg for testing vst3 conformity.

- also I would not assume the WDL-OL "iPlug1" VST3 implementation is correct. Check the VST3 docs.

https://steinbergmedia.github.io/vst...stsdk/faq.html

- that return kResultFalse at the end, would not be hit in the case of correct busses, in which case the method returns kResultTrue at an earlier stage. In theory
Yes, understand. I will be checking through the VST3 docs as well.

In the meantime I found the cause of the crash in pluginval. It seems to be with this line narrowed down from my post above:

bus = FCast<AudioBus>(audioInputs.at(1));

Apparently pluginval checks some SpeakerArr that is not recognized. I commented out this line and then set the sidechain buses directly without the "if (bus && (SpeakerArr::getChannelCount(bus->getArrangement()) != reqNumSideChainChannels))" check.

It validates with zero errors in both Steinberg VST3 Test Host and in pluginval and it works in all the VST3 hosts I tested it in (Cakewalk, Cubase, Wavelab, Reaper) with both mono and stereo inputs as well as mono and stereo side chain inputs (only tested in Windows so far).

So...it LOOKS like it's working - but are there consequences of skirting that "If" check?

Last edited by Nonlinear; 04-02-2020 at 09:03 PM.
Nonlinear is offline   Reply With Quote
Old 05-10-2020, 12:44 PM   #7
random_id
Human being with feelings
 
random_id's Avatar
 
Join Date: May 2012
Location: PA, USA
Posts: 356
Default

Is there any path to side-chain success with Iplug1 and AU? I have also been looking at all the forum posts and trying different things, but it looks like the plugin isn't being recognized as supporting 4 seperate inputs.
__________________
Website: LVC-Audio
random_id is offline   Reply With Quote
Old 05-11-2020, 05:33 AM   #8
olilarkin
Human being with feelings
 
Join Date: Apr 2009
Location: Berlin, Germany
Posts: 1,248
Default

what format are you having trouble with?
__________________
VirtualCZ | Endless Series | iPlug2 | Linkedin | Facebook
olilarkin is offline   Reply With Quote
Old 05-11-2020, 06:21 AM   #9
random_id
Human being with feelings
 
random_id's Avatar
 
Join Date: May 2012
Location: PA, USA
Posts: 356
Default

Quote:
Originally Posted by olilarkin View Post
what format are you having trouble with?
I am having issues with the AU format. In resource.h, I have
PHP Code:
  #define PLUG_CHANNEL_IO "2-2 4-2"
  #define PLUG_SC_CHANS 2 
I have tried other channel settings as well, but Reaper does not appear to recognize the plugin as having side chain input support.

I am stepping through the debugger at this point, but I didn't know if someone had some suggestions based on their own trials.
__________________
Website: LVC-Audio
random_id is offline   Reply With Quote
Old 05-11-2020, 06:43 AM   #10
random_id
Human being with feelings
 
random_id's Avatar
 
Join Date: May 2012
Location: PA, USA
Posts: 356
Default

To make things more confusing:

Reaper: AU sidechain doesn't work
Logic: AU sidechain does work
Studio One3: AU sidechain doesn't work
Live10: AU sidechain does work

All the same code.
__________________
Website: LVC-Audio
random_id is offline   Reply With Quote
Old 05-17-2020, 10:52 AM   #11
stw
Human being with feelings
 
stw's Avatar
 
Join Date: Apr 2012
Posts: 279
Default

I remember sidechaining was a pain in the ar... when i tried to get my plug properly working in different DAWs.
After spending hours with trying to find a proper working #define i gave up and switched to a somewhat brute force approach. But i had to twaek IPlugAU.cpp
If you don't mind to take your hands on it try what works for me.
Code:
My channel definitions in resource.h:

#define PLUG_CHANNEL_IO "2-2 3-2 4-2"
#define PLUG_SC_CHANS 2
Code:
In IPlugAU.cpp add the bottom lines

void IPlugAU::AssessInputConnections()
{
  TRACE;
  IMutexLock lock(this);

  SetInputChannelConnections(0, NInChannels(), false);

  int nIn = mInBuses.GetSize();
  for (int i = 0; i < nIn; ++i)
  {
    BusChannels* pInBus = mInBuses.Get(i);
    InputBusConnection* pInBusConn = mInBusConnections.Get(i);
      
*** Add this ***

      pInBus->mNHostChannels = (GetHost() == kHostAbletonLive)? (i>0)? 0:4 : 2;
      pInBus->mNPlugChannels = 2;
      pInBus->mPlugChannelStartIdx = (i>0)? 2:0;
Don't ask why i came up with the Live exception. It's too long ago that i remember. However with this changes sidechaining works with all AUs in Reaper, Live, Logic, andStudio One on my side.
stw is offline   Reply With Quote
Old 05-17-2020, 12:50 PM   #12
Nonlinear
Human being with feelings
 
Join Date: Apr 2018
Posts: 396
Default

Quote:
Originally Posted by stw View Post
Code:
#define PLUG_CHANNEL_IO "2-2 3-2 4-2"
Hmm - careful with "3-2". If I remember right that breaks (crashes) Reaper on Windows.
Nonlinear is offline   Reply With Quote
Old 05-17-2020, 02:12 PM   #13
stw
Human being with feelings
 
stw's Avatar
 
Join Date: Apr 2012
Posts: 279
Default

Quote:
Originally Posted by Nonlinear View Post
Hmm - careful with "3-2". If I remember right that breaks (crashes) Reaper on Windows.
hmm... not here.

And for the sake of completeness, here the channel defs for AAX
Code:
#ifdef AAX_API 
#define PLUG_CHANNEL_IO "2-2 3-2"
#define PLUG_SC_CHANS 1
#else
.
.
.
stw is offline   Reply With Quote
Old 05-17-2020, 03:07 PM   #14
Nonlinear
Human being with feelings
 
Join Date: Apr 2018
Posts: 396
Default

Quote:
Originally Posted by stw View Post
hmm... not here.
There are no mono channels in Reaper, AFAIK, so "3-2" doesn’t mean anything in that DAW. Maybe since you also list 2-2 and 4-2 it’s OK? IDK. When I tried 3-2 here it crashed. (But 3-2 IS required for AAX).


My current sidechain code works in Reaper as VST and VST3 but not AU. It shows up as "2/4-in" but when I try to turn on inputs 3/4 the main inputs disappear from the matrix. Reaper’s meters show the plugin is receiving the sidechain input but, as the matrix would indicate, there is no main signal in/out (no sound).

BTW, as with LVC Audio's experience, it DOES work as-is in Logic Pro X.

Will check your AU tweaks. Thank you for posting them.

UPDATE: Yes! AU side chain works properly in Reaper and Logic. Thank you!

Code:
      pInBus->mNHostChannels = (GetHost() == kHostAbletonLive)? (i>0)? 0:4 : 2;
      pInBus->mNPlugChannels = 2;
      pInBus->mPlugChannelStartIdx = (i>0)? 2:0;

Last edited by Nonlinear; 05-17-2020 at 06:13 PM.
Nonlinear is offline   Reply With Quote
Old 05-20-2020, 05:00 AM   #15
random_id
Human being with feelings
 
random_id's Avatar
 
Join Date: May 2012
Location: PA, USA
Posts: 356
Default

I am getting closer, but I am still having some issues with AAX on both the Mac and PC. The KEY in ProTools is not visible to enable sidechaining.

Here is what I am using in resource.h (this was after experimenting with AU, VST, & VST3)

PHP Code:
#ifdef AU_API
#define PLUG_CHANNEL_IO "2-2 4-2"
#define PLUG_SC_CHANS 2
#elif AAX_API
#define PLUG_CHANNEL_IO "2-2 3-2"
#define PLUG_SC_CHANS 1
#elif VST_API
#define PLUG_CHANNEL_IO "2-1 3-2 2-2 4-2"
#define PLUG_SC_CHANS 2
#else
#define PLUG_CHANNEL_IO "2-2 4-2"
#define PLUG_SC_CHANS 2
#endif 

Testing all formats on different OSs are working in Reaper, Live10, Logic, and StudioOne 3 (well, StudioOne struggles with VST unless the plugin is placed on a stereo track).

Does PLUG_TYPE_IDS[], PLUG_TYPE_IDS_AS, or PLUG_DOES_AUDIOSUITE matter?

Does it matter if the PLUG_TYPE_PT isn't Dynamics (it is EQ)?

Is there anything else in resource.h that matters except PLUG_CHANNEL and PLUG_SC_CHANS?
__________________
Website: LVC-Audio
random_id is offline   Reply With Quote
Old 05-20-2020, 05:48 AM   #16
olilarkin
Human being with feelings
 
Join Date: Apr 2009
Location: Berlin, Germany
Posts: 1,248
Default

don't really have time to go into iPlug1 stuff, but i just made this work properly in iPlug2, you might be able to work it out from here

https://github.com/iPlug2/iPlug2/com...b4ec58cb590115
__________________
VirtualCZ | Endless Series | iPlug2 | Linkedin | Facebook
olilarkin is offline   Reply With Quote
Old 05-20-2020, 09:21 AM   #17
Nonlinear
Human being with feelings
 
Join Date: Apr 2018
Posts: 396
Default

Quote:
Originally Posted by random_id View Post
I am getting closer, but I am still having some issues with AAX on both the Mac and PC. The KEY in ProTools is not visible to enable sidechaining.
I had that problem initially too and it turned out there was some code missing from the iPlugAAX .cpp/.h set that I was using. I’m on travel and can’t get to it right now but will post it when I get back on Saturday.

Last edited by Nonlinear; 05-20-2020 at 09:39 AM.
Nonlinear is offline   Reply With Quote
Old 05-20-2020, 02:39 PM   #18
stw
Human being with feelings
 
stw's Avatar
 
Join Date: Apr 2012
Posts: 279
Default

Quote:
Originally Posted by random_id View Post
I am getting closer, but I am still having some issues with AAX on both the Mac and PC. The KEY in ProTools is not visible to enable sidechaining.
I remember that i also made some changes to IPlugAAX.cpp. Sorry, i forgot abaout that. I'll look into it and check if these may have anything to do with that.
stw is offline   Reply With Quote
Old 05-21-2020, 02:40 AM   #19
stw
Human being with feelings
 
stw's Avatar
 
Join Date: Apr 2012
Posts: 279
Default

I looked at my IPlugAAX.cpp but the changes i implemented don't seem to have any influence on the sidechain key itself.
However i remember i took my AAX sidechaining infos from this thread back then:
https://forum.cockos.com/showthread.php?t=167892

Saverio aka Hornet also implemented that and upped it on Github.
https://github.com/hor-net/wdl-ol/bl...g/IPlugAAX.cpp

Maybe it helps...
stw is offline   Reply With Quote
Old 05-21-2020, 06:19 PM   #20
random_id
Human being with feelings
 
random_id's Avatar
 
Join Date: May 2012
Location: PA, USA
Posts: 356
Default

I think I got it. I had to look at the changes made to Saverio's (Hornet's) code. There were changes in IPlugAAX.cpp, IPlugAAX_Describe.cpp, AAX_CIPlugParameters.h, and AAX_CIPlugParameters.cpp.

I also had to make one adjustment to his code in IPlugAAX.cpp. In RenderAudio(), I replaced lines 332 (#ifdef PLUG_SC_CHANS) to 346 (AttachInputBuffers(0, nuInChannels...) with this:

PHP Code:
int totalChannelIn numInChannels;
#ifdef PLUG_SC_CHANS
if (ioRenderInfo->mAudioSideChainAddr) {
printf("sidechain\n");
SetInputChannelConnections(0numInChannelstrue);
SetInputChannelConnections(NInChannels() - 11true);
totalChannelIn NInChannels();

else {
printf("no sidechain\n"); SetInputChannelConnections(0numInChannelstrue);
}
#else
SetInputChannelConnections(0numInChannelstrue);
#endif
printf("attach input buffers: 0 - %d\n"totalChannelIn);
AttachInputBuffers(0totalChannelInioRenderInfo->mAudioInputsnumSamples); 

Without this change, the AttachInputBuffers() never attached the side-chain input and the plugin never received any side-chain data. PT recognized the plugin as a side-chain-enabled plugin, but the side-chain buffers were never correctly connected.

I need to test on the Mac, but this appears to be working now.
__________________
Website: LVC-Audio
random_id is offline   Reply With Quote
Old 07-22-2020, 05:06 AM   #21
random_id
Human being with feelings
 
random_id's Avatar
 
Join Date: May 2012
Location: PA, USA
Posts: 356
Default

Quote:
Originally Posted by stw View Post
I remember sidechaining was a pain in the ar... when i tried to get my plug properly working in different DAWs.
After spending hours with trying to find a proper working #define i gave up and switched to a somewhat brute force approach. But i had to twaek IPlugAU.cpp
If you don't mind to take your hands on it try what works for me.
Code:
My channel definitions in resource.h:

#define PLUG_CHANNEL_IO "2-2 3-2 4-2"
#define PLUG_SC_CHANS 2
Code:
In IPlugAU.cpp add the bottom lines

void IPlugAU::AssessInputConnections()
{
  TRACE;
  IMutexLock lock(this);

  SetInputChannelConnections(0, NInChannels(), false);

  int nIn = mInBuses.GetSize();
  for (int i = 0; i < nIn; ++i)
  {
    BusChannels* pInBus = mInBuses.Get(i);
    InputBusConnection* pInBusConn = mInBusConnections.Get(i);
      
*** Add this ***

      pInBus->mNHostChannels = (GetHost() == kHostAbletonLive)? (i>0)? 0:4 : 2;
      pInBus->mNPlugChannels = 2;
      pInBus->mPlugChannelStartIdx = (i>0)? 2:0;
Don't ask why i came up with the Live exception. It's too long ago that i remember. However with this changes sidechaining works with all AUs in Reaper, Live, Logic, andStudio One on my side.
I have used this modification, and have been running into issues with plugins that use the mono-mono input/output (1:1). If I encase the three new lines (e.g., *** Add this ***) with
Code:
 if (nIn > 1){ ... Added 3 lines... }
it works.
__________________
Website: LVC-Audio
random_id is offline   Reply With Quote
Old 07-22-2020, 10:54 AM   #22
Nonlinear
Human being with feelings
 
Join Date: Apr 2018
Posts: 396
Default

Quote:
Originally Posted by random_id View Post
I have used this modification, and have been running into issues with plugins that use the mono-mono input/output (1:1). If I encase the three new lines (e.g., *** Add this ***) with
Code:
 if (nIn > 1){ ... Added 3 lines... }
it works.
Yes, I think the issue may be with the middle line, "pInBus->mNPlugChannels = 2;" which forces a two channel plugin.

Will try it and mess with this some more and will report back if (when!) I find the fix. Thank you for the suggestions.
Nonlinear is offline   Reply With Quote
Old 08-01-2020, 02:46 PM   #23
Nonlinear
Human being with feelings
 
Join Date: Apr 2018
Posts: 396
Default

Quote:
Originally Posted by stw View Post
I remember sidechaining was a pain in the ar... when i tried to get my plug properly working in different DAWs.
After spending hours with trying to find a proper working #define i gave up and switched to a somewhat brute force approach. But i had to twaek IPlugAU.cpp
If you don't mind to take your hands on it try what works for me.
Code:
My channel definitions in resource.h:

#define PLUG_CHANNEL_IO "2-2 3-2 4-2"
#define PLUG_SC_CHANS 2
Code:
In IPlugAU.cpp add the bottom lines

void IPlugAU::AssessInputConnections()
{
  TRACE;
  IMutexLock lock(this);

  SetInputChannelConnections(0, NInChannels(), false);

  int nIn = mInBuses.GetSize();
  for (int i = 0; i < nIn; ++i)
  {
    BusChannels* pInBus = mInBuses.Get(i);
    InputBusConnection* pInBusConn = mInBusConnections.Get(i);
      
*** Add this ***

      pInBus->mNHostChannels = (GetHost() == kHostAbletonLive)? (i>0)? 0:4 : 2;
      pInBus->mNPlugChannels = 2;
      pInBus->mPlugChannelStartIdx = (i>0)? 2:0;
Don't ask why i came up with the Live exception. It's too long ago that i remember. However with this changes sidechaining works with all AUs in Reaper, Live, Logic, andStudio One on my side.
This does fix AU sidechaining in Reaper - but I don't understand WHY. The input and output buses are already configured in the iPlugAU constructor before this function is called and the code assignments there look correct - in fact it looks like it should work with any I/O configs including full "1-1 2-1 2-2 and 4-2" SC 2.

So it seems something somewhere is CHANGING those settings. When I run debugger during plugin load it shows that AssessInputConnections() is called numerous times. So it seems I/O is being set correctly and then subsequently corrupted by some other function. It's hard to track down with so much interaction and jumping around.

Last edited by Nonlinear; 08-02-2020 at 11:31 AM.
Nonlinear is offline   Reply With Quote
Old 08-03-2020, 03:20 PM   #24
Nonlinear
Human being with feelings
 
Join Date: Apr 2018
Posts: 396
Default

I found another iPlugAU.cpp hack that makes 2-2 4-2 SC 2 work properly in Reaper that does not force a 2 channel configuration.

Instead of adding this to iPlugAU.pp as discussed above:

Code:
      pInBus->mNHostChannels = (GetHost() == kHostAbletonLive)? (i>0)? 0:4 : 2;
      pInBus->mNPlugChannels = 2;
      pInBus->mPlugChannelStartIdx = (i>0)? 2:0;
Change the if (pInBus->mNHostChannels < 0) test further down in that block of code to always be true. This forces the host channels = plugin channels.

Comment out all of this code:
Code:
            if (pInBus->mNHostChannels < 0)
            {
                // The host set up a connection without specifying how many channels in the stream.
                // Assume the host will send all the channels the plugin asks for, and hope for the best.
               // Trace(TRACELOC, "AssumeChannels:%d", pInBus->mNPlugChannels);
                pInBus->mNHostChannels = pInBus->mNPlugChannels;
            }
And replace it with just the assignment line:
Code:
pInBus->mNHostChannels = pInBus->mNPlugChannels;
In other words, ALWAYS assume the host set up a connection without specifying how many channels in the stream.

With this hack 2-2 and 4-2 sidechain configs show up and work properly in Reaper - however this is still a "band aid" for something wrong in iPlugAU.cpp - the CAUSE of which is still TBD.

I have observed in debugger that AssessInputConnections() gets called about a dozen times when a plugin is loaded in a track in a DAW. In the case of Reaper, all is well (both main and SC inputs are connected properly) all the way through the 9th iteration. On the 10th time through the Main inputs become disconnected. Debugger switches to assembly code when I try to view the steps after that 9th call so I have not yet been able to determine what is going wrong between the 9th time and the 10 time through.

It seems that whatever is wrong may also be the reason why iPlugAU cannot handle both mono and stereo with side chains in one plugin (1-1 2-1 2-2 4-2). "IPlugAU::NHostChannelsConnected()" looks suspicious with the "excludeIdx" parameter so maybe the issue is in there, IDK.
Nonlinear is offline   Reply With Quote
Old 08-04-2020, 11:11 AM   #25
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,645
Default

I think I've found a solution, with a little help from Nonlinear. Here is a patch on top of the current WDL-OL master branch:

Code:
diff --git a/WDL/IPlug/IPlugAU.cpp b/WDL/IPlug/IPlugAU.cpp
index 5c00b90..c8c4c7d 100644
--- a/WDL/IPlug/IPlugAU.cpp
+++ b/WDL/IPlug/IPlugAU.cpp
@@ -1071,7 +1071,7 @@ OSStatus IPlugAU::SetProperty(AudioUnitPropertyID propID, AudioUnitScope scope,
       AudioStreamBasicDescription* pASBD = (AudioStreamBasicDescription*) pData;
       int nHostChannels = pASBD->mChannelsPerFrame;
       BusChannels* pBus = GetBus(scope, element);
-      if (!pBus)
+      if (!pBus || nHostChannels > pBus->mNPlugChannels)
       {
         return kAudioUnitErr_InvalidProperty;
       }
Tale is online now   Reply With Quote
Old 08-05-2020, 03:49 AM   #26
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,645
Default

Actually I think I have a better patch instead of the earlier one, which should (hopefully) also fix mono support:

Code:
diff --git a/WDL/IPlug/IPlugAU.cpp b/WDL/IPlug/IPlugAU.cpp
index 5c00b90..95baa1b 100644
--- a/WDL/IPlug/IPlugAU.cpp
+++ b/WDL/IPlug/IPlugAU.cpp
@@ -1075,12 +1075,11 @@ OSStatus IPlugAU::SetProperty(AudioUnitPropertyID propID, AudioUnitScope scope,
       {
         return kAudioUnitErr_InvalidProperty;
       }
-      pBus->mNHostChannels = 0;
       // The connection is OK if the plugin expects the same number of channels as the host is attempting to connect,
       // or if the plugin supports mono channels (meaning it's flexible about how many inputs to expect)
       // and the plugin supports at least as many channels as the host is attempting to connect.
       bool connectionOK = (nHostChannels > 0);
-      connectionOK &= CheckLegalIO(scope, element, nHostChannels);
+      connectionOK &= (nHostChannels <= pBus->mNPlugChannels);
       connectionOK &= (pASBD->mFormatID == kAudioFormatLinearPCM && pASBD->mFormatFlags & kAudioFormatFlagsCanonical);
 
       Trace(TRACELOC, "%d:%d:%s:%s:%s",
Tale is online now   Reply With Quote
Old 08-06-2020, 05:10 PM   #27
Nonlinear
Human being with feelings
 
Join Date: Apr 2018
Posts: 396
Default

Yes, TALE, it works! Even a full 1-1 2-1 2-2 4-2 SC 2 config works!!

Thank you SO much!!

Last edited by Nonlinear; 08-06-2020 at 05:18 PM.
Nonlinear is offline   Reply With Quote
Old 08-06-2020, 05:19 PM   #28
random_id
Human being with feelings
 
random_id's Avatar
 
Join Date: May 2012
Location: PA, USA
Posts: 356
Default

Quote:
Originally Posted by Nonlinear View Post
Yes, TALE it works! Even a full 1-1 2-1 2-2 4-2 SC 2 config works!!

Thank you SO much!!

Just to be clear, what are the changes that need to be in IPlugAU.cpp to make all of this work? Is it just Tale's latest code tweak, or is it a combination of some of the previous tweaks?
__________________
Website: LVC-Audio
random_id is offline   Reply With Quote
Old 08-09-2020, 11:48 AM   #29
Nonlinear
Human being with feelings
 
Join Date: Apr 2018
Posts: 396
Default

Quote:
Originally Posted by random_id View Post
Just to be clear, what are the changes that need to be in IPlugAU.cpp to make all of this work? Is it just Tale's latest code tweak, or is it a combination of some of the previous tweaks?
Just the final tweak - post #26
Nonlinear is offline   Reply With Quote
Old 08-09-2020, 11:56 AM   #30
random_id
Human being with feelings
 
random_id's Avatar
 
Join Date: May 2012
Location: PA, USA
Posts: 356
Default

Can anyone test SC with this configuration in Ableton Live? I had to tweak things to make Ableton work with Tale's change.
__________________
Website: LVC-Audio
random_id 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:17 AM.


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