• 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: Starting Audio Unit programming in Xcode 6
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Starting Audio Unit programming in Xcode 6


  • Subject: Re: Starting Audio Unit programming in Xcode 6
  • From: Christian Rober <email@hidden>
  • Date: Fri, 22 May 2015 23:04:04 -0400

Without testing it, your constructor seems to be throwing an exception (Open is a dispatched call to your constructor that catches any exceptions and returns them as normal OSStatus errors, see ComponentBase.cpp).  The exception looks like it wraps an invalid parameter error (10878, seen in AUComponent.h).

I think this exception is being thrown in your call to SetParameter.  My first thought is that your kNumberOfParameters is set to 0.  With no parameters reserved, trying to set one will throw that exact error/exception above.

The other part of this is that you are accidentally calling SetParameter on AUBase/YourClass and not the global scope.  Though, from the code you shared, I don't even know how a 2 parameter SetParameter call to the base class would even compile.

I imagine the constructor body should look more like this:

Hardgainer::Hardgainer (AudioUnit component) : AUEffectBase (component) {
    CreateElements ();
    Globals () -> UseIndexedParameters (kNumberOfParameters); // <-- Should be non-zero
    Globals () -> SetParameter (
                  kParameter_Gain,
                  kDefaultValue_Gain
                  ); // <-- Need more arguments if calling AUBase::SetParameter.
    ….

Note: The indexed parameter gets created in global scope by setting it on the global element first.  Only after this initial global setting can it be safely used by the AU.

--Christian


On Fri, May 22, 2015 at 7:38 PM, Farhan Mannan <email@hidden> wrote:
I have used the current audio unit tutorial (1) with a bit of tinkering to create an Xcode project (2) that successfully builds a component but I can’t get it to validate. AUVal gives me error -10878. (3)

I started in Xcode from the 'OS X > System Plug-in > Generic C++ plugin’ template and copied all the methods in the tutorial for making the sample audio unit (TremoloUnit) as well as a couple of methods that were in the downloadable sample audio unit that seemed necessary to get it to build - essentially trying to mimic the mythical audio unit template that the guide refers to, but which is no longer available in Xcode and has been unavailable for some time.

I think I have ended up implementing a version of every method in the sample audio unit so I’m now stuck as to why it doesn’t validate. I understand that the DSP code may be totally useless (it’s only meant to be a gain plugin) but the thing won’t even open.

Any suggestions?

Even if this project isn’t salvageable in its current form, is there another way I can go about starting to write audio units?

(1) https://developer.apple.com/library/mac/documentation/MusicAudio/Conceptual/AudioUnitProgrammingGuide/TheAudioUnit/TheAudioUnit.html#//apple_ref/doc/uid/TP40003278-CH12-SW1

(2) https://github.com/farhanmannan/hardgainer

(3) https://gist.github.com/farhanmannan/d5a83910d0b2f18840c1

 _______________________________________________
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

  • Follow-Ups:
    • Re: Starting Audio Unit programming in Xcode 6
      • From: Farhan Mannan <email@hidden>
References: 
 >Starting Audio Unit programming in Xcode 6 (From: Farhan Mannan <email@hidden>)

  • Prev by Date: Starting Audio Unit programming in Xcode 6
  • Next by Date: Re: Starting Audio Unit programming in Xcode 6
  • Previous by thread: Starting Audio Unit programming in Xcode 6
  • Next by thread: Re: Starting Audio Unit programming in Xcode 6
  • Index(es):
    • Date
    • Thread