Waveshaper
Posted: Tue Jul 01, 2014 2:36 pm
Hello,
I would like to share my first plugin with you.
It's a Waveshaper with User-definable transfer function.
I'm using the Ruby eval function to build a lookup table of the user's function which is then read with linear interpolation.
The User can also define the size of the lookup table (i.e. the Quality).
Choose between Unipolar-Mode, where your function is applied to the absolute value of the input and then multiplied with the sign of the input (symmetrical distortion)
and Bipolar-Mode, where you can do different things to positive and negative values (asymmetrical)
The ternary operator is useful for that:
x>0 ? x : 0
is the same as:
if x>0
x
else
0
Values above 1 and below -1 are hardclipped.
You can use three knobs a, b and c (with user-definable min/max values) to quickly alter parameters of your function (these are not automatable though).
I have also included optional DC-offset removal and 4xOversampling.
Special values you can use in formulas: pi, e, res(Current Resolution)
Functions you can use in formulas:
normal operators: +, -, *, /, ^
http://www.ruby-doc.org/core-1.9.3/Math.html <= all of those
Useful ones are: tanh(x); atan(x); log10(x); log2(x); sin(x); cos(x); sqrt(x); acosh(x); cbrt(x)
sin1(x) =sin(2*pi*x)
cos1(x) =cos(2*pi*x)
floor(x)
round(x)
ceil(x)
abs(x)
sgn(x) =sign(x)
clip(x, min=-1, max=1)
I will post some example formulas later
Feedback and suggestions are very appreciated.
EDIT2: Version 1.0.2
I would like to share my first plugin with you.
It's a Waveshaper with User-definable transfer function.
I'm using the Ruby eval function to build a lookup table of the user's function which is then read with linear interpolation.
The User can also define the size of the lookup table (i.e. the Quality).
Choose between Unipolar-Mode, where your function is applied to the absolute value of the input and then multiplied with the sign of the input (symmetrical distortion)
and Bipolar-Mode, where you can do different things to positive and negative values (asymmetrical)
The ternary operator is useful for that:
x>0 ? x : 0
is the same as:
if x>0
x
else
0
Values above 1 and below -1 are hardclipped.
You can use three knobs a, b and c (with user-definable min/max values) to quickly alter parameters of your function (these are not automatable though).
I have also included optional DC-offset removal and 4xOversampling.
Special values you can use in formulas: pi, e, res(Current Resolution)
Functions you can use in formulas:
normal operators: +, -, *, /, ^
http://www.ruby-doc.org/core-1.9.3/Math.html <= all of those
Useful ones are: tanh(x); atan(x); log10(x); log2(x); sin(x); cos(x); sqrt(x); acosh(x); cbrt(x)
sin1(x) =sin(2*pi*x)
cos1(x) =cos(2*pi*x)
floor(x)
round(x)
ceil(x)
abs(x)
sgn(x) =sign(x)
clip(x, min=-1, max=1)
I will post some example formulas later
Feedback and suggestions are very appreciated.
EDIT2: Version 1.0.2