When working on new clipper plugin I suddenly found that oversampling can’t avoid intersample clips in all cases. Oversampling can reduce possibility of them but not completely avoid. See cooly picture (top samples are exactly 0 dB but the real signal is far above):
The idea is first to calculate real peak value using oversampled peak meter and next apply gain reduction not for single sample but for some window around it.
I’ve implemented both oversampled peak meter and window function-based gain reduction stage in this softclipper test plugin:
[Serp 2 Clipper Win 32 64 VST version]
Read more of this post