Steve: > All clipping will produce harmonics at higher frequencies than the original waveform. “Soft” clipping will produce a series of harmonics that reduce in amplitude at higher frequencies than “hard” clipping does. Ideally I think we would both want the knee curve to be such that higher harmonics are as low as possible as eventually they will produce aliasing and “bad sound” that we want to avoid. Using the (shape) function it should be possible to tailor the curve shape to anything that we want.
That’s correct. According to my experience the “best” setting of the “knee” depends on many things. The audio signal (speech, music, slow, fast, loud, soft, classic, folk, opera, trash-metal), the dynamic range of the transmission line, and also the amount of backgrond noise in both, the audio signal as well as the transmission line. In many cases the audio signal must be pre-processed by a compressor, otherwise it gets distorted too much by the limiter.
Getting a “good” sound out of a compressed or limited audio signal is an art of its own.
The best setting of the “threshold” and “knee” is virtually unpredictable in advance, that’s why both must be adjustable, while the “output level” slider saves you an additional “amplify” step in the end.
Steve: > Is a log/exp curve the best curve to use?
The answer is definitely YES, because nearly everything in the audio world is based on exponentiation and logarithms, but with different bases. Decibels (volume) are based on log10 while pitch (notes and tuning) is based on log2. Nyquist provides the natural versions of “exp” and “log” (based on the Euler number) because these are the most universal ones, where all other bases can be derived from.
I’ve digged out my math books and in the attachment below is a Lisp file where all the Nyquist volume and pitch conversion functions (like “db-to-linear” and “step-to-hz”) are defined using XLISP’s “exp” and “log” functions. Use it as a cheat-sheet for your own functions.
ARGH: If I try to attach a lisp file I get a message “the extension .lsp is not allowed”. I always thought this is the “Nyquist” section of the forum and now I can’t even attach a Nyquist lisp file. What’s that for a nonsense?
logarithm.ny (4.13 KB)