Re: Mixing manually vs. Mixer AudioUnit and avoiding clipping
Re: Mixing manually vs. Mixer AudioUnit and avoiding clipping
- Subject: Re: Mixing manually vs. Mixer AudioUnit and avoiding clipping
- From: Paul Scott <email@hidden>
- Date: Fri, 18 Jun 2010 12:58:58 -0700
You have to normalize the buffer. The application I'm working on
generates modulated continuous wave and FSK signals at various
frequencies superimposed on each other. With more than about 4
simultaneous signals I start to get distortion. I have had moderate
success normalizing each buffer after each "track" is added by noting
the highest value in the buffer, computing a normalization factor
relative to 1 and then multiplying each value in the buffer by that
factor. Normalizing once after all tracks are added can cause clicks
between buffers depending on how may tracks appear across buffers.
Normalizing after each track is laid down reduces the effect. Will that
work for you? I am experimenting with a ramp factor across buffers but
have nothing to report yet. I am also experimenting with pre-emphasis
and de-emphasis of each track before addition and normalization, but
again, nothing to report yet. I am getting pretty good results so far
without knowing anything about DSP algorithms, just code developed
through experimentation. What I mean is, I'm no expert. Advice from
experts is welcome.
FWIW, HTH,
Paul
uɐıʇəqɐz pnoqɥɒɯ wrote:
On Jun 18, 2010, at 11:44 AM, Gregory Wieber wrote:
You have to think in terms of the max output signal being "1". You need to divide that by the number of busses you have and set the volume for each bus accordingly.
I tried something like that but it didn't work very well. Take, for instance, the case where you have one note playing, 5 notes are silent and two notes are playing at very low levels. Dividing the mixed signal by 8 is not going to sound right.
I think the trick is to reduce the volume of the very high notes, but not to reduce the lower notes.
Google has pointed me to some articles on compression or Dynamic Range Compression... maybe that's the direction I need to move in...
_______________________________________________
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