Any way to recreate the ShapeFX curve module in Scriptnode?
-
Or just have a waveshaper where you can edit the waveshape with a table? I don't want the other various modes, just the curve function.
-
@DanH You'll need to interpolate in a lookup table, that is populated with the curve.
So basically an array that reflects the curve's shape, with enough data points for a smooth interpolation.I have tried to go down this road, but when the centre of the curve moves (so around the "0 signal" area), it obviously introduces an offset that makes horrible pops and cracks (because you are basically saying "when there's no signal, introduce a constant value...).
I haven't found an efficient way to prevent this from happening. Of course the first thing that comes to mind is just using a HPF set to let say 5 or 10Hz, but it's not enough for a clean result.This makes it particularly hard for an asymmetrical waveshaper.
I am still waiting to find a good solution for it to sound natural... @griffinboy? -
C++ or snex is the only way I'd do it.
Waveshapers are about mapping raw samples to other values. It's inherently low level dsp since you are manipulating each sample. Simple low level, but lowlevel nonetheless.for dc offset, there are a few filter designs that are suited particularly to removing it. You can find source code online for them.
LUT waveshapers are something I've done lots in c++
I use python to prototype them and generate a fat array. Then yeah, linear interp between data points, as well as making sure to clip the input so that it can't go over the edges of the waveshaper. -
@griffinboy said in Any way to recreate the ShapeFX curve module in Scriptnode?:
C++ or snex is the only way I'd do it.
Absolutely, I've done it in C++ (unless there's a way with a network, frame node, and table? but I guess that wouldn't be efficient...)
for dc offset, there are a few filter designs that are suited particularly to removing it. You can find source code online for them.
Yeah I tried to run my own filters but still it wasn't clean... You have a particular design in mind? I'll make some more research...
Clipping is important I agreePopulating the LUT following the curve is kinda tricky as well. Depending how the curve has been made... he Hise table is way too basic, and it's not easy to get an algorithmic bezier. I have run my own curve from which I get the points in a way I am not proud of... => going along the path intersecting with a line... In the end I'd like to run a real bezier curve to get precise points from the equation.
-
python, julia or matlab is your friend.
There are many scientific libraries for LUT generation, which can do curve fitting and other clever thingies.I have an entire custom app built in python that can reverse engineer waveshapers from any linear shaper vst. I've reverse engineered many algorithms automatically using this tool.
BTW, use JuceVectorizedMath if using c++
You can do multiply add operations on a whole buffer. Efficient.