How to build SNEX Playground?
-
@Casmat And one other thing, have you tried to plot your formula to see what you get out from it? Because it's going over the -1/+1 gain factor so you either need to scale the output or rework the formula...
-
@ustk thanks for the info! I don’t think ive done anything with the formula, i found it on music dsp and I was clueless from the start on how to get it to be a simple saturator,
is the gain factor related to the gain matching on a saturator?Edit: so the gain factor is x?
-
@Casmat So I imagine
a
is your gain, right?
What do you get as a result? Is it at least sounding "something"?
Does the level need to be tamed a bit perhaps? -
@ustk as far as I know when looking at it, I thought that x was the input signal and a was the saturation amount
-
@Casmat said in How to build SNEX Playground?:
Edit: so the gain factor is x?
f(x) means the it's the output, so a should be the gain
-
@ustk ohh yeah! Polynomials (or maybe not)!
-
@Casmat At first, does it look the way you want?
![Screenshot 2023-08-18 at 20.47.17.png](Imgur is temporarily over capacity. Please try again later.)
EDIT @Christoph-Hart @Dominik-Mayer Apparently there's still this Imgur over capacity issue that prevents us to see images...
-
@ustk why was there an float s in the arguments? And I should be declaring a as a variable, right? I put the code you gave
if (x < a) out = x; else if (x > a) out = a + (x - a) / (1.0 + Math.sqr((x - a) / (1.0 - a))); else if (x > 1) out = (a + 1.0) / 2.0;
In the get sample func?
Edit: didn’t see your post yet, the img seems broken
-
-
@Casmat if imgur is over capacity then there‘s nothing we can do except for stop uploading images :)
-
@Christoph-Hart Yeah I though it was somehow related to the forum... Or use another provider
-
-
@Casmat You definitely need to declare
a
At first, make it0.0
Then add a parameter to control it -
@ustk shouldn’t the a be from 0-1? And there were some comments under that music dsp post, do we have to do normalization or am I yapping away at nothing?
-
@Casmat and as for the image, isn’t that how the saturation should look like
-
@ustk hmm, seems like im missing part of the picture, im not really understanding the whole use of the soft saturation function vs other common saturation functions like a tanh function, have you got any resources that can help me learn more about saturation dsp or dsp in general a bit more? I feel like getting a better understanding would help me ease my way into Snex cause I have little clue what all this dsp does. Thanks for your help so far, opened my eyes to the vastness amount of info I’m missing and I’m pretty eager to learn more! After taking some time to research, it may be right to jump back at this, right?
-
@Casmat A good sounding distortion unit is much more than just the saturation function. It needs clever filtering, oversampling to remove aliasing, etc... Tanh is a good starting point, but you need to understand if you want more or less of the odd or even harmonics, or asymmetric distortion. And this is only the beginning, as a "true analog sounding" algorithm is much more... You might find some literature about this in your fav search engine. The first steps you've made is a good start! Just go for a simpler equation until you know what it does
-
@ustk Thanks! Will definitely take a look!
-
@ustk Think I'm ready to try again with the saturator, did some research on the topics and I feel much more confident going forward! Seriously, thank you haha! Instead of going for that other formula, i found a more simpler cubic formula: https://www.hackaudio.com/digital-signal-processing/distortion-effects/soft-clipping/
So with the formula, would the equation in snex look something like this?
out = in - a * (1.0 / 3.0) * Math.pow(in, 3);
Edit: All the filtering/oversampling should be done with other nodes in scriptnode, right? or is it within the snex shaper node itself?
HiseSnippet 1321.3oc2X0sSbaDEdLvPxRRpZhRT6k9hdAQJEsKMMsR8h.rvlrpYAKLkj6PSrmkczNdFKOiA1V066iUeD5iPeDxaP643wK1FVQgsoIsEjf87yLy24+CDjoi3FiNi305fIobh2cogST1QcGwDJR+sIdeBc.yX4Y9NVaMIkYL7Xhm2hu.Y30ZIRwWu64awjLUDuhEgbnVDwekHQXq3Frw2KjxdrX9AhjZZ+zM5GoUc0RcNfmEosIornwri46xP0VfR7VdmXgUmEZYVtAzYKc7jvQ5SUN8OTXDuUxQhNjP3hbrIcGIjwASsUCg3QCpr7EcV9CoCDwhy4W4A9zBA9UmntOvagqBRctAPxqFjVxAo6SCixDo1JIHdtCsuBBHCYfqtNTb5R79UZWMnfxtVBaLuWFPb9AV8Ysa+De3GO96FlqhrBsxWq1Ua46oV8wq7SqzZkedE+KJZ3vYJCelLsTxyloXL5lcUGbUUdxa4YOw+DlLmethf42zmt70ymF4r5ZJpU8UB6do7R5dZYL5qvOe4H.ozsAe5G5uMyxvfRIOPuTdlUfvwaa9IPVsKD0htM2L1pSg75KE+fLGcbtjYalNg0MkB.+QiXHFnTFgcR85paPNV6qLG65Bw6SCD1nQyFiKLCLBdp+IvXYk48n6LbHOxVAvkn8dy7VF19FWF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5asV1C
Thanks!
-
@Casmat for these simple one liners you can also use the
math.expr
node, just rename your variables toinput
andvalue
and you can use the single parameter as drive parameter:output = input - value * (1.0f / 3.0f) * Math.pow(input, 3.0f);
and yes, the filtering and oversampling can be done with dedicated nodes.