indexed parameter rounding problem
indexed parameter rounding problem
- Subject: indexed parameter rounding problem
- From: Urs Heckmann <email@hidden>
- Date: Sun, 12 Jan 2003 01:29:28 +0100
Hi,
I just encountered a problem with indexed AU parameters.
If you set them min = 0.f, max = 22.f, the value for 13.f will arrive
at AUBase::SetParameter() set at 12.99999f which, when casted to int,
makes 12!!! I think people usually will cast indexed parameter values
to integers for control structures like switch and for, so it might
turn out to be a good idea to use roundf to get propper values. I think
this comes from AUCarbonViewControl::GetValueFract() which deals with
double precision values which somewhen later convert to 32bit floats.
Or is my FP mechanic in my ancient 7400 faulty?
Cheers,
;) Urs
urs heckmann
email@hidden
www.u-he.com
Why I create audio plugins instead of using them?
Here's the answer: www.u-he.com/music/
_______________________________________________
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.