Re: GetParameterValueStrings
Re: GetParameterValueStrings
- Subject: Re: GetParameterValueStrings
- From: Marc Poirier <email@hidden>
- Date: Fri, 15 Aug 2003 18:11:03 -0500 (CDT)
Howdy Jim,
For one thing, in AU, you don't have to work around normalized parameter
ranges. So you don't need to worry about dividing by 3 or whatever to get
your 3 states like you described. You just say that your parameter has a
min of 0 and a max of 2. And then you say that it's unit type is Indexed,
and it's treated like an integer value instead of continuous. And then
you provide the ValueStrings to give the label for each of the 3 integer
states. You can also specify the Boolean unit type for a parameter, and
then it will be treated as a 2-state on/off parameter. Really, the
difference between AU and VST here is basically:
AU lets you describe the parameter as what it actually is
VST treats all parameters generically and lets you mask that with various
string output functions
So you'll find that, once you define your parameters properly in AU, the
host and any generic interface has a lot more information about your
parameters than with VST, and you can get much better generic interfaces.
For example, you could check out our Skidder at
http://destroyfx.org/audiounits.html and look at it in an app that uses
the GenericView, like AudioUnitHosting, and you'll see that it's very good
what with all of the sliders with literal ranges and pop-up menus and
checkboxes and whatnot.
In my opinion, the one important thing missing is a way to specify a value
distribution curve. Like if you have some sort of parameter and you want
it to be have it's values scaled logarithmically rather than linearly to
get a nicer response with a generic interface, currently there's no way to
specify that, but I'll keep trying to convince Apple folks that it's
important... ;-)
Marc
On Fri, 15 Aug 2003, Jim Wintermyre wrote:
>
> > Also, I have a question about GetParameterValueStrings. This call would
>
>> appear to be there for the purpose of providing human-readable values for
>
>> generic float parameters, but I can't find any documentation on it.
>
>
>
>/Developer/Documentation/CoreAudio/AudioUnits/Topics/au_properties.html#kAudioUnitProperty_ParameterValueStrings
>
>
>
>But as you'll see, it's not for float, or at least float in the sense of
>
>continuous, parameters. It's for parameters that have descrete choices,
>
>with unit type kAudioUnitParameterUnit_Indexed. What you are looking for
>
>is not here yet but will come with the next update, as Bill mentioned a
>
>couple days ago, with a new kAudioUnitProperty_ParameterValueName
>
>property.
>
>
>
>> How is it used, and do I have to set any special flags on the parameters
>
>> for my reported values ("-6dB") to be made visible in the host (instead
>
>> of "0.500")
>
>
>
>Of course, you could also make the parameter's unit type be
>
>kAudioUnitParameterUnit_Decibels and provide the parameter's value range
>
>in the actual dB range (or something close enough, since probably won't
>
>want to make the minimum literally -infinity). But maybe that doesn't
>
>work well for your particular case, I don't know...
>
>
First, a general comment. I'm coming from a VST background. I would
>
imagine that several AU developers are as well, so I would think it
>
would make sense to have AU be *at least* as complete as VST. This
>
is one of those areas where I don't think it is, or where I'm not
>
understanding the AU spec fully to see how it completely covers this.
>
>
In VST, every parameter is a continuous float from 0 to 1. For
>
example, let's say we have a parameter that controls the scale used
>
by our output VU meter. It has 3 values, corresponding to -10dB
>
scale, 0dB scale, and +4dB scale. The easiest way to actually
>
represent the value in a float is to just divide the range of the
>
float by the number of values and use that as your step increment, so
>
you end up with values of 0.0, 0.5, 1.0. However, if you don't have
>
a custom UI so you're using the default UI (or controls mode in
>
Logic), seeing these values displayed doesn't make a whole lot of
>
sense. However, VST has extra functions which give the host extra
>
information on how to treat/display that parameter.
>
>
getParameterName() - Gets the name of the parameter for display.
>
"Meter Display" in this case.
>
>
getParameterDisplay() - Gets the textual value of the paramter for
>
display. "-10dB", "0dB", or "+4dB" in this case.
>
>
getParameterLabel() - Gets label for units of parameter for display.
>
Nothing in this case, but could be "dB", "Hz", "Thingies", whatever.
>
>
getParameterProperties() - Catch-all routine that sets various
>
properties of parameters, including whether or not they boolean,
>
indexed, or continuous; the max value for indexed params; a separate
>
"display index" for example for ordering the params in a specific
>
order on a HW control surface; the parameter category ("bag" or
>
whatever it was decided on this list a while back); short labels for
>
HW control surface display, etc. In this case, we'd set the
>
parameter to be indexed with 3 values, and maybe give it a short name
>
and category.
>
>
With these functions, a host can display a generic UI for this
>
parameter which has all required info for the user, and an external
>
control surface has everything it needs too.
>
>
What seems to be missing in AU is the equivalent of
>
getParameterDisplay(), which I guess is what
>
kAudioUnitProperty_ParameterValueName is going to be for?
>
>
Also missing is the equivalent of getParameterLabel(). I see that
>
there are many types of param units in AudioUnitParameterUnit... but
>
the thing is, with the above mechanism, it doesn't matter what the
>
unit is. How the plugin treats the param is entirely up to it, and
>
through those 4 functions it gives the host all the information it
>
needs to deal with the parameter.
>
>
If I'm missing something, please enlighten me! :-) As it stands now,
>
our VST plugins when used in default editor mode or controls mode in
>
Logic on OS 9 are a lot more useable than the AU versions on OS X.
>
>
Thanks,
>
Jim
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.