Re: Suggestions for volume controls?
Re: Suggestions for volume controls?
- Subject: Re: Suggestions for volume controls?
- From: Jeff DuMonthier <email@hidden>
- Date: Sun, 19 Feb 2006 14:00:21 -0500
I've figured out how to set the parameter ranges, built in display
curves, and define custom unit names. The problem is that there is no
built in log-linear display curve. I have a number of gain parameters
which I would like to be able to go from 0 (-INF dB) to say 10 (+20dB).
I want them to display in dB and have a logarithmic curve at the high
end but a linear curve at the low end so they can get to 0.
I have a custom class which does parameter normalization and one of the
options is a log-linear curve specified by a min value (0 here), max
value (10) and a value in between where it transitions from linear to
log with a continuous first derivative. It was originally for
numerical optimization code but worked great for this so I reused it.
In VST, the parameters are all normalized from 0 to 1 and the plug-in
is expected to do the translation so it was easy. In AU, the
translation is built in. I could do a kAudioUnitParameterUnit_Generic
type with a normalized range, but then what do I have to overload to
display something more useful? Is that an easy thing to do?
It looks like kAudioUnitParameterUnit_MixerFaderCurve1 is intended to
do something like what I want, but it doesn't display in dB, and may
not be exactly the curve I'm looking for. What are others doing for
gain curves?
On Feb 13, 2006, at 2:17 PM, William Stewart wrote:
Have a look at the AudioUnitParameterInfo struct - and in the SDK, the
sample effect unit, where a parameter is defined that will draw menus
- we call this an indexed parameter, and you can give each value of
the index a name.
You express the parameter's natural range and units - so say -120dB to
6 dB. You will then have parameter values set within this range. You
can specify a display curve that can be used by a generic view for
instance, when displaying your parameter. We provide linear
transformations, so that a slider for instance, can translate to/from
a parameter's value (using these optional display curves)....
All you have to do here is:
describe the parameter in its most natural form
deal with the incoming values
HTH
BIll
On 12/02/2006, at 8:03 AM, Jeff DuMonthier wrote:
I'm trying to convert a VST plugin to an audio unit and I'm wondering
how to do a volume control, among others. Eventually I may use a
Cocoa view, but it's just the default interface for now. In VST the
control just returned a value from 0.0 to 1.0 and I have some custom
code for linear, log or log-linear parameter normalization I reuse
all the time that made it easy to do a log-linear control from -INF
to +6dB. I haven't seen any documentation on how to do various types
of controls, but it looks like you just define a linear range of
values and select a unit. I'm assuming if I set the range from -100
to +6 and use kAudioUnitParameterUnit_Decibels, the value it will
return will be between -100.0 and +6.0. It doesn't display in dB and
convert to a gain does it? How would I do a volume control that went
from -INF to +6dB without overloading all the built in code, or is
that the only option? What have others done for this? I'd rather
not have to overload code that handles parameter automation because I
really don't want to have to reimplement that.
Is there some documentation or some good examples somewhere on how to
do different controls like this? I may also have to do some which
are ranges with only discrete values in the range allowed. I suppose
I could just pretend it's linear even though it isn't.
_______________________________________________
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
--
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