• 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
(no subject)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

(no subject)


  • Subject: (no subject)
  • From: Franck STAUFFER <email@hidden>
  • Date: Wed, 16 Oct 2002 00:36:35 +0200

Chris,

I'm not sure I was clear enough. Maybe I should elaborate more:

ok let's say I declare my frequency parameter as:

{ "Filter Frequency" , 0 , kAudioUnitParameterUnit_Hertz , 50.0f ,
8000.0f , 1000.0f , 0 },

in my AudioUnitParameterInfo...now I launch logic, open the AU and the
generic view creates sliders for my parameters...the frequency slider
looks good, it's says it's unit is in Hz etc...but if I move the slider
at 50% i get a frequency around 4200 Hz which is good if I want that
parameter to be scaled linearly...

if now I declare is as a generic value ranging from 0.0f to 1.0f, I can
do something like that:

myScaledFreq=pow(10.0f,3.90f*fFreq)+49.0f

this curve fits my particular needs, but then logic displays only 0.0
to 1.0 values for that parameter which is normal since i haven't
declared it as a kAudioUnitParameterUnit_Hertz this time. So my
question was: how can I declare my parameter like in the second case
and be able to tell the generic view to display my scaled frequency.

Sorry to bother you again with that...

Franck


> Franck,
>
> Please notice that the generic view will notice that a parameter's
> units
> are Hertz and then do the reasonable exponential curve scaling for the
> slider control. We provide functions AUParameterValueFromLinear()
> and AUParameterValueToLinear() in AudioUnitUtilities.h to convert back
> and forth in a general way between log <-> linear.
>
> We also have the units type kAudioUnitParameterUnit_AbsoluteCents
> which publishes a parameter explicitly with a log frequency scale.
> kAudioUnitParameterUnit_AbsoluteCents has the interesting property of
> corresponding to the pitch of 100 times a MIDI note number!
>
> Chris Rogers
> Core Audio
> Apple Computer
_______________________________________________
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.

  • Follow-Ups:
    • linear vs. log Hz
      • From: Chris Rogers <email@hidden>
  • Prev by Date: float sample conversion (was Re: Calculating peak level in db)
  • Next by Date: Re: HostCallback_GetBeatAndTempo howto?
  • Previous by thread: channel identification
  • Next by thread: linear vs. log Hz
  • Index(es):
    • Date
    • Thread