• 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
Fwd: Report level in AudioUnit to parameter
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fwd: Report level in AudioUnit to parameter


  • Subject: Fwd: Report level in AudioUnit to parameter
  • From: Fastepholier Philgarlic <email@hidden>
  • Date: Mon, 12 May 2014 18:17:06 +0200

Hi,

To have the generic view plot a level bar, do something like this:


ComponentResult GGPitchDetectorUnit::GetParameterInfo (AudioUnitScope inScope,
                                                     AudioUnitParameterID inParameterID,
                                                     AudioUnitParameterInfo &outParameterInfo
                                                     ) {
ComponentResult result = noErr;
    outParameterInfo.flags = 0;
   
if (inScope == kAudioUnitScope_Global) {
        switch (inParameterID) {
            case GGPitchUnitParameterEnergy:
                AUBase::FillInParameterName (
                                             outParameterInfo,
                                             kParamEnergyName,
                                             false
                                             );
outParameterInfo.unit = kAudioUnitParameterUnit_Decibels;
                // Sets the unit of measurement for the Frequency parameter to Hertz.
outParameterInfo.minValue = -30;
                // Sets the minimum value for the Frequency parameter.
outParameterInfo.maxValue = 1;
                // Sets the maximum value for the Frequency parameter.
outParameterInfo.defaultValue = 100;
                // Sets the default value for the Frequency parameter.
               
                outParameterInfo.flags |= kAudioUnitParameterFlag_MeterReadOnly | kAudioUnitParameterFlag_IsReadable;
                break;

The relevant part being the setting of the flags.  kAudioUnitParameterFlag_MeterReadOnly is what you want.  By the way
 kAudioUnitParameterFlag_PlotHistory is worth noting also.  It gives a nice history curve.

To change the parameter, you can do this from your kernel:
 
    myUnit->SetParameter(GGPitchUnitParameterEnergy, dbVal);

You don't need to subscribe to an event unless you want to react to a parameter change (like  to update your custom view in the case you want to implement the view metering yourself)


2014-05-11 20:27 GMT+02:00 Benjamin Rindt <email@hidden>:
Hey guys,

I’m currently developing a compressor AudioUnit and I would like to report the gain reduction level to a Parameter of my AudioUnit like the stock Apple AU’s are able to.

I did not find how those AUs can make a level bar in a generic view, but this does not bother me too much, more how I can set a value to a parameter within process()

What is here the correct way to do this? Anyone did something like that?

Do I have to use some AUEventListener type stuff to make this happen? Anyone who has some ideas or a way to do this its very much appreciated.

Thanks - Benjamin
 _______________________________________________
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

  • Prev by Date: Re: Resources to learn more about the difference between packed and unpacked (high/low aligned) samples?
  • Next by Date: Re: Playing to a device when users switch
  • Previous by thread: Report level in AudioUnit to parameter
  • Next by thread: Playing to a device when users switch
  • Index(es):
    • Date
    • Thread