thanks to claudius maximus and others for this idea.
it lets you increase the volume of an audio stream without getting nasty digital clipping and buzzing. ..of course sometimes you do want that sound, but more often than not it will add nasty frequencies to your sounds when you push their volume up too high.
you can use it in any situation where you you normally use [clip~ -1 1] ... or the way i prefer to think about it is that you can use it in any situation where a hardware device has an audio output.
so, if you make a synth running through an effect to a mixer, then you would use the tanh function at the outlet of the synth audio stream, then another one at the outlet of the fx stream, and then again at the outlet of the mixer.
the simplest way to do it is this:
[inlet~]
|
[expr~ tanh($v1)]
|
[outlet~]
but [expr~ ] kills your cpu, so it's better to put the function into a table, and then just read the table with [tabread~]
so, here we go: