Waveshaper

Post any examples or modules that you want to share here
Post Reply
TheOm
Posts: 103
Joined: Tue Jan 28, 2014 7:35 pm
Location: Germany

Waveshaper

Post 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
Attachments
ExpShaper02.fsm
(46.8 KiB) Downloaded 1509 times
Last edited by TheOm on Wed Jul 02, 2014 6:35 pm, edited 3 times in total.
User avatar
CoreStylerz
Posts: 327
Joined: Sun Jan 22, 2012 2:19 am
Location: italy
Contact:

Re: Waveshaper

Post by CoreStylerz »

it's really amazing. ;)
Need my support for app development, website or custom scripts?
PM me if you are interested.
Experienced Java, J2EE, PHP, Javascript, Angular, Cloud Solutions developer.
Exo
Posts: 426
Joined: Wed Aug 04, 2010 8:58 pm
Location: UK
Contact:

Re: Waveshaper

Post 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.
Flowstone Guru. Blog and download site for Flowstone.
Best VST Plugins. Initial Audio.
User avatar
trogluddite
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: Waveshaper

Post 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.
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
Tronic
Posts: 539
Joined: Wed Dec 21, 2011 12:59 pm

Re: Waveshaper

Post by Tronic »

Missing in your schematic, the module SSE Floor and the module Stream ABS, into is empty.
TheOm
Posts: 103
Joined: Tue Jan 28, 2014 7:35 pm
Location: Germany

Re: Waveshaper

Post 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.
Post Reply