Page 1 of 1

Waveshaper

Posted: Tue Jul 01, 2014 2:36 pm
by TheOm
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

Re: Waveshaper

Posted: Tue Jul 01, 2014 5:17 pm
by CoreStylerz
it's really amazing. ;)

Re: Waveshaper

Posted: Tue Jul 01, 2014 5:58 pm
by Exo
Thanks for sharing. I will take a look when I'm back at my PC.

I made a wave shaper once, had a graphical envelope with 4 times oversampling called X wave. So I will be looking at your techniques with interest.

Re: Waveshaper

Posted: Tue Jul 01, 2014 7:32 pm
by trogluddite
Welcome to the forum, TheOm! :)
What a great first download - the 'user variables' are an excellent idea, really makes twiddling with the equation easy. Not had a chance to sling my bass through it yet, but I'm betting the big lookup table and oversampling will allow some nice smooth "atan" type saturation.

Suggestions? Nothing much springs to mind - you could maybe "include" the Math module (or "self.extend(Math)") rather than redefine the methods - but that's just hacker nit-picking, and it won't make it sound any better! ;)

Good to have you join the party - looking forward to whatever other goodies you're cooking up.

Re: Waveshaper

Posted: Wed Jul 02, 2014 9:31 am
by Tronic
Missing in your schematic, the module SSE Floor and the module Stream ABS, into is empty.

Re: Waveshaper

Posted: Wed Jul 02, 2014 2:09 pm
by TheOm
Thanks everyone.
trogluddite wrote:the 'user variables' are an excellent idea, really makes twiddling with the equation easy

Well, to be honest, I did not come up with it myself.
The whole plugin is baiscly just a "Hey, I can do this too"-kinda thing. ;)
trogluddite wrote: you could maybe "include" the Math module (or "self.extend(Math)") rather than redefine the methods

Yes, thank you, I changed it now.
Tronic wrote:Missing in your schematic, the module SSE Floor and the module Stream ABS, into is empty.

I think it was a Flowstone bug, it's fixed now.