Type : waveshaper
References : Posted by Jon Watte
A favourite of mine is using a sin() function instead.
This will have the "unfortunate" side effect of removing
odd harmonics if you take it to the extreme: a triangle
wave gets mapped to a pure sine wave.
This will work with a going from .1 or so to a= 5 and bigger!
The mathematical limits for a = 0 actually turns it into a linear
function at that point, but unfortunately FPUs aren't that good
with calculus :-) Once a goes above 1, you start getting clipping
in addition to the "soft" wave shaping. It starts getting into
more of an effect and less of a mastering tool, though :-)
Seeing as this is just various forms of wave shaping, you
could do it all with a look-up table, too. In my version, that would
get rid of the somewhat-expensive sin() function.
(input: a == "overdrive amount")
z = M_PI * a;
s = 1/sin(z)
b = 1/a
if (x > b)
f(x) = 1
f(x) = sin(z*x)*s
Added on : 25/05/05 by Christian[ AT ]savioursofsoul[ DOT ]de
This one doesn't work for me. What have i done wrong? On positive inputs, the output get messed up (usually one constant instead of a sine-like function)
Added on : 30/10/06 by nobody[ AT ]nowhere[ DOT ]com
>>This one doesn't work for me.
I haven't tried it yet, but it's always possible your compiler decided the constants are ints instead of floats. Try "1.0f" everywhere you see "1". May not be it, but you never know.
Anyone have any luck with this one?
Added on : 30/05/14 by luketre[ AT ]hotmail[ DOT ]com
It works fine for me..thank you!
|Add your own comment|
Comments are displayed in fixed width, no HTML code allowed!