[linux-audio-dev] [ann] preamp.so

Tim Goetze tim at quitte.de
Tue Nov 12 09:56:00 UTC 2002

Steve Harris wrote:

>> this plugin implements an amplitude response that has
>> been obtained from a spice simulation of the preamp
>> stage of a modified fender 5F4 instrument amplifier.
>Hey, this is great!

cheers, i do like the sound too.

>Instead of a table lookup, have you though about using a high order
>polynomial aproximation? That was what I was planning for the 12AX7.
>It doesn't look like that complicated a shape, 5th or 6th order should do
>it and it will be faster and less cachey than a high order interpolated
>table lookup.

take a look at the 1st derivative of the curve; it's not so easy
to emulate this with one polynomial. the spice implementation of
the valve itself uses pow (x, 1.5) and branching a few times ...

i'm working on a different implementation that decomposes the 
response into n segments, each evaluated as a 4th order poly.
there's a table storing only the poly coefficients for each 

i think it will come much closer than a 5th or 6th order over
the whole curve, let alone the current implementation. and 
(tests done) it does execute a tad quicker than lerping over 
1996 samples.

>I'd be interested to see a plot of Vin in [-1,1], it looks like at
>Vin = -0.5 it's starting to curl back on itself, which is interesting.

it's fairly linear over this range (the plot is from a 
[-5, +5] V ramp). 

more interesting is that if you feed it a sine wave, the
circuit *never* clips the lower lobe, it rather seems to 
compress so the lower lobe never hits the end of the curve.
it does clip the lower lobe of a triangle however.

<diy tips for spice>
if you'd like to run spice yourself, it's fairly easy: fetch
spice3f5sfix.tar.gz (google for it, i think it's on sunsite) 
and run the spice binary on the netlist linked from the preamp 

then tell the spice prompt 'run; setplot tran; plot V(4)' to 
see what the output looks like. 'plot V(1)' will show the 
input signal. 'write V(4)' will write the output to a mixed
ascii/binary format that is fairly easy to decode with a
little {python|perl}. i keep a .py around you can have.

the spice netlist language is a little crude yet sometimes
elegant, and the binary and build process feel like those
days when you had to lease cpu time at the local computing


More information about the Linux-audio-dev mailing list