|
At the request of a couple of csound subscribers I've attempted to give an
example of how I implement the volume limiting I described in my earlier
mail. I originally intended to use a function for the curve, but in the
end I used a table into which I placed a few values from this curve and
I'm afraid I've completely lost the original function. It's not complex..
it was the result of about 5 minutes fiddling with gnuplot :) The curve in
my example isn't really very curved at all, but you can imagine that if
you added a few extra points you could achieve a much better
approximation. The important thing is that it works, quite well :)
Matt
ps. I use 16bit WAVs..my constants reflect that.
----orc snippet----
ascaled tablei (aoriginal+65535), 1
out ascaled * 32768
-------------------
------ftable-------
f1 0 131073 8 -32767 32769 -30000 65535 30000 32769 32000
-------------------
|