• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Audio Units - newbie questions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Audio Units - newbie questions


  • Subject: Re: Audio Units - newbie questions
  • From: Marc Poirier <email@hidden>
  • Date: Wed, 12 Oct 2005 10:29:24 -0400

On Oct 12, 2005, at 10:16 AM, Muon Software Ltd - Dave wrote:

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.

Though that is definitely legitimate! Querying and applying settings is not about active DSP.



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.

Sure, it will pass, but probably be more inefficient, unfortunately (though that depends, some AUs have nothing to do in Initialize). But if that's the only feasible solution for your AU, then you've gotta do what you've gotta do...



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.

You certainly can't depend on that. In fact, I doubt that's even common.


Are there other
functions I could override to detect samplerate/block size changes?

There is SetMaxFramesPerSlice(). This also will by default return an error if Uninitialized, I think.



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.

Mmm, throwing out dialogs with no user interaction is really poor for more reasons than that. I hope that others don't think that "full initialization" = "throw out dialogs"!


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.

Right, of course: these are set by the host, and there's no way to do that until the host has received a reference to an instance of the plugin to work with.



Marc

_______________________________________________
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


  • Follow-Ups:
    • RE: Audio Units - newbie questions
      • From: "Muon Software Ltd - Dave" <email@hidden>
References: 
 >RE: Audio Units - newbie questions (From: "Muon Software Ltd - Dave" <email@hidden>)

  • Prev by Date: RE: Audio Units - newbie questions
  • Next by Date: RE: Audio Units - newbie questions
  • Previous by thread: RE: Audio Units - newbie questions
  • Next by thread: RE: Audio Units - newbie questions
  • Index(es):
    • Date
    • Thread