Hi @Cannonball and @servandisco
You can also have a look on my tiar/dist/fold object
(I called it "fold" instead of "wavefolder" so that the object does not get too big on the screen...).
See the help file in
help -> community -> tiar -> dist -> fold
to see how it work.
This wavefolder uses first order differentiation to limit aliasing.