[linux-audio-dev] Simple Jack mixing problem

From: <florentberthaut@email-addr-hidden-log.org>
Date: Fri Jan 05 2007 - 02:44:00 EET

Hi everyone,

I'm working on a sampler and i have a really silly problem.

I simply want to mix sounds in a stereo buffer within the jack "process"
function.
So for each frame i sum the samples from each sound but then the values go
above 1 and i get clipping.
So my first thought was to divide by the number of samples playing, but it
ends up with a decrease in volume.
I tried to limit the values between -1 and 1 but it 's also clipping ->
distortion.

I looked into some sources and it seems i would actually just have to sum
the samples.

Can anyone help me with that ?

Thanks

Flo
Received on Fri Jan 5 04:15:03 2007

This archive was generated by hypermail 2.1.8 : Fri Jan 05 2007 - 04:15:03 EET