What the lab is doing
The Pedal Lab does not imitate pedals; it solves their circuits. This is the reading behind it: where the device equations come from, how the solver finds the answer 48,000 times a second, and, the part that matters if you want to use the lab, what each component does to the sound and why. Every figure on this page was computed by the same engine the lab runs, not drawn.
SPICE and its models Berkeley, 1973
SPICE, the Simulation Program with Integrated Circuit Emphasis, was written at UC Berkeley by Laurence Nagel under Donald Pederson and released to the public in 1973; the 1975 rewrite, SPICE2, is the ancestor of every circuit simulator in use today, including ngspice and LTspice. Nagel's thesis on SPICE2 is still the clearest description of how one is built: the device equations, the numerical integration, the Newton iteration and the tricks that keep it converging. Almost everything the lab does is in that document.
"SPICE model" is used loosely for two different things. One is the equations a simulator uses for a kind of device: the diode law, Ebers-Moll or Gummel-Poon for a transistor. The other is a parameter set that fits those equations to one real part, the .model 1N4148 D(IS=2.52n N=1.752 …) lines you find in vendor libraries. The lab uses the classic equations with simplified parameter sets: enough to sound and bias like the real thing, small enough to solve per sample.
L. W. Nagel and D. O. Pederson, "SPICE (Simulation Program with Integrated Circuit Emphasis)", UC Berkeley ERL Memorandum M382, April 1973.
L. W. Nagel, "SPICE2: A Computer Program to Simulate Semiconductor Circuits", PhD thesis, UC Berkeley ERL Memorandum M520, May 1975. The primary source for the whole method.
The living descendant: ngspice, whose manual documents every model parameter, and whose source is where the convergence helpers below can be read in C.
The diode: Shockley's equation (1949)
A p-n junction passes a current that grows exponentially with the voltage across it. William Shockley derived the law from the physics of the junction in 1949; it is the whole reason a diode clips.
IS, the saturation current, sets where the curve takes off: a germanium diode has a much larger IS than silicon, so it conducts at 0.3 V instead of 0.6. n, the ideality factor (1 to 2), sets how sharp the knee is. The lab's parameter sets: silicon 1N4148 (IS = 2.52 nA, n = 1.752, the widely copied vendor model), germanium 1N34A (200 nA, 1.3), Schottky BAT41 (16 nA, 1.05) and a red LED (5·10−18 A, 2.0; fitted to a 1.7 V forward drop). Series resistance and reverse breakdown are left out; at pedal currents neither matters.
W. Shockley, "The Theory of p-n Junctions in Semiconductors and p-n Junction Transistors", Bell System Technical Journal 28(3), pp. 435–489, July 1949.
The transistor: Ebers-Moll (1954)
Jewell Ebers and John Moll described a bipolar transistor as two diodes back to back, base-emitter and base-collector, each with a current source that copies most of the other's current. In the transport form SPICE uses, two exponentials give two reference currents and everything else is bookkeeping with the forward and reverse current gains βF and βR:
IC = ICC − IEC(1 + 1/βR) IB = ICC/βF + IEC/βR
That is the model the lab uses, with IS and β chosen for silicon (2N3904/2N3906-like: 6.7 fA, β 200) and germanium (AC128-like: 200 nA, β 80). SPICE's default is the richer Gummel-Poon model of 1970, which adds the Early effect, high-current roll-off and charge storage; those change tone subtly in a real fuzz but not the biasing or the clipping, and they cost Newton iterations, so they are out. The lab's germanium transistors also have no leakage current, which in a real Fuzz Face is why it drifts with temperature.
J. J. Ebers and J. L. Moll, "Large-Signal Behavior of Junction Transistors", Proceedings of the IRE 42(12), pp. 1761–1772, December 1954.
H. K. Gummel and H. C. Poon, "An Integral Charge Control Model of Bipolar Transistors", Bell System Technical Journal 49(5), pp. 827–852, May 1970. The fuller model SPICE defaults to.
The op-amp macro-model (1974)
Nobody simulates the forty transistors inside a 4558 to hear a Tube Screamer. Boyle, Cohn, Pederson and Solomon showed in 1974 how to replace an op-amp with a handful of ideal parts that reproduce its terminal behaviour: a transconductance for the input stage, one capacitor for the dominant pole, a buffer for the output. The lab's is the minimal version of that: an input stage that turns the differential voltage into a current, limited to ±Imax; that current charges a 30 pF compensation capacitor, which gives the open-loop pole; a stiff clamp holds the node between the supply rails; a unity buffer with 100 Ω drives the output. Three numbers you would read off a datasheet fall out of it: open-loop gain (gm·R), gain-bandwidth (gm/2πC, 3 MHz by default) and slew rate (Imax/C, 1 V/µs). The last one is audible: it is why a RAT's LM308 sounds different from a TL072 in the same circuit, and you can set it per op-amp in the lab.
G. R. Boyle, B. M. Cohn, D. O. Pederson and J. E. Solomon, "Macromodeling of Integrated Circuit Operational Amplifiers", IEEE Journal of Solid-State Circuits SC-9(6), pp. 353–364, December 1974.
The delay line: SPICE's T element
Delay and reverb pedals are built around a part that is not a circuit at all: a bucket-brigade device (a chain of thousands of capacitors that pass a sample of the signal along on each clock tick) or, since the late 1990s, a PT2399 digital delay chip. Neither can be stamped into a matrix. SPICE has had an answer since the beginning: the T element, an ideal lossless transmission line, which is exactly a delay: the voltage at one end is the voltage at the other end a fixed time ago. The lab's DL part is that, with a gain: a voltage source whose value is read out of a ring buffer written one sample at a time. In the small-signal analysis it becomes gain · e−jωτ, a pure phase shift, which is why a delay with feedback draws a comb on the frequency-response plot. What makes the Delay preset sound analog rather than like a computer is everything around the chip: the low-pass filters in the loop that darken every repeat, and the feedback resistor that decides how many there are.
The transmission line element is described in Nagel 1975 (above) and every SPICE manual since; in the ngspice manual it is the "T" device. On bucket-brigade delays: F. L. J. Sangster and K. Teer, "Bucket-Brigade Electronics: New Possibilities for Delay, Time-Axis Conversion, and Scanning", IEEE Journal of Solid-State Circuits 4(3), pp. 131–136, June 1969.
Kirchhoff in a matrix: modified nodal analysis (1975)
Kirchhoff's current law says the currents into any node sum to zero. Write that for every node, with each resistor's current as a conductance times a voltage difference, and you get a linear system G·x = b whose unknowns are the node voltages. Ho, Ruehli and Brennan's 1975 paper added the "modified" part: voltage sources (which have no conductance) get a row of their own with their current as an extra unknown. Every part is stamped into the matrix with a fixed pattern; the lab's engine.js is, at heart, a stamp for each of R, C, L, V, the pot, the diode, the transistor and the op-amp, followed by a solve.
C.-W. Ho, A. E. Ruehli and P. A. Brennan, "The Modified Nodal Approach to Network Analysis", IEEE Transactions on Circuits and Systems CAS-22(6), pp. 504–509, June 1975.
Textbook treatments: J. Vlach and K. Singhal, Computer Methods for Circuit Analysis and Design, 2nd ed., Van Nostrand Reinhold 1994; L. O. Chua and P.-M. Lin, Computer-Aided Analysis of Electronic Circuits, Prentice-Hall 1975.
Capacitors through time: companion models
A capacitor's current is C·dV/dt, which is not a conductance. The trick, in Nagel's thesis, is to replace the derivative with a finite difference across one time step h. With the trapezoidal rule the capacitor becomes a conductance 2C/h in parallel with a current source that remembers the previous sample's voltage and current; with backward Euler it is C/h and a simpler memory. That pair is the capacitor's companion model, and once it is stamped the capacitor is just another resistor, updated every sample. The lab lets you choose the rule. Trapezoidal is second-order accurate but warps frequency (a 1.6 kHz corner lands where tan(πf/fs)·fs/π says, which is why oversampling helps) and can ring on stiff circuits; backward Euler never rings but damps high frequencies. The op-amp's compensation cap, whose pole is far above the sample rate, always uses backward Euler for that reason.
Newton-Raphson 1669, 1690, and 1975
Everything above is linear except the exponentials, and the exponentials are the sound. To solve a system with a diode in it you guess the diode's voltage, replace the curve with its tangent line at the guess (a resistor plus a current source: the diode's own companion model), solve the now-linear circuit, and use the answer as the next guess. Near the answer each round roughly doubles the number of correct digits; from a good guess, two or three rounds do it. That is Newton's method, and the tangent-line idea is the same one you meet for finding a root of one equation:
DEVpnjlim in ngspice's devsup.c) limits a step up an exponential to a logarithmic distance, which is what the lab does too. Without it, a step from the wrong side of the knee predicts currents of amps and the next tangent is useless.Isaac Newton described the method for polynomials in De analysi (written 1669, published 1711); Joseph Raphson gave the iterative form we use in 1690; Thomas Simpson extended it to systems of equations and to calculus in 1740. Leonid Kantorovich proved in 1948 when it is guaranteed to converge, and how fast, which is the theorem circuit simulators lean on. The engineering half, how to make it converge on a real circuit from a cold start, is Nagel's again: limiting the junction steps, adding a tiny conductance (gmin) across every junction and from every node to ground so nothing floats, and ramping the supplies up from zero for the first operating point (source stepping). The lab does all three. It also does something SPICE does not need to: it starts each sample's Newton from a linear extrapolation of the last two samples, which saves about one Newton iteration in five (2.8 to 2.2 per sample on the Muff).
I. Newton, De analysi per aequationes numero terminorum infinitas (1669; published 1711); J. Raphson, Analysis aequationum universalis (1690); T. Simpson, Essays on Several Curious and Useful Subjects in Speculative and Mix'd Mathematicks (1740). Historical account: T. J. Ypma, "Historical Development of the Newton-Raphson Method", SIAM Review 37(4), pp. 531–551, 1995.
L. V. Kantorovich, "Functional analysis and applied mathematics", Uspekhi Matematicheskikh Nauk 3(6), pp. 89–185, 1948 (the Newton-Kantorovich theorem). Modern treatment: J. E. Dennis and R. B. Schnabel, Numerical Methods for Unconstrained Optimization and Nonlinear Equations, SIAM Classics, 1996 (orig. 1983), chapter 5.
Convergence aids for circuits: Nagel 1975, chapter 6; ngspice source, src/spicelib/devices/devsup.c (DEVpnjlim).
Why it runs in real time
A Newton iteration on the whole matrix, per sample, at 96 kHz, in a browser, would not keep up. The lab does what Yeh, Abel and Smith called the DK method: since the linear part of the circuit only changes when you touch a value, its matrix is inverted once and kept; the nonlinear parts are pulled out as a handful of ports (each diode pair one, each transistor two), and Newton runs only on those port voltages, a 1×1 to 10×10 system instead of a 27×27 one. Every node voltage then follows from the stored inverse in one multiply. Their two papers work this through for op-amp, transistor and tube circuits; the lab follows Part I without the symbolic step. The heavy inner loop, the small Newton matrix and its solve, is also compiled from Rust to WebAssembly, with the JavaScript version kept as the reference it is tested against.
D. T. Yeh, J. S. Abel and J. O. Smith, "Automated Physical Modeling of Nonlinear Audio Circuits for Real-Time Audio Effects, Part I: Theoretical Development", IEEE Trans. Audio, Speech and Language Processing 18(4), pp. 728–737, May 2010 (author's PDF). Part II: "BJT and Vacuum Tube Examples", vol. 20(4), 2012.
D. T. Yeh, "Digital Implementation of Musical Distortion Circuits by Analysis and Simulation", PhD thesis, Stanford CCRMA, 2009.
What the parts do to the sound and why the values matter
Three ideas cover most of it. A capacitor in series with the signal path is a high-pass; a capacitor to ground is a low-pass; each has a corner at f = 1 / (2π R C) with whatever resistance it sees. A diode is a ceiling: the signal gets through until it reaches the diode's knee, then it stops growing, and where a wave stops growing it gains harmonics. And a transistor or op-amp stage has a gain set by a ratio of resistors and a headroom set by the supply, and which of the two runs out first decides whether the clipping is soft, hard, or lopsided. Everything below is one of those three in a particular place.
The diodes: what clips, and how hard
Diode type is the single biggest tonal choice in a clipper. The forward voltage sets the threshold and therefore the output level and how much of the note is clipped; the ideality factor n sets how gradual the knee is: the current multiplies by ten every 2.3·n·VT, so a higher n is a rounder corner. Germanium's reputation for smoothness comes mostly from its lower threshold (the clip starts earlier and gentler relative to the signal) and, in real parts, from leakage that the model leaves out. Stacking two diodes in series doubles the threshold: more headroom, more open, louder. Try: Clipper, D1 and D2 to LED, input level to 2 V.
Resistors and capacitors: corners and ratios
A cap in series (coupling caps, the input and output caps on every pedal) blocks DC and rolls off lows below its corner with the resistance after it. Make it smaller and the bass thins: the Rodent's 22 nF input cap into 1 MΩ passes everything above 7 Hz, but the Fuzz's 2.2 µF is doing real work: the first transistor's input impedance is only about a kilohm, so the corner sits near 60 Hz, and the same cap at 100 nF would move it to 1.4 kHz and take the whole low end with it. A cap to ground is a low-pass. A resistor in series with the signal forms a divider with whatever follows: the Clipper's 4.7 kΩ is what meters current into the diodes, and a diode's voltage only grows about 60 to 100 mV for every tenfold increase in current. Make it 470 Ω and the diodes get ten times the current: the plateau rises (0.58 V instead of 0.48 with silicon) and the corner gets harder. Make it 47 kΩ and it is quieter (0.39 V) and rounder, closer to a compressor than a clipper. Try: Clipper R1 at 470 Ω and at 47 kΩ.
The Screamer: gain that the diodes take away
The diodes sit in the feedback loop. As the output tries to exceed their forward voltage they start conducting, which lowers the feedback resistance, which lowers the gain: the op-amp keeps working but its gain melts away smoothly as the wave grows. That is soft clipping. Drive is just the feedback resistor, so it is also the gain, so it is also how early the diodes engage. Try: Drive at 10, then swap D1/D2 to germanium: quieter and fuzzier, because the ceiling dropped by half.
The Rodent: gain that hits the rails, then the diodes
The Rodent's op-amp runs with up to two thousand times gain (1 + 100 kΩ / 47 Ω) and the 47 Ω + 4.7 µF leg gives most of that above 720 Hz (same idea as the Screamer's leg, more extreme). With that much gain, the op-amp output slams into its power supply long before the diodes: the wave is already square when it reaches D1/D2, which then set the final level. Two clippers in a row, the first one a brick. Filter is the variable low-pass after it, and it matters more here than in any other preset because there is so much high-frequency fizz to tame. Slew rate matters too: the original uses an LM308, which is slow; set the op-amp's slew to 0.3 V/µs in the editor and the tops of the square wave tilt, rounding the highs a little. Try: Distortion at 10, Filter at 0, then at 8.
The Fuzz: no headroom, on purpose
Two transistors, DC-coupled, with a 100 kΩ resistor from the second emitter back to the first base to hold the bias. Fuzz bypasses more of the 1 kΩ emitter resistor with a 20 µF cap: less local feedback, more gain, more fuzz. Germanium vs silicon moves the bias voltages (look at the numbers on the schematic when you swap Q1/Q2) and the knee: silicon is brighter and harsher. The asymmetry you see is the sound; a Fuzz Face that is biased "correctly" symmetric sounds like a different pedal. Try: Q1 and Q2 to silicon PNP (the supply is negative, so they stay PNP), then R3 (the 470 Ω) at 1 kΩ.
The Booster: one stage, honestly
The bias divider (430k / 43k) puts the base near 0.8 V and the collector at 5.9 V, a little above mid-supply, which is roughly where a stage has equal room to swing both ways. Move it and one side clips first: a "misbiased" booster is a distortion pedal with a particular flavour. The supply: 9 V is the ceiling on everything; the editor lets you change V1. Running a booster or a fuzz at 18 V doubles its headroom and is exactly why some players do it. Try: R2 at 22 kΩ (base too low), then V1 at 18 V.
The Muff: two clippers and a scoop
The full Muff is four common-emitter stages like the Booster's in a row (biased by a feedback resistor from collector to base rather than a divider), with a diode pair from collector to base on the middle two. Those diodes clamp each stage's output to about a volt of swing, so the stages saturate softly and the sustain comes from the second one being driven by an already square wave. Sustain is the level into the first clipper. The 470 pF caps across the diodes roll off the very top of each clipping stage; make them 1 nF and the fizz goes away with some of the bite. The 100 Ω emitter resistors set each stage's gain (about 40 dB); the 100 kΩ base resistors and 470 kΩ feedback resistors set the bias, and the clipping stages sit with their collectors low (around 1.1 V, because the diodes conduct DC), which is part of why a Muff clips the way it does. Try: D1–D4 to LEDs (open, loud, less sustain), then C4 and C6 to 1 nF.
A table to keep
| Change | What it does | Why |
|---|---|---|
| Diode Ge → Si → LED | Higher ceiling: louder, cleaner, less compression | Forward voltage 0.3 / 0.6 / 1.7 V |
| Remove one diode | Warmer, thicker, a little louder | Asymmetry adds even harmonics |
| Series cap smaller | Less bass | High-pass corner rises, f = 1/(2πRC) |
| Cap to ground bigger | Darker | Low-pass corner falls |
| Gain leg cap bigger (Screamer C2, Rodent C2/C3) | Bass gets distorted too; muddier, fuller | The gain's high-pass corner falls |
| Feedback resistor / Drive up | More gain, earlier clipping | Gain = 1 + Rf/Rleg |
| Emitter resistor up | Cleaner, quieter | More negative feedback, gain ≈ RC/RE |
| Supply 9 → 18 V | More headroom, cleaner, tighter | The rails move away |
| Bias off centre | Lopsided clipping, even harmonics | One rail is closer than the other |
| Op-amp slew lower | Rounder highs on square waves | Output cannot turn corners fast enough |
| Input level down | Cleans up | Less of the wave reaches the knee |
Sources primary where possible
The simulator and its methods
- Nagel & Pederson 1973; Nagel 1975 (SPICE, SPICE2): links above. The 1975 thesis is the one to read.
- Ho, Ruehli & Brennan 1975 (modified nodal analysis).
- Yeh, Abel & Smith 2010 and Yeh 2012 (the DK method); Yeh 2009 (thesis).
- Ypma 1995 (history of Newton-Raphson); Kantorovich 1948; Dennis & Schnabel 1996.
- ngspice manual and source.
- J. O. Smith, Introduction to Digital Filters, CCRMA, for the bilinear transform and frequency warping.
The devices
- Shockley 1949 (the diode law); Ebers & Moll 1954; Gummel & Poon 1970; Boyle et al. 1974 (op-amp macro-models).
- Diode and transistor parameter values are the commonly published SPICE sets for the 1N4148, 1N34A, BAT41, 2N3904/2N3906 and AC128; the LED and germanium transistor numbers are fitted to typical forward drops rather than taken from a datasheet model.
The circuits
- ElectroSmash's analyses, the best free walk-throughs of these exact pedals (the original site is gone; these are its archive): Tube Screamer, ProCo Rat, Fuzz Face, Big Muff Pi.
- R. G. Keen, "The Technology of the Tube Screamer" and "The Technology of the Fuzz Face", GEO.
- H. Forsten, "Simulating audio effects with SPICE".
- The lab's own presets: presets.js, and the engine: engine.js, both readable.
Circuit topologies of classic pedals are widely published and are not protected; the names here are generic. Where this page says "the lab does X", the code is the authority: the figures are regenerated from it by notes/make-figures.mjs.