• 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
Re: Float32's and disabling AU parameters
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Float32's and disabling AU parameters


  • Subject: Re: Float32's and disabling AU parameters
  • From: Brian Willoughby <email@hidden>
  • Date: Mon, 5 Nov 2007 03:29:39 -0800

The linked page indicates that the described algorithm assumes an input ranging between 0 and 1. Conveniently enough, CoreAudio makes basically the same assumption. More precisely, signals typically range between -1.0 and (slightly less than) 1.0, although there is no guarantee that your AudioUnit will not see input values outside that range if the signal has been processed after reading from a file or from an audio interface input.

But there are a number of problems with using that algorithm within CoreAudio. First of all, if one or both inputs exceed 1.0, then the output will also exceed 1.0 and second, negative values do not exactly function as intended by that algorithm.

However, the biggest problem with that algorithm would be the distortion it creates. If I am reading it correctly, then you'll get ring modulation. Although, unlike typical ring mod effects, where a pure sine wave is multiplied with the signal, this algorithm multiplies two arbitrary signals together, making a complex modulation that should sound quite bad, even though it is mixed in with the undistorted signals. I'm tempted to implement the algorithm just to hear this form of modulation in action. Perhaps an AudioUnit with a side-chain input would be the easiest way to audition the distortion.

My hunch is that this algorithm has only been implemented with 8-bit sound sources that are already full of aliasing. Aliased signals sound like they have been ring-modulated with the sampling frequency, and thus the added ring-modulation from this algorithm might not be terribly objectionable.


You might be better served by simply inserting Apple's AUPeakLimiter right before the final output of your mixer, and leave it at that. Otherwise, you'll need an algorithm which works for positive and negative values as well as input signals which exceed the expected range (assuming you're including any processing and not just reading from files, which of course cannot exceed the limits unless you're reading float files).



Regarding your second question, I do not know the recommended answer, but I think you'd be safe so long as you return ...InvalidParameter from both GetParameter() and GetParameterInfo(). You didn't mention where you're returning this error...


Brian Willoughby
Sound Consulting


On Nov 4, 2007, at 22:30, Kevin Dixon wrote:

Hey all,

First off, I'm looking at
http://www.vttoth.com/digimix.htm
and thinking of implementing the algorithm he describes for mixing
multiple buffers. The algorithm requires knowledge of the range of sample
values for normalization....
Since we are using Float32's....what is their range? I think this would
mean its a single-preceision. IEEE 754 says single precision have a range
of about 2^127.
Anyone know?



Second:
What is the recommended way to remove a parameter from the user's view in
an AudioUnit? Right now I'm returning _InvalidParameter when I want it to
disappear, and it works.


-Kevin Dixon

_______________________________________________
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


References: 
 >Drawing in mCarbonWindow doesn't show (From: Rémi Thébault <email@hidden>)
 >mixing multiple streams and avoiding level loss? (From: "Kevin Dixon" <email@hidden>)
 >Float32's and disabling AU parameters (From: "Kevin Dixon" <email@hidden>)

  • Prev by Date: Float32's and disabling AU parameters
  • Next by Date: questions about Logic AU node properties
  • Previous by thread: Float32's and disabling AU parameters
  • Next by thread: problem with AUGenericView
  • Index(es):
    • Date
    • Thread