TBH, wavefolding interests me more for the math and programming than the sound. My first approach was to make a reflector and to put several in series:
reflector wavefolder.pd

I’ve seen this kind of approach from others (e.g. using [expr~]) but it’s unsatisfying because you have to add more reflectors when you want more folds, so I came up with this next version after what felt like an eternity of head-scratching:
wrapping reflector wavefolder.pd

Another solution is to exploit how sine wraps around:
trig wrap wavefolder.pd

With all three versions, the sharp reversals make things very bright and can cause aliasing, which you may not be into, so I wanted to look for an alternative. Returning to how sines and cosines wrap around, I just arranged to overdrive [cos~] with my input signal:
cosine overdrive wavefolder.pd

This is the version I’ve used on the few occasions I’ve thought wavefolding might sound good. The only unsatisfying thing is that it’s never possible to pass the input signal undistorted, even with folding completely off. So I thought maybe I could make a function that’s like [cos~] but linear near the x-axis. The idea comes from hi-fi tube amp design, where the designers try to scale and bias the input signal so that the tube has as linear a current response as possible. Here’s one way:
transferFunction table wavefolding.pd

Note that you can change the non-linear part of the transferFunction table to anything you want. I made both sine and circular reversals; they sound slightly different to me. If you filled the table with a triangle wave then you’d get similar sharp reversals as in the first 2 implementations. I think that even with sine and circular reversals there are more upper partials than with the [cos~] version, so maybe another solution is just to crossfade between the [cos~] version and the clean input when you want undistorted signal.
Know of other ways? Other things to consider? Have a recording that will make me love the sound of wavefolding? Please share!


