I threw this together a couple of weeks ago and have found it to be a nice and useful saturation source.
The theory and implementation is based on the hysteresis emulation in Jatin Chowdhury's CHOW Tape plugin as presented in this article https://dafx2019.bcu.ac.uk/papers/DAFx2019_paper_3.pdf .
The code is then founded on ggee's moog~, because i'm pretty much clueless in C# and needed a starting point.
I'm not sure how to give "proper" credits so i hope this doesn't step on any toes.
There are also some 'original' parts to this so I will claim some credit. It took a lot of trial and error to find the best interpolation and filtering methods and to make it stable and sonically pleasing. I think about 500+ builds after all was said and done..
NOTE* This is fairly stable but i've noticed that it can get a bit upset sometimes and need a reset right after loading a patch. Don't know whats up with that but you can work around it by, for example, using 'threshold' to trigger a reset.
It's only tested on OSX but the makefile should work on other systems.. Just navigate the terminal to the correct folder and "make hysteresis~"
and you should be GTG.
A very fast and simple method i almost always use is writing tables in the audio domain.
There are examples in the docs that showcase this, one i can remember is the one about transition splice oscillators...
I'll include a slightly descriptive version of my goto setup: tablewriter.pd
(That uses a couple of audio-maths objects from externals for shaping the slopes i'm writing, but if you are using extended those are probably included in your library.)
The one flaw with this is that you will start loosing 'accuracy' with bigger tables. if you are writing a 500'000+ index table you will need to fiddle a bit with the frequency and phase onset of the phasor~.
But for fast prototyping with transfer-functions it is a very good, and fast, alternative!
I haven't seen this method posted anywhere so i thought i'd share it. It doesn't alias audibly, within my hearing range at least, at 96k sr.
It works by clipping the peaks of the wave and replacing them with a sine function.
Theres some maths involved in scaling it with frequency, and patching the triangle and the sine parts together, but nothing too heavy. Uses under 1% cpu per instance on my 2010 mackbook, at 96k.
-I scaled the cutoff frequency (Above which it outputs a pure sine wave) for a 96k samplerate, so that might have to be adjusted a bit for lower rates. Just play with the cutoff constant (now 18800).
-The overall amplitude diminishes as the frequency increases. Because i prefer it this way.
edit. Apparently abs~ is from zexy. It will work without it, but won't handle negative frequencies correctly..
Oh yeah, if i would experiment further i might try having a lowpass filter in a loop set at something like 1/8th or 1/16th of the fundamental frequency, and then use a multiplier to compensate for the volume loss (and some transfer function to save your ears when it inevitably blows up!). As you probably know, a lopass filter is basically just a 1 sample delay loop, so you could probably use that fact in some way.. Please share what you end up with
I was inspired to put something together you might find useful
The big thing there is the impulse generator, it generates one cycle 'waveforms' with a period according to the frequency. I made one that is continuously variable between saw and triangle
In the example the delay time was controlled at control speed, using smooth signals to control the time removes the ugly glitches when changing pitch.
Also, if you want to use noise to exite the loops you might try using brown noise instead to get more low en out of it
Now, i've never messed around with 'KS' and don't really follow what is happening, so i might be completely off topic here. But if low frequencies start making things unstable or crunchy in bad ways you might want to try doing what is often done in analog circuits: Shelf or cut low end at the input and boost it back up at the output. The clip sounded very cool, love a crunchy bass-synth
I was in a rush last night.. I removed some junk, fixed some filter phasing and corrected a mistake i made with the Hysteresis subpatch. Sounds pretty tight now IMHO.
After a quick rundown i think its just dependant on two externals, Zexy and Else.
z~ , one sample delay, from Zexy. And lag2~ + glide2~ from Else.
I hope someone finds this entertaining I recommend using a cabinet convolution with this. I've used partconv from AudioLab (loaded with an ownhammer alnico silver IR) on the recording of the attached sound sample.