Re: Audio Units - newbie questions
Re: Audio Units - newbie questions
- Subject: Re: Audio Units - newbie questions
- From: Olivier Tristan <email@hidden>
- Date: Wed, 12 Oct 2005 12:47:19 +0200
Muon Software Ltd - Dave wrote:
So with four busses I get four render calls, one for each bus, all with the
same time stamp. When the time stamp is the same as the previous timestamp I
know I'm rendering for the same slice.
I don't know if I could add a method to my synth to render one output at a
time. It might be better if, on the first call to Render I rendered into 8
mono temporary buffers which I then copy into the AU busses on subsequent
Render calls with the same time stamp depending on which bus I've been
passed in. That sounds vaguely workable to me, though it does mean I have to
maintain my temporary buffers quite carefully and there would be some mixing
overhead in the AU that the VST version doesn't suffer from.
Why don't you just inherits Render and call PrepareBuffer on each ouput.
Here is what I do :
(I've only pasted the relevant code)
Maybe bill will say it's horrible..
(Works in Logic 6.3, Logic 7, DP, Live 4,5 and many others)
//////////////////////////////////////////////////////////////////////////////
/*! Renders our output */
ComponentResult AUPlugin::Render( AudioUnitRenderActionFlags&
ioActionFlags, const AudioTimeStamp& inTimeStamp, UInt32 nFrames ) {
uint numOutputBusCount = Outputs().GetNumberOfElements();
//you can now iterate over each value of i from 0 to numOutputBusCount .
// where 0 is the main output.
AUOutputElement *output = GetOutput(i);
AudioBufferList &outputBufferList = output->PrepareBuffer(nFrames);
AUBufferList::ZeroBuffer(outputBufferList); // zero if your a synth or
copy from input if you are an effect
uint channelCount = outputBufferList.mNumberBuffers;
//each main out channel can be accessed like that where i is the channel
index from 0 to channelCount
reinterpret_cast<float*>(outputBufferList.mBuffers[i].mData)
//Then Process of buffers
}
Hope this helps.
--
Olivier Tristan
Ultimate Sound Bank
_______________________________________________
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