RE: Audio Units - newbie questions
RE: Audio Units - newbie questions
- Subject: RE: Audio Units - newbie questions
- From: "Muon Software Ltd - Dave" <email@hidden>
- Date: Wed, 12 Oct 2005 15:16:30 +0100
- Importance: Normal
> If Reset is the only thing that your synth can't do while
> Uninitialized, then certainly go ahead and put a check in there and
> ignore it if Uninitialized. That's totally fine. And probably then
> it would be wise to do what you do in your Reset method during your
> Initialize method, after finishing the init stuff. Cuz the worst
> thing that I can think of is that the host may think it's Resetted
> you when actually you did nothing in response to that request, but as
> long as you "catch up" before rendering any audio, that would be fine.
Seems auval calls SaveState as well before the plugin is initialised. This
kind of screwed up my plan.
In the end I had to take option one, and do the same initialisation in the
AU constructor as I do in the VST constructor. So Initialize and Reset now
do pretty much the same thing to my synth. It works in all the hosts I
tested and passes auval.
> Uninitialized = ready for anything except audio rendering
> Initialized = ready for anything, except stream format changes
With the code change I've just made, there is now no distinction between
being initialised and uninitialised so the plugin can do anything any host
might as it to do at any point after being constructed.
> And by "stream format changes," I mean things like StreamFormat
> obviously, plus SampleRate, BusCount, MaxFramesPerSlice, etc.
> Although disallowing those things when Initialized is optional. It
> is the default implementation in AUBase to reject those changes when
> Initialized, but if your AU can handle those changes no problem and
> you want to allow that, you just override the appropriate AUBase
> methods to allow that.
At the moment I've overridden StreamFormatWritable (to which I always answer
true) and ChangeStreamFormat. I'm expecting a Reset to be called before
MaxFramesPerSlice and samplerate are changed though. Are there other
functions I could override to detect samplerate/block size changes?
My AU is definately picking up blocksize/samplerate changes in Logic 7.1.1.
> Hmmm, given that there aren't really any direct equivalents of the
> Initialize, Uninitialize, and Reset trio in the VST API, I'm not sure
> what you mean...
Not direct equivalents no. However there are plenty of VST hosts that will
construct a plugin in order to scan it during startup, Cubase for example.
VST plugins that do a full-fat initialisation here throw out all kinds of
fugly dialogs and so on and that is just really, really poor. Another
problem is that we don't know the sample rate and blocksize during the
constructor so plugins with filter tables etc. can't really initialise
themselves properly in the constructor without resorting to dummy values.
Thankfully we can guarantee setSampleRate and setBlockSize calls after
construction, so these are a good place to any remaining initialisation.
This is why we divided our initialisation procedure into an init call (done
in the constructor) and a reset call (done during setblocksize etc.) If all
VST hosts could be relied upon to use the suspend/resume calls correctly
this would be even easier :-)
Regards
Dave
_______________________________________________
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