i would like to add a softclip to my output
i would like to stop my output from clipping when i mix in different sources
what would be the best way to do it?
Have a look at the [tanh~] helpfile, which might do some of what you need.
lh
If you are trying to create a "soft clip" after the signals are mixed, then [tanh~] is the way to go.
If you are trying to prevent your signals from clipping at all, then you need to scale the individual signals with [*~] before you combine them. Remember in MSP, the combined signals have to be 1.0 or less in amplitude to avoid clipping. If I'm combining two signals, then I usually put a [*~ 0.5] on each signal. That way, assuming neither of the incoming signals exceeds 1.0, the combined level will remain at or below 1.0. Obviously, for more signals, you need to scale them each down even more.
If you want to do it a bit more intuitively, then use a [gain~] slider on each of the signals before you combine them and it will be more like a mixing console.
if you're talking about a limiter, then there's omx.peaklim~
but scaling everything down is advisable too.
clipping is only a problem at the dac~. if you have signals larger than 1./-1. going from place to place within your patch, it's ok, they won't clip. you just need a master volume control actually!
I would look into the omx objects which come with Max. There are limiters, compressors and alike...
Stefan