Re: LPCM Downmix Algorithm problem
Re: LPCM Downmix Algorithm problem
- Subject: Re: LPCM Downmix Algorithm problem
- From: Richard Dobson <email@hidden>
- Date: Mon, 16 Aug 2010 17:18:51 +0100
On 16/08/2010 16:04, uɐıʇəqɐz pnoqɥɒɯ wrote:
..
Now, given that I found the AU mixer to be adequate for my needs, I
haven't delved into this any more. But it seems to me that there
must be a simple, yet better alternative to mix = (sampleA + sampleB)
/ 2.
Unfortunately, that is in the end the simplest and in most cases the
best you can do. You are stuck with the realities of how digital audio
processing (and combining waveforms in general) works. In some cases,
where relative phases are (in general) uncorrelated (so that peaks will
probably not coincide), and the audio very dynamic in character, people
often divide by the square root of the number of voices (e.g. for 16
voices, divide not by 16 but by 4), with the risk of occasional
overloads when someone lays their forearm on the keyboard. I understand
this is quite common in voice management algorithms for synthesizers;
especially those with a high maximum polyphony.
In a way, you are trying to find some sort of automatic gain control
algorithm (or equivalently, dynamic compression/expansion); even there,
while the principles are simple enough, there is much in the detail to
deal with. The working unit is not so much individual samples, more the
overall signal envelope.
I will add one further thing you may not have considered: when looking
at amplitudes values, small numbers are not necessarily that small. An
amplitude of 0.1 (relative to peak = 1.0) for example is only 20dB down;
the nominal "threshold of silence"(-60dB) corresponds to an amplitude of
0.001. You described summing 24 voices; that will result in one solo
voice being a whopping 27.6dB below maximum - significant, but for 24bit
audio especially not a problem at all. And a sawtooth comprising 24
partials still sounds pretty hot.
Richard Dobson
_______________________________________________
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