Re: multi-channel AUs
Re: multi-channel AUs
- Subject: Re: multi-channel AUs
- From: Marc Poirier <email@hidden>
- Date: Sat, 29 Mar 2003 04:44:37 +0100 (CET)
Hi Greg. The first thing that you want to do is completely forget about
v1 AUs. This means (in part) forgetting about interleaved i/o. In v2,
the default stream format is non-interleaved "mono" streams. There's no
expectation that anyone should support AU1, so you can safely forget about
it.
Next, if you're processing n-channels with dependencies (i.e. you need
access to all channels at once and can't use single channel kernel
convenience objects), then you want to simply forget about kernels. Don't
use them. Instead, override the ProcessBufferLists method.
If you are going to support any number of channels so long as
num inputs = num outputs, then you're fine with the default
AUEffectBase implementation of SupportedNumChannels (which simply returns
0, the special code word for any-n-to-n-config). If you have any
special needs in that regard, then you need to override
SupportedNumChannels to specify your allowable configurations.
You can also forget about MaintainKernels since you're not going to be
using kernels. Except: If you are using the AU SDK from the December
2002 Developer Tools, then you need to make this one correction to
AUBase.cpp, otherwise non-kernel-using AUs will crash. In
AUEffectBase.cpp, at the end of MaintainKernels(), this:
for(unsigned int i = 0; i < nChannels; i++ )
{
mKernelList[i]->SetLastKernel(i == nChannels-1 );
}
needs to be changed to this:
for(unsigned int i = 0; i < nChannels; i++ )
{
if (mKernelList[i] != NULL)
mKernelList[i]->SetLastKernel(i == nChannels-1 );
}
Finally, if you want some example code that demonstrates n-channel
effects that don't use kernels, you can look at Scrubby, Buffer Override,
RMS Buddy, or Rez Synth in our Destroy FX cvs repository:
cvs.sourceforge.net:/cvsroot/tom7misc/vstplugins/
or by web (sucks):
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tom7misc/vstplugins/
RMS Buddy might be the easiest to start with because it doesn't use our
extra DfxPlugin layer of abstraction (it deals with all of the AU API
stuff directly, although DfxPlugin is a far quicker way to go about
writing plugins, I recommend it :).
Marc
On Fri, 28 Mar 2003, George Taylor wrote:
>
Hello,
>
>
I'm having trouble figuring out the right way to create an n-channel
>
cross-coupling effect that processes all input channels together in a single
>
function.
>
>
I've started with the SampleEffect project, but quickly learned all about
>
"V2" AUs, and that each channel is processed in its own seperate Kernel. I
>
want to process multiple channels through a single Kernel. So I added this
>
to my effect's constructor:
>
>
CAStreamBasicDescription old_format = GetInput(0)->GetStreamFormat();
>
CAStreamBasicDescription new_format(old_format);
>
new_format.SetCanonical( 2, true );
>
GetInput(0)->SetStreamFormat( new_format );
>
GetOutput(0)->SetStreamFormat( new_format );
>
>
Is this a proper way to make the effect process interleaved data?
>
>
And I've also noticed that the AUEffectBase::MaintainKernels() method is
>
where a single Kernel for each channel is created. But if the effect uses an
>
interleaved format, it should only need a single Kernel for all channels.
>
But MaintainKernels() isn't a virtual function, which makes me think that
>
maybe I'm off on the wrong foot. Should I approach this differently? Should
>
I start with AUBase and forget about AUEffectBase?
>
>
Thanks for any help with this,
>
>
George
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.