Closed baconpaul closed 5 years ago
It would be really great if the distortion fx allowed us to just drop in different algo's...
I actually have had a few ideas for the distortion so I will put them here as well:
Yeah cool ideas! Absolutely the easiest thing is to allow the other waveshapers to be in the mix. It just hard codes to tanh!
tanh at drive is pretty close to hard clipping yeah
Actually no, tanh curve is closer to soft clipping, since it tapers smoothly on the top and bottom. It's a very standard and often used soft saturation curve. Hard clip would be discontinuities on the top and bottom.
Yeah here’s the actual code for the tables in surge
for (int i = 0; i < 1024; i++)
{
double x = ((double)i - 512.0) * mult;
waveshapers[0][i] = (float)tanh(x); // wst_tanh,
waveshapers[1][i] = (float)pow(tanh(pow(::abs(x), 5.0)), 0.2); // wst_hard
if (x < 0)
waveshapers[1][i] = -waveshapers[1][i];
waveshapers[2][i] = (float)shafted_tanh(x + 0.5) - shafted_tanh(0.5); // wst_assym
waveshapers[3][i] = (float)sin((double)((double)i - 512.0) * M_PI / 512.0); // wst_sinus
waveshapers[4][i] = (float)tanh((double)((double)i - 512.0) * mult); // wst_digi
}
Of those at lower drive the tanh will be less hard than hard (good!) more hard than sin; the same as digi just without the artifacts; weirdly different than asym. So tanh is sort of the lower-middle of the waveshaper we have available you are right at low drive.
I meant “at high drive tanh is pretty close to hard clipping” though since it all just saturates.
But what we should really do is just add a parameter to distortion so you can pick between these just like you do with the filter waveshaper. The distortion also right now just hardcodes a ‘0’ in itself and has a parameter slot left.
Yes, that would be a very nice improvement of the distortion effect, changing the shaper curve. I'm all for it :)
Also, when you have large enough gain factors, pretty much anything will sound like a square wave, or just noise, anyways. :)
Alrighty! I just pushed a few changes to the distortion effect for what will be a (small) 1.6.3 release probably in early Nov - along with the VST3 fixes.
There are two changes
The distortion now has a “waveshaper” parameter which picks among the waveshaping tables which are available. The default is tanh which is what used to be there
The gain control is by default unchanged but now supports an extended range (so you can do right mouse / extend on both the pre and post gains). This takes the range from +/- 48db to +/- 144db. At that high a range on the positive side basically you drive the system well beyond stable
It’s pretty easy to get some crazy squeals and instabilities and nastiness out of it. Some of it is really fun. Some of it is also sound. But there’s lots of interesting new settings.
Of course, when playing with the effect, you probably want a limiter after surge in your DAW in case you blow up something; and you probably don’t want to use in-ear headphones. At least until you get a feel for those higher gain responses.
Look forward to feedback.
Had a report from user zvenx on slack that patch Bass2 was running hotter on nightly than 1.6.2.1 so I may have screwed up the patch upstreaming (since bass2 uses distortion). To be investigated!
Tagging @zvenx
Right so absolutely the case that 1.6.2.1 with fddee1d cherry-picked in has higher gain. Only a few places to look really so I'll look at them!
Duh dumb bug - found it. Entirely my fault! PR coming.
I realized I should play the same xpand trick in drive so will do so before I close this and shop 163
So I am pretty sure this isn't needed (the drive extension).
At +24db on a regular sine input this is the output with the Hard waveshaper
That's pretty square. So I'm calling the gain extensions good enough and closing this issue.
my response