Re: AUParameterValueFromLinear?
Re: AUParameterValueFromLinear?
- Subject: Re: AUParameterValueFromLinear?
- From: Jeremy Sagan <email@hidden>
- Date: Mon, 1 Dec 2003 21:55:17 -0500
Bill,
Well the parameter flags for the parameter in question are
0xC8000000
bits 27 + 30 + 31 are on and
kAudioUnitParameterFlag_DisplayLogarithmic = (1L << 22),
22 is definitely off.
The parameter min is 1
The parameter max is 50
0 is converting to 1, 1 to 50 and .5 is converting to about 7.07. This
is not linear and the kAudioUnitParameterFlag_DisplayLogarithmic flag
is defintiely off. This is 100% reproducible. It appears to me, because
of the fact that the min and max are being returned properly that I am
passing the correct AudioUnitParameter data to the
AUParameterValueFromLinear routine and it is simply failing.
Jeremy
On Monday, December 1, 2003, at 07:49 PM, William Stewart wrote:
The only way I can see this happen by glancing through the code is the
following:
if (info.flags & kAudioUnitParameterFlag_DisplayLogarithmic)
(ie. the flags for this parameter have the displayLogarithmic flag set)
Otherwise, I'm at a loss to explain this
Bill
On 22/11/2003, at 1:27 PM, Jeremy Sagan wrote:
AUParameterValueFromLinear seems to be converting a parameter whose
type is kAudioUnitParameterUnit_Indexed to an exponential scale. Is
this a bug?
The following code does not work correctly without the else clause
(although it should not be needed):
if (GetAudioUnitParamInfo(AU, &data, parm) == noErr)
{
if (kAudioUnitParameterUnit_Indexed != data.AUPI.unit)
value = MyParameterValueFromLinear(value, &data.AUP); //this calls
to AUParameterValueFromLinear
else
{// do linear mapping manually since AUParameterValueFromLinear
doesn't work right
value = (value) * (data.AUPI.maxValue - data.AUPI.minValue) +
data.AUPI.minValue;
value = floor(value + 0.5);
}
}
return (value);
Jeremy
_______________________________________________
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.
--
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
_______________________________________________________________________
_
__
_______________________________________________
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.
_______________________________________________
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.