View Single Post
Old 02 October 2013, 15:14   #19
pandy71
Registered User
 
Join Date: Jun 2010
Location: PL?
Posts: 2,867
Quote:
Originally Posted by Dunny View Post
I would be interested to know how to mix samples effectively. Stingray's suggestion of adding two samples and dividing by 2 seems wrong to me - if I have a loud sample and a quiet sample, then the averaging operation will decrease the volume of the louder sample and correspondingly increase the volume of the quieter sample. How would this be avoided?

D.
This can't be avoided - however there is workaround:

Use 16 bit arithmetic, add all channels (with 256 8-bit channels you need more than 16 bit) at the end rescale result and now story begins.
You can truncate/round 16 bit to 8 bit and output directly to DAC loosing lower 8 bit (thus create problem you already mention) or perform error processing (Error Feedback Rounding) - rest from truncation can be added to next 16 bit sample, this is simplest way and it can sound good - oversampling recommended - higher - better.

http://www.google.com/patents/US6801925

If there is plenty of CPU power then formal noiseshaping with dithering can be performed (based on scientific publications - correctly noise shaped and dithered 8 bit system with 4 times oversampling can provide over 120 dB dynamics).

This remain me my previous idea.

Copper audio with DMA - set Audio DMA period high - few times higher than allowed and push audio samples interleaved by zero with Copper.

Suggested 14 bit can work also.
And probably some LUT's are unavoidable on Amiga (lack of DSP).
pandy71 is offline  
 
Page generated in 0.04506 seconds with 11 queries