Saturation effect - where to start?

Hugues's icon

Hi,

How would you go about creating a saturation effect? Any tips welcome.

rjungemann's icon

There are a few different patches that can work, but if I understand your question correctly, you could run your signal into a [*~] to amplify it, then run that signal into a [tanh~] which has the effect of making quieter amplitudes louder but keeping louder amplitudes relatively consistent. Other functions will work too.

[tanh~] may be a little expensive, so you may consider using a function that approximates it, or use a lookup table.

Consider looking into wavefolding functions as well. For example, [cosx~] can be used instead of [tanh~] for an interesting wavefolding effect. When a sound's amplitude goes above the maximum, the signal "folds back" towards 0. If you were to continue to amplify the sound even further, it would bend back towards the maximum again, and so on. It reminds me of either a gain effect or less extreme phase modulation.

Hope this helps, let me know if I'm off with my response.

Hugues's icon

Thank you for taking the time to answer, this is helpful and should get me started. I guess what I'm actually interested in is waveshaping in order to generate "living" artifacts. I tried the [cosx~] object but somehow it seems less convincing... you just need to feed your amplified signal into it, nothing else right?

mzed's icon

Try adding a little DC offset (+~ 0.1 or something) to the signal before going into tanh~. Asymmetrical distortion is a little richer.

Rodrigo's icon
brendan mccloskey's icon

Goldmine is right Rodrigo, what an astoundingly good resource.

Hugues's icon

Cheers guys !

sepulcky's icon

Also I can suggest to look at the musicdsp site, there are some examples of waveshaping algorithms: http://www.musicdsp.org/archive.php?classid=4