Tubescreamer emulator in 60 minutes

valdiorn

Member
Nov 8, 2008
44
1
8
First of all, I know there are DSP developers that regularly post here, I would love to hear from you and your methods for simulating / emulating audio circuits, if you wouldn't mind telling us about it (spoil the *secret* ... )

I've been wanting to have a look into modelling for some time now, and did my first research project today. It actually worked much better than I ever hoped.

I decided to try emulating a Tubescreamer first, mainly because all the needed information was available at BTE Audio's TSS page. I know many of you use TSS and regard it as one of the best tubescreamer emulations available, so that was my benchmark.

I have been hypothesizing a method to emulating circuits with Z-transforms and look-up tables and wanted to try it in action, and here's how I did it:

1. construct a 32-bit Look-up table for the saturation curve. This was relatively easy with a SPICE simulator. I used LTSpice, did a linear DC sweep from -5 to 5 volts, and I used a 1N4148 diode model. See picture. The data was exported to a text file, I then opened that with matlab and did some formatting changes on the file, not very complex, it's just a list of numbers (The original data from LTSPice can be found here)

2. Do the frequency-shaping stuff. My original intention was to do a Laplace diagnosis and transform it into a Z-transform (relatively easy if you're trained in that sorta stuff, aka. you're an electrical engineer, like me :)). However, I was in a hurry and BTE Audio had already done all the calculations for me (thanks guys :)). I decided to use Native Instruments Reaktor as a testbed, just as a proof-of-concept (The final idea is to write it all in C and run it on a DsPIC, this kind of simulation is actually pretty CPU friendly, it's just 3 one-pole IIR filters and a LUT, I can probably execute it all in less than 100 instructions... but that's for later). I used the built-in filters and shit, you can see a picture of how it looks here (with explanations)

The signal amplitudes in Reaktor aren't exactly unit-for-volt so the input and output levels were adjusted by ear, the input ranges from +-1 (floating point number) and the output is the same, but the input needs to be driven quite high to simulate the high-gain of the op-amp, the gain is just a multiplier that amplifies the input by a large factor (remember you need a gain of 32768 just to drive the input signal end-to-end of the LUT ( 2*32768 = 65536 = number of LUT samples) )

Same was for the clean + dirty signal mixing. The Tubescreamer is non-inverting clipper so the output is the input + clipped signal. Finally, a low-pass filter with a cutoff of 723hz and a hi-shelf with the same RC values were added. An audio signal amplifier was added last.

Results: Awesome! I load the plugin in Ableton, set the knob maximums and mininums by ear, now I can't hear a difference between the TSS and my hack project! I'm really satisfied with the results and actually amazed at how easy it all was. I'm very excited about trying this simulation method with some other designs and hopefully run them on a DsPIC for a digital multi-distortion box :D

Clip, First TSS, then my version
( Double tracked, Schecter C1+ -> Behringer X V-amp -> Delta 44 Audio Interface -> TubeScreamer emu -> Aradaz Green (Clean) -> Output )

Reaktor ensemble

PS: I'm not the best C++ programmer, but I know my DSP. I'm learning to use SynthEdit's SDK kit, it's a simple way of introducing your code into a VST environment, so hopefully you'll start seeing some VST plugins from me in a couple of months... and even hardware ;)
 
i was doing this kind'a thing but in Synthedit... you have the hardest part all figured out.. i still have troubles with the schematics T___T
dope sound man, can't wait to see the final results! (vst's!!!!)
 
Wow, welcome to the forum man and NICE job!

I'm very interested in this method and I wonder what else could be emulated like this. It would be awesome if you continued along this path and I'm sure you will get some help from the big guys like LePOU and Nick and so on.

Man this day is good... even though I feel like shit today, it's great to see LePOU's & ABG's new Solo_C is released soon, AND this thread which inspires and motivates further development! :D
 
thank you for your tutorial ;) make more of them when you get time :D
I successfully made a "tubescreamer" in c++ (in 3 hours.. i had to make clipper-stage in ltspice etc) , but I will try to make something that haven't been made a thousand times before :p
I just implemented it in another project I'm working on, so I won't release it as it is though :eek: