Re: Does anybody implement 'reset' in their Instrument Audio Units?
Re: Does anybody implement 'reset' in their Instrument Audio Units?
- Subject: Re: Does anybody implement 'reset' in their Instrument Audio Units?
- From: William Stewart <email@hidden>
- Date: Thu, 25 Feb 2010 19:37:42 -0800
Actually, you can know this with the AU spec
Two ways:
There are two properties that an AU should report about its processing, tail time and latency. Tail time we have described as being a conservative property (whereas latency should be accurate). Tail time is the time that it takes for you audio to go silent after the last real input has been presented to the AU - basically a reverb/delay decay time
So, as a host you see this:
1st sample in -> appears in the output latency samples later
(the first latency number of samples out are silent)
last sample in -> you still have latency + tail samples within the AU that need to be "pulled through"
(feed in latency + tail samples of silence)
If you want to align sample edges as a host, you would discard the latency samples of an audio unit from its output after the AU has been reset (or initialised)
If you want to pull out all of the samples of an AU, you need to feed latency+tail number of samples into the AU. You will get back latency + tail samples (you already had to throw out latency samples at the start, so you need to get these back "after" the last sample of input)
The auprocess example we shipped for a while did this with effects (there are some additional notes in that example you can read if you are interested)
For a AU host, you can use these numbers to load balance your plugins - once they have gone past an active segment, you can use these numbers to know how much additional data you need to pull through them. Once you have done that, any further "rendering" by that AU is wasted CPU cycles until you have new data to give it.
Both Logic, STPro/FCP use these numbers to handle their rendering (as does QT actually), so many of the initial problems we had with these properties have been shaken out now.
(2) Way
- use the "output is silent" flag - I don't think this is a good idea personally. It was a later addition and I don't believe many AUs actually implement it.
Bill
On Feb 25, 2010, at 3:54 AM, Muon Software Ltd - Dave wrote:
>>> I've been mucking about with trying to reduce CPU load by removing idle instruments from the AUGraph.
>
> Define "idle"...an instrument with a preview feature may need to output audio even when there's no MIDI, the transport is stopped and long after any tails have faded. Even an instrument with an onscreen keyboard is not genuinely idle in such circumstances, as the user may click on the GUI to make a sound at any point they choose.
>
> I understand that Logic has some concept of a "focus" track - so long as the instrument's track is selected (and maybe only when the GUI is visible?) it is rendered continuously. This seems to be a necessary feature to me if you're going to shut down idle instruments.
>
> Kind regards
>
> David Waugh
> Managing Director
> Muon Software Ltd
> http://www.muon-software.com
> http://muonsoftware.blogspot.com
> _______________________________________________
> 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