• 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: AU parameter names and units
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AU parameter names and units


  • Subject: Re: AU parameter names and units
  • From: William Stewart <email@hidden>
  • Date: Fri, 16 Feb 2007 11:59:11 -0800


On 16/02/2007, at 11:38 AM, Frank Schoep wrote:

On Feb 15, 2007, at 9:58 PM, William Stewart wrote:
On 15/02/2007, at 3:23 AM, Frank Schoep wrote:
...
Is there a way to flag the parameter (different unit?) or hint AU Lab to show more digits?

Try setting the HighResolution flag - I think that will add an extra digit to the display

Thanks for the suggestion, I added the flag to my parameters, but it doesn't seem to make a difference, there's still no digits after the decimal point. I take it there is no other way to change the precision other than writing a custom view?

We should look into this. Are you running this in the "Generic View" as seen in AU Lab? This is where I'd expect to see the extra resolution show up.

...
Is there a way to change (multiple) parameter names on the fly?

You mark the parameter that can change other parameters as a meta parameter. You should also list the dependencies (there's a property for describing which parameters are dependent on a meta parameter).
...
That's it - the listener mechanism should take care of the rest.

This sounds pretty much what I want to do, except I'm changing parameter *names* instead of values. But I'm probably overlooking something as my AU never receives a call to GetProperty{Info,} with AudioUnitPropertyID == AUDependentParameters (== 45?).

That's fine - you are changing the string that you will translate a parameter's value to.



What I did is this: first I added the flag IsGlobalMeta (later also IsElementMeta) to the "master" parameter. I then added the following piece of code to GetPropertyInfo:


	if(inScope == kAudioUnitScope_Global) {
		if(inID == kAudioUnitProperty_DependentParameters) {
			outDataSize = 2 * sizeof(AUDependentParameter);
			outWritable = false;

			return noErr;
		}
	}

I added this to GetProperty (probably not the most elegant thing you've ever seen, but I think it should do the job):

	if(inScope == kAudioUnitScope_Global) {
		if(inID == kAudioUnitProperty_DependentParameters) {

You also have to check the elementID - this is the parameter ID that is your meta parameter ID (and you are describing the dependent parameters for that meta parameter. That way you are able to describe different dependencies for different meta parameters.


			AUDependentParameter p[2];

			p[0].mScope = kAudioUnitScope_Global;
			p[0].mParameterID = kShifterParam_P1;

			p[1].mScope = kAudioUnitScope_Global;
			p[1].mParameterID = kShifterParam_m2;

			memcpy(outData, &p, sizeof(p));

			return noErr;
		}
	}

Both of those snippets never get executed because inID is never equal to kAudioUnitProperty_DependentParameters.

It should be getting called when you open a view in AULab (as well as other places)


Even if this would work, how would my AU react to changes in the "master" parameter?

It doesn't react. When the meta parameter is set - just go and change the values of the rest of the parameters that you want to change. That's all you have to do. When say the view sets the value of your meta parameter, the listener mechanism it uses to do this, knows that a meta parameter is being changed, so it takes care of getting those changes and propogating them to others


I've added some code to GetParameterInfo (where parameter names are filled in), but is that the right place?

I don't think so - all you have to do here is mark the parameter with the meta tag. There's no change for the params that are dependent on that though.


Bill


I've got a lot of questions, but most of all I'm wondering why the Is*Meta flag doesn't seem to have any effect. Do I need to post certain other sections of my code for clarity? Thanks in advance for your help!


Sincerely,

Frank


--
mailto:email@hidden
tel: +1 408 974 4056
________________________________________________________________________ __
"Much human ingenuity has gone into finding the ultimate Before.
The current state of knowledge can be summarized thus:
In the beginning, there was nothing, which exploded" - Terry Pratchett
________________________________________________________________________ __


_______________________________________________
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: AU parameter names and units
      • From: Frank Schoep <email@hidden>
References: 
 >AU parameter names and units (From: Frank Schoep <email@hidden>)
 >Re: AU parameter names and units (From: William Stewart <email@hidden>)
 >Re: AU parameter names and units (From: Frank Schoep <email@hidden>)

  • Prev by Date: Re: Problem with AUParameterSet
  • Next by Date: Re: AU parameter names and units
  • Previous by thread: Re: AU parameter names and units
  • Next by thread: Re: AU parameter names and units
  • Index(es):
    • Date
    • Thread