So Ive made a basic waveshaper, but Im having an issue correctly applying gain. So for example, if I used a tanh(x) soft clip as my waveshaper, since the function limits at -1 and 1, no matter how much pregain I apply, Im never getting an absurd amount of output difference. But if I use a polynomial or any formula not limited at -+1, when applying gain I start to get some absurd output levels well beyond 50db clipping. Currently Im using the the “setGainDecibles” method used in the waveshaper JUCE tutorial as such
So my 2 questions are ,
Is there a better way to apply gain in this situation? Or do I need to more carefully choose my formulas so that they limit at -+1? How would I do asymmetrical wavehshaping in this case?
How do mainstream plugins implement this? For example, decapitator or saturn. Though you can distort it quite a bit the output volume difference is not that great, even with the auto output turned off.