Okay, so I think I'm pretty much done with this simple diode circuit. The final version, which is uploaded to the community library, uses two lookup tables - one for the lower 1/8th of the input range (high resolution), and one for the remaining 7/8 (lower resolution)
I was not getting anywhere with any other approximation I've tried - polynomials, weighted taylor expansions, segmented polynomials - it was all either too inaccurate or simply not worth the additional computation cycles. In the end the best performance-to-computation ratio was the dual-lookup table method. And given the large program memory of the STM32, it doesn't really affect anything to have a large lookup table somewhere in the flash (to my knowledge, const global variables will be put into the flash memory - or am I wrong here?)
Still, the object consumes ~4% CPU which is a little too much for my taste, but meh, I'm not gonna optimize this further.
dist/soft (which is a simple polynomial distortion) consumes ~0.5% CPU but sounds a little less dirty to my ears. The diode distortion has more pleasing overtones, but if CPU cycles are a concern, I'd consider the factory version the better choice.
So the next circuit I'd like to takle is the Moog CP3 mixer. This is another relatively simple circuit (I hope), but it has plenty of interesting characteristics, including
- different distortion on its positive and negative outputs,
- a type of distortion that enhances the bass instead of cutting it away
- a kind of compression due to the way the mixbus is designed (ducking the other inputs when you increase the volume of a channel)
It is said to be a substantial part of the massive sound of a Moog modular. So, let's see how much of that Mojo we can recreate on the Axoloti, shall we?
Here's the original schematic and a video showing some of the interesting features of this mixer. I'm going to build the mixer after the schematics from this clone which contains only the typical parts every DIYer will probably have somewhere in their drawer.
I'll be off to visit my family during the festive season, but I'll be tackling this in the new year. If anybody want's to start working on this, I'll happily follow along, but I won't have time to actually build the real thing in the next few weeks.