Peak Limiter / Expander

Obviously care needs to be taken with peak expansion to avoid clipping, but I noticed that excessive expansion can cause infinite or “not a number” (nan) sample values. This is not good.

This version prevents infinite and “nan” values. For expansion settings the output level is limited to 0 dB which I think is the neatest way to handle the issue.
peakprocess.ny (1.76 KB)