Modelling analog circuits in software


#21

Another advantage of polynomial segments is that you can use integro differential anti aliasing to limit aliasing.


(appendix A.3)

I use this trick to limit aliasing in many distortion objects in tiar/dist


#22

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.

The factory 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.


#23

I don't have the EE degree required to understand this thread, but I like reading about your progress anyways. Keep working at it, at least until you get a gnarly filter!


#24

Haha, I had in mind to do a Moog ladder filter, but @SmashedTransistors did that already :slight_smile:
Maybe I'll do an oberheim filter or something. But let's be realistic. I think the CP-3 mixer is a lot tougher than the diode circuit already.


#26

The 24dB/oct filter in tiar/filter/MgExp replicates the frequency response of the filter with a specific "ZDF" method (step invariant transform). It allows fast modulation without glitches and stable high resonance even with high cutoffs...

but...

It does not implement any non linearities. It is a personal choice as - contrarily to a vast majority of analog synth addicts - I consider that stage distortions/saturations have a moderate impact on the tone in that steep Low Pass filter. I think that the main concern here are dynamics when modulating the cutoff.


The transistor based mixer is another story !
When i see the schematics, i guess that its non linearities cannot be neglected at all.
Maybe the best way to experiment with it is to model it with Spice at first (before building a hardware replica).

Non linear mixing is very interesting as it adds intermodulations between the inputs.

I did a simple non linear mixer object (tiar/dist/SqrtMix4 object and help patch) that is based on squares (as in x²) and square root. It is not based on any hardware but it can give some ideas for an advanced design.


#27

Happy new year! How's this project going? If it's too complicated, maybe you can try one of Korg's single-transistor VCA designs.