Re: Quick question on configuring an AU for a certain channel config
Re: Quick question on configuring an AU for a certain channel config
- Subject: Re: Quick question on configuring an AU for a certain channel config
- From: "tahome izwah" <email@hidden>
- Date: Wed, 19 Dec 2007 14:04:38 +0100
Thanks to Bill and Sophia I got the sidechain working. I am left with
one minor thing that I can't seem to figure out:
When I set up my plug in in Logic and choose an audio track as
sidechain everything works as expected. However, Logic always reports
that the sidechain is available, no matter if there's actually an
audio track routed to it or not...
So how am I supposed to figure out if the plug in should actually
*use* the sidechain or not? HasInput() and GetInput() are always valid
and I am getting ABLs through the sidechain when I pull the input, so
I guess there must be another way to determine if I am getting actual
audio track data through the sidechain or not...
I don't want to process data when all I'm getting is silence because
there's nothing routed to the sidechain.
Any pointers would be highly appreciated!
Thanks again for all your help so far, this list is a great resource!
--th
2007/12/10, tahome izwah <email@hidden>:
> Bill and Sophia,
>
> thank you so much for your help!! I'll try your suggestions and see if
> they work for me.
>
> Thanks again,
> --th
>
>
> 2007/12/5, Sophia Poirier [dfx] <email@hidden>:
> > On Dec 5, 2007, at 8:13 PM, tahome izwah wrote:
> >
> > > Now I am left wondering how I declare two of the 4 input channels to
> > > be a side chain. Any ideas or pointers to relevant documentation on
> > > the Apple web site? I managed to download the "Audio Unit Programming
> > > Guide" but it doesn't cover how to set up a side chain in an AU...
> > > :-((
> >
> > To add to what Bill said, if you're making an effect AU and would
> > rather still inherit from AUEffectBase rather than going down to
> > AUBase (in order to pass the buss count arguments to its
> > constructor), it's also possible to add an extra busses to an
> > AUEffectBase-derived AU. To do that, in your constructor you'll want
> > to first call CreateElements() before doing anything with busses, and
> > then after that you can do this:
> > SetBusCount(kAudioUnitScope_Input, 2);
> > Note that, if you're adding additional busses, you'll want to name
> > them for the sake of the host being able to provide an interface to
> > the user for differentiating them. You can do that next something
> > like this:
> > GetElement(kAudioUnitScope_Input, 0)->SetName(CFSTR("main input"));
> > GetElement(kAudioUnitScope_Input, 1)->SetName(CFSTR("sidechain
> > input"));
> > Note that SafeGetElement() can return null, so you should add
> > appropriate safety measures around those calls (which I left out of
> > my quicky example snippet).
> >
> > Then in order to access that additional element, you'll want to
> > override the AUBase::Render() method and do something like this to
> > start with:
> >
> > OSStatus status = noErr;
> > AudioBufferList * sidechainBufferList = NULL;
> > bool sidechainIsAvailable;
> > try { sidechainIsAvailable = HasInput(1); }
> > catch (...) { sidechainIsAvailable = false; }
> > if (sidechainIsAvailable)
> > {
> > AUInputElement * theSidechainInput = GetInput(1);
> > if (theSidechainInput != NULL)
> > {
> > status = theSidechainInput->PullInput(ioActionFlags, inTimeStamp,
> > 1, inNumFramesToProcess);
> > if (status == noErr)
> > sidechainBufferList = &(theSidechainInput->GetBufferList());
> > }
> > }
> > if (sidechainBufferList != NULL)
> > {
> > // etc...
> > }
> >
> > All of the buss handling stuff in the AU SDK is fairly non-obvious in
> > my opinion and kinda difficult to get an overall handle on, so
> > hopefully this helps some to start with...
> >
> > Sophia
> >
> > p.s. - The fact that AUBase::HasInput() doesn't really return false
> > for a "no" answer so much as it throws an exception is kinda
> > ridiculous in my opinion; I think I shall go file a bug on that...
> > _______________________________________________
> > Do not post admin requests to the list. They will be ignored.
> > Coreaudio-api mailing list (email@hidden)
> > Help/Unsubscribe/Update your Subscription:
> >
> > This email sent to email@hidden
> >
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden