Re: Sample-accurate parameter automation? Possibe at all with AUs?
Re: Sample-accurate parameter automation? Possibe at all with AUs?
- Subject: Re: Sample-accurate parameter automation? Possibe at all with AUs?
- From: Brian Willoughby <email@hidden>
- Date: Tue, 11 Mar 2008 14:19:35 -0700
You cannot call GetParameter multiple times within the render process
and expect it to provide results in "real time." For one thing, if
you plugin is being executed offline, then this is completely
impossible. But most of all, you must realize that the entire buffer
is processed all at once, so your second call to GetParameter would
have no way to indicate how far your own code has advanced through
the buffer.
The answer lies in the source code for AUBase and AUEffectBase, or
perhaps some of the others. I believe it is AUEffectBase which has
optional code to split the render process into chunks. Without
sample-accurate parameters, you always get a full buffer and process
it at once. But with sample-accurate parameter scheduling,
AUEffectBase will calculate the points within the buffer where the
parameter value changes to a new value. Then, your normal render
will be called with a small chunk of the buffer, just the part where
the parameter remains constant. In this case, you still just call
GetParameter once at the beginning of your render, but you'll be
called again to render the next parameter value.
There is more than one way to handle this, though, so look at the
source for the AU classes. You are correct to point out that high-
resolution parameters would be a nightmare, since you'd be calling
your entire render function once per sample. In this regard, I think
you have to start with the sample-accurate code that exists, and then
improve upon it for your specific situation.
I'm sure I've left a few details out, but hopefully someone can fill
them in, or correct any misstatements. Good luck!
Brian Willoughby
Sound Consulting
On Mar 11, 2008, at 03:00, Greg X wrote:
I want to support sample-accurate parameter automation
of my MusicDeviceBase based AU.
All of the examples I saw are calling GetParameter
once at the beginning of the render process. ..which
is very far from being accurate.
Are there some kind of parameter buffers? Like the
input buffers for incoming audio.
I feel uncomfortable with calling series of
"GetParameter"s for each sample. It feels to be a huge
performance hit to the DSP. Why not using parameter
buffers instead?
I'm also wondering why are all of those examples using
such an inaccurate parameter handing? (when someone is
using 512 samples long processing buffers, it doesn't
mean that he wants to get inaccurate parameter
handing)
Are hosts providing such inaccurate parameter
automation, or what is the reason?
Thanks for your time,
Greg1X
_______________________________________________
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