Closed ndonald2 closed 2 years ago
@ndonald2 This is a fantastic PR! π
Thanks for the contribution, and for the excellent audio/video demoes along with the example.
Everything looks good at first glance. We'll get it merged in sometime in the next few days!
Hi @stephenhensley, I'm sure you're quite busy so no rush at all, but wondering if you thought this might get merged soon-ish? Or any feedback to make sure it's merge-able? Thanks!
@ndonald2 sorry for the delay!
I think this is good to merge!
Some sort of eventual-addition might include a threshold of some-sort, separate from the gain that would control the overall amplitude once folding starts to occur. However, this is totally doable externally with a few multiplies by the user, and would otherwise, and definitely isn't always needed or useful.
Thanks again for the awesome contribution!
Summary
Adds a very simple and basic
Wavefolder
class/module for growly wavefolding goodness!Details
This is a dead simple wavefolder based on original code by me. It's implementing this function where
k
represents the gain anda
is the offset.It's not anti-aliased so you will get aliasing at higher harmonics, especially at high gain levels and for higher input frequencies. But I still think it sounds pretty rad.
Examples
Be sure to un-mute π the video players
Slow gain sweep on a triangle wave
https://user-images.githubusercontent.com/1433497/183200947-663945ad-044e-4366-82f3-706a5777502b.mp4
Audio rate thru-zero modulated folding
Gain parameter modulated at audio rate by an oscillator one octave below the input signal, modulated by an LFO
https://user-images.githubusercontent.com/1433497/183202624-e4437cc5-ae23-401d-bfa5-f9b7ed0dc5f2.mp4
Example Usage
This the source from the first video example above