<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[vanilla wavefolding implementations]]></title><description><![CDATA[<p>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:<br />
<a href="/uploads/files/1781439870634-reflector-wavefolder.pd">reflector wavefolder.pd</a><br />
<img src="/uploads/files/1781439884563-screenshot-2026-06-12-120337.png" alt="Screenshot 2026-06-12 120337.png" class="img-responsive img-markdown" /><br />
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:<br />
<a href="/uploads/files/1781439908523-wrapping-reflector-wavefolder.pd">wrapping reflector wavefolder.pd</a><br />
<img src="/uploads/files/1781439920032-screenshot-2026-06-14-081723.png" alt="Screenshot 2026-06-14 081723.png" class="img-responsive img-markdown" /><br />
Another solution is to exploit how sine wraps around:<br />
<a href="/uploads/files/1781439948547-trig-wrap-wavefolder.pd">trig wrap wavefolder.pd</a><br />
<img src="/uploads/files/1781439961873-screenshot-2026-06-12-120511.png" alt="Screenshot 2026-06-12 120511.png" class="img-responsive img-markdown" /><br />
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:<br />
<a href="/uploads/files/1781439982015-cosine-overdrive-wavefolder.pd">cosine overdrive wavefolder.pd</a><br />
<img src="/uploads/files/1781439994243-screenshot-2026-06-12-120553.png" alt="Screenshot 2026-06-12 120553.png" class="img-responsive img-markdown" /><br />
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:<br />
<a href="/uploads/files/1781440016257-transferfunction-table-wavefolding.pd">transferFunction table wavefolding.pd</a><br />
<img src="/uploads/files/1781440026001-screenshot-2026-06-12-120701.png" alt="Screenshot 2026-06-12 120701.png" class="img-responsive img-markdown" /><br />
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.</p>
<p>Know of other ways? Other things to consider? Have a recording that will make me love the sound of wavefolding? Please share!</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15904/vanilla-wavefolding-implementations</link><generator>RSS for Node</generator><lastBuildDate>Tue, 16 Jun 2026 02:14:46 GMT</lastBuildDate><atom:link href="http://forum.pdpatchrepo.info/topic/15904.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 14 Jun 2026 12:29:34 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to vanilla wavefolding implementations on Sun, 14 Jun 2026 12:29:34 GMT]]></title><description><![CDATA[<p>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:<br />
<a href="/uploads/files/1781439870634-reflector-wavefolder.pd">reflector wavefolder.pd</a><br />
<img src="/uploads/files/1781439884563-screenshot-2026-06-12-120337.png" alt="Screenshot 2026-06-12 120337.png" class="img-responsive img-markdown" /><br />
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:<br />
<a href="/uploads/files/1781439908523-wrapping-reflector-wavefolder.pd">wrapping reflector wavefolder.pd</a><br />
<img src="/uploads/files/1781439920032-screenshot-2026-06-14-081723.png" alt="Screenshot 2026-06-14 081723.png" class="img-responsive img-markdown" /><br />
Another solution is to exploit how sine wraps around:<br />
<a href="/uploads/files/1781439948547-trig-wrap-wavefolder.pd">trig wrap wavefolder.pd</a><br />
<img src="/uploads/files/1781439961873-screenshot-2026-06-12-120511.png" alt="Screenshot 2026-06-12 120511.png" class="img-responsive img-markdown" /><br />
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:<br />
<a href="/uploads/files/1781439982015-cosine-overdrive-wavefolder.pd">cosine overdrive wavefolder.pd</a><br />
<img src="/uploads/files/1781439994243-screenshot-2026-06-12-120553.png" alt="Screenshot 2026-06-12 120553.png" class="img-responsive img-markdown" /><br />
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:<br />
<a href="/uploads/files/1781440016257-transferfunction-table-wavefolding.pd">transferFunction table wavefolding.pd</a><br />
<img src="/uploads/files/1781440026001-screenshot-2026-06-12-120701.png" alt="Screenshot 2026-06-12 120701.png" class="img-responsive img-markdown" /><br />
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.</p>
<p>Know of other ways? Other things to consider? Have a recording that will make me love the sound of wavefolding? Please share!</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15904/vanilla-wavefolding-implementations</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15904/vanilla-wavefolding-implementations</guid><dc:creator><![CDATA[jameslo]]></dc:creator><pubDate>Sun, 14 Jun 2026 12:29:34 GMT</pubDate></item><item><title><![CDATA[Reply to vanilla wavefolding implementations on Mon, 15 Jun 2026 12:13:25 GMT]]></title><description><![CDATA[<p>One day I saw a 0-coast video displaying the waveform changes from it's &quot;multiply&quot; knob (the wavefolder of the synth). I came up later with a way to somehow replicate it:</p>
<p>input =&gt; asin =&gt; ×amount =&gt; sin~</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15904/vanilla-wavefolding-implementations/2</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15904/vanilla-wavefolding-implementations/2</guid><dc:creator><![CDATA[kyro]]></dc:creator><pubDate>Mon, 15 Jun 2026 12:13:25 GMT</pubDate></item><item><title><![CDATA[Reply to vanilla wavefolding implementations on Mon, 15 Jun 2026 15:37:58 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/kyro">@kyro</a> Oh cool, I missed the fact that you could take the arcsine first, but of course now it seems completely obvious <img class="emoji emoji-extended" src="http://forum.pdpatchrepo.info/plugins/nodebb-plugin-emoji-extended/images/grinning.png" title=":)" alt=":)" /></p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15904/vanilla-wavefolding-implementations/3</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15904/vanilla-wavefolding-implementations/3</guid><dc:creator><![CDATA[jameslo]]></dc:creator><pubDate>Mon, 15 Jun 2026 15:37:58 GMT</pubDate></item><item><title><![CDATA[Reply to vanilla wavefolding implementations on Mon, 15 Jun 2026 21:08:01 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/kyro">@kyro</a> This looks interesting. Do you have a sample patch?</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15904/vanilla-wavefolding-implementations/4</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15904/vanilla-wavefolding-implementations/4</guid><dc:creator><![CDATA[jamcultur]]></dc:creator><pubDate>Mon, 15 Jun 2026 21:08:01 GMT</pubDate></item><item><title><![CDATA[Reply to vanilla wavefolding implementations on Mon, 15 Jun 2026 22:29:05 GMT]]></title><description><![CDATA[<p>I have no standalone sample patch. Sorry. Be very patient please.<br />
Basically an input sine going throug asine turns to triangle which from a sine point of view looks a lot like a saw and gives a sine again. If you multiply the triangle from asine by a drive&gt;1 the sine folds quite gently. Then there's a dry/wet crossover to add some folded waveform to the input. It adds a partial to a sine and I used that for a hack of a bandlimited squarewave. Then I stopped tinkering with wavefolders.<br />
<img src="/uploads/files/1781562512701-capture-d-%C3%A9cran-du-2026-06-16-00-25-28.png" alt="Capture d’écran du 2026-06-16 00-25-28.png" class="img-responsive img-markdown" /></p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15904/vanilla-wavefolding-implementations/5</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15904/vanilla-wavefolding-implementations/5</guid><dc:creator><![CDATA[kyro]]></dc:creator><pubDate>Mon, 15 Jun 2026 22:29:05 GMT</pubDate></item><item><title><![CDATA[Reply to vanilla wavefolding implementations on Mon, 15 Jun 2026 22:34:46 GMT]]></title><description><![CDATA[<p>the &quot;bandlimited&quot; &quot;squarewave&quot; wavefolding hack:<br />
<img src="/uploads/files/1781562873445-capture-d-%C3%A9cran-du-2026-06-16-00-33-28.png" alt="Capture d’écran du 2026-06-16 00-33-28.png" class="img-responsive img-markdown" /></p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15904/vanilla-wavefolding-implementations/6</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15904/vanilla-wavefolding-implementations/6</guid><dc:creator><![CDATA[kyro]]></dc:creator><pubDate>Mon, 15 Jun 2026 22:34:46 GMT</pubDate></item></channel></rss>