Wave Fold (Simple) by Adam-V
A very simple wave folder that bends the selected waveform around a given bipolar threshold. Note that unlike a real diode-based wave folder, any peaks that pass the opposite threshold as a result of a fold will not be folded back again.
Controls Threshold:
Determines both the positive and negative level at which the waveform will be folded. Parts of the waveform that are above the positive of the threshold amount are reflected downwards at that point. Parts of the waveform that are below the negative of the threshold amount are reflected upwards at that point.
Download
V1.1 No functional changes, just reformatting to common lisp standard WaveFoldSimple.ny (1.46 KB)
V1.0 WaveFoldSimple.ny (1.39 KB)
I suppose one way to implement that would be to iterate the process (truncate (/ 0.5 p-thresh)) times.
Another limitation which is a lot more difficult to overcome is aliasing. Ideally the sound being processed should be band limited and the folding performed through waveshaping so as to limit the slew rate of the folding.
In this code snippet the I’ve used the shape function to fold at a level of 0.8. The “table” waveform is made just a little longer than 2 seconds so as to avoid producing a 1 sample glitch at the end of “table”.