Spiral
TL;DW: New best smoothest distortion algorithm.
What if… the building-block sine-based saturation routine I build so many things on, which I thought was the smoothest distortion you could have, is NOT the ideal distortion?
I was watching a youtube video by Brady Haran, on his ‘Numberphile’ channel. It was about the golden ratio, and it showed the little drawing you’ve maybe seen, where you take a golden rectangle, and then make a square on it and put a circle segment (like when I use sine curves for my distortions), and then make a smaller square next to it and a circle section on that which connects, and so on ad infinitum. A ‘spiral’ like a seashell, a golden ratio spiral.
And Brady says, ‘of course this isn’t actually a spiral’ and my mind: blown.
Because of course it isn’t. It’s circle pieces butted up against each other, and only looks like it’s connected because it’s pretty flat going through those points. But the rate of curvature changes really suddenly and drastically at those points… and does it the same way, at the zero crossing of ConsoleChannel, Density, PurestDrive, PurestWarm, Channel, and lots and lots of other plugins I’ve made. It’s part of the ‘fatter, smooth’ sound of some of my distortions. Seemingly really fat and analog-sounding, but there’s a discontinuity as you go through zero, which is why it makes the audio sound obviously different.
People do like making the audio sound different, but people HATE the sound of discontinuities. An old version of Channel where I hacked in a ‘flat’ undistorted section, got me a huge blowback of dismay and outrage until I put it back to the simple sine-based one. People are incredibly sensitive to second order discontinuities, where the output number will be 0 but the direction things are changing will suddenly be the opposite. That’s what made the old ‘New Channel’ be such a failure: the center of the wave was flat no-distortion, and then without making a visible discontinuity it would suddenly change to ‘tighter sine-based saturation curve’, both on the negative and positive sides of the wave. It would look perfectly normal but people just hated the sound. Now I know why. And now it turns out the sine based one HAS a discontinuity, at the zero crossing, right where you’d get class AB and B distortion, and it never occurred to me.
And I can fix it, and turn the code for that part into ONE line of reinvented original code, which will be open source because I’m Patreon-supported and don’t have to stop people using my good audio code (they only have to credit me when they use it: it will be very possible to tell when they do. They don’t have to pay anything since it’s an MIT license, and they don’t have to open their own source, just publically credit that they used my Spiral code).
And of course I did: here, have Spiral, free. You can just install this and listen to it, if the video and the post are too long. This is the proof of concept which can be used in several useful ways. There are no controls, at all. You can gain stage into it and do stuff with it and sit it on the top of every track like it was PurestDrive or Channel, or use it as a 2-buss clipping stage, where it will clip to around -1.4dB with about -0.4 intersample peak maximum (so it is Mastered For iTunes friendly, used as a final clip). It also has a ‘freak out mode’ if you massively overdrive it, and you can do that with things like uncompressed drums, and it makes noises you’ve never heard before, or when used more gently it just sounds like the ultimate analogification.
I really had no idea I could do a basic saturation algorithm (which still uses long double precision sines as part of it) that was that good. It’s a considerably bigger sonic improvement than the new noise shaping technique, because what it does is on a far higher level… though of course it also is using the new noise shaping, for good measure. All the latest everything, right here.
Bear in mind, the original sin()-based one in Console5, PurestConsole etc. is still optimal for Console5 encode/decode because it can be lossless and has significant effect at low levels. My tape emulation stuff uses the ‘fattening’ effect of that on purpose. I can’t just go through and replace everything because all the sounds will change. I have to re-voice everything that would take advantage of the new code, and I’ll do it, and it’ll take time and effort, and probably become new versions of things so you can still have the ‘sine fatness’ versions if you want them. I don’t like taking sounds away from people, and old tones shouldn’t be removed or made inaccessible.
But what if there’s a WAY better analog-sounding distortion effect based on the way that the ‘constructed’ golden ratio seashell/spiral made of circle sections in boxes that get smaller, is NOT correct because much like the simplest sine-based overdrive, it doesn’t start with zero distortion but with the same tiny distortion the whole time (which, in joining to the opposite pole, makes a discontinuity you can’t see much like the golden ratio ‘spiral’ has discontinuities you can’t see?) …and I fixed it?
Try Spiral, and I will get to work incorporating this into my library of audio plugins that I make available using my Patreon. I’ve put out more than 100 plugins for you to freely use, since I started doing it. If even one of them is so useful that you’d have paid $50 for it as a commercial plugin, please join my Patreon at the equivalent of $50 a year. Or, you know, if you think I do good work and I’m better off continuing to do this stuff full-time with awesome resources, and not taking a day job or trying to fix my own porch with time I should spend coding stuff for you. It’s as simple as that.
And yes, my porch is still broken, but this has been a good day. :)
This is super exciting, I can’t wait for the spiral-ized version of Density!
@Norlick Agreed!!!!!!!
You’re awesome. I’m doubling my Patreon.
Exciting times! Gonna try it out with BitShiftGain + PurestGain in FL’s Patcher and see what modular nonsense I can make with this new tech.
I wonder what other shapes would sound interesting?
Euler spiral? Hyperbolic spiral? Lituus? Fermat’s spiral could be interesting in that the positive and negative appears to curve into the same direction after a bit. Logarithmic spiral might be what you’re already using since it appears to be what the golden ratio spiral approximates.
Involutes / Evolvents look interesting, “a curve obtained from another given curve by attaching an imaginary taut string to the given curve and tracing its free end as it is wound onto that given curve; or in reverse, unwound.” Perhaps an involute of a logarithmic spiral?
The hundkurve / tractrix looks interesting conceptually when described as a dog following the curve with the leash pulling the master along a a straight horizontal line. The pulling aspect seems like it could have a cool effect when the dog moves back down below the master and the master isn’t immediately pulled the other way, though I don’t think the tractrix works that way exactly and instead needs the leash to be more of a solid pipe with no slack or stretch.
Cycloid appears simple and perhaps useless on its own, like a rectifier with an output one third the frequency, at least with smooth circles. No idea how it’d change with anything slightly more exotic for input.
Could a fractal like a Lindenmayer system that looks like tree branches be used? Perhaps it uses the shape of one path down a fractal using a random or somehow derived value to decide which path to take when it splits each time?
What about attractors / strange attractors? Those have curves and multiple dimensions that could be used for various inputs / outputs like rate or change or slewn / slewed signal or slew-only signal or an average or time since a detected transient or time since it passed a threshold kind of like OneCornerClip.
What about how a sidewinder snake moves with a sine-like shape, leaving a path of diagonal slashes in sand?
I imagine they’ll probably all sound like bad fizz but maybe something about them will start a new idea, like that Numberphile video.
This is a jaw-dropper.
@Jacob. I TRULY do hope that he (or someone as smart) experiments further with the curves.
@Chris from Airwindows, may you keep revolutionizing the scene until your last breath!
This one does not work on my mac,no controls or sound changes just a grey strip-help with this please?
That’s how it’s supposed to be, you can verify it’s working by driving it harder with BitShiftGain or PurestGain. It’ll get a sort of foldback distortion / AM sound that gets quieter as the input gets a lot louder.
Your work is both Art and Science Sir Chris!! <3 <3 <3
I have been hoping for something this smooth and sweet, and bango zoombah…magic Chris dreams the dream into existence. Mucho thankos.
Was about to give it a test drive today, but alas my ancient Wavelab 5 seems unable to handle all the excitement. :(