Blog / Development

Beyond Waveshaping: How Recurrent Neural Networks Learned to Sound Like Vintage Tubes

Beyond Waveshaping: How Recurrent Neural Networks Learned to Sound Like Vintage Tubes

For decades, guitar amp simulation relied on waveshaping: apply a nonlinear transfer function to the input signal and out comes something resembling overdrive. The technique is fast, cheap, and wrong in a specific way that took researchers until 2019 to properly describe and fix.

What a Tube Actually Does

A triode vacuum tube amplifies by controlling plate current with a small voltage at the grid. The relationship between grid voltage and plate current is nonlinear, the transconductance curve bends. That bending produces harmonic distortion. It is also asymmetric: the tube clips the positive and negative halves of the waveform differently, generating even-order harmonics alongside odd-order ones. That asymmetry is part of why tube distortion sounds different from a silicon diode clipper.

So far, this sounds like waveshaping should work. Apply a static transfer function that approximates the transconductance curve, and you have a tube. Except you do not, because a real tube amp has memory.

The Memory Problem

Memory, in the technical sense, means the output at time t depends on more than just the input at time t. It depends on recent history.

In a tube amplifier stage, several circuit elements introduce memory. The coupling capacitors between stages create a high-pass characteristic: low-frequency content charges them, changing the operating point of the next stage on a timescale of milliseconds. Miller capacitance, which appears between the plate and grid of a triode, creates frequency-dependent bandwidth limiting. The output transformer adds its own inductance, meaning it stores energy and releases it over time. At low frequencies and high levels, the transformer core can saturate magnetically, contributing its own nonlinear memory to the circuit.

The practical consequence is that the effective transfer function of a tube amp changes with frequency, with signal level, and with the signal's recent history. A 440 Hz sine wave sees a different nonlinearity than a 4400 Hz sine wave at the same peak amplitude, because the circuit's reactive elements have had more or fewer cycles to reach steady state.

A static waveshaper, by definition, applies the same curve to every sample regardless of what came before. It approximates the harmonic content at one specific combination of input frequency and amplitude. Move the gain, change the frequency, or feed it a chord instead of a single note, and the model diverges from the real circuit.

Block-Oriented Models: Hammerstein and Wiener

Researchers addressed this with block-oriented models. The Hammerstein model chains a static nonlinearity followed by a linear filter. The Wiener model reverses the order: linear filter first, then nonlinearity. Cascade combinations add more stages.

These models work better than pure waveshaping for simple distortion circuits. A single-stage diode clipper with a known RC rolloff can be captured reasonably well by identifying a Hammerstein model from sweep measurements. But a multi-stage tube amplifier with an output transformer, tone stack, and spring reverb presents a nonlinear system with far more complex memory than two-block structures can represent. Interactions between stages create memory depth that no fixed sequence of static-function and linear-filter can fully replicate.

Recurrent Neural Networks: Memory by Architecture

In 2019, two papers from Aalto University demonstrated a different approach. Eero-Pekka Damskägg, Lauri Juvela, and Vesa Välimäki showed at the Sound and Music Computing Conference that LSTM (Long Short-Term Memory) networks could model audio distortion circuits in real time. At DAFx-19, Alec Wright, Damskägg, and Välimäki compared LSTM and GRU (Gated Recurrent Unit) architectures directly against tube amp and distortion pedal targets.

The key insight was architectural. An LSTM cell maintains a hidden state that evolves with each audio sample. That hidden state acts as learned memory: the network discovers, through training, which aspects of recent signal history matter for predicting the current output. Unlike a Hammerstein model where the memory topology is fixed by the designer, the LSTM learns the appropriate memory depth and structure from the measured input/output behavior of the real circuit.

The DAFx-19 comparison found that GRU architectures used fewer parameters and ran faster, making them more viable for real-time plugin deployment at standard buffer sizes. Both outperformed static waveshaping and block-oriented models on both tube preamps and solid-state distortion pedals.

A 2020 follow-up paper by Wright, Damskägg, Juvela, and Välimäki in Applied Sciences (vol. 10, no. 3, article 766) formalized the training protocol and included formal listening tests in which participants found it difficult to reliably distinguish the LSTM model output from recordings of the hardware.

The training method is straightforward: play a designed test signal (sweeps, noise bursts, chords at varying levels) through the real hardware, record both input and output, and train the network to minimize error between its predicted output and the measured output. No circuit analysis required.

Neural Amp Modeler

Neural Amp Modeler (NAM), developed by Steven Atkinson as an open-source project under the MIT license, turned this research into a practical workflow. Users feed a predefined test signal through their hardware, record both the dry input and the captured output, and train a .nam file, a compact neural network that replicates the hardware behavior.

The NAM plugin loads .nam files and processes audio through the network in real time. Because the training target is the actual hardware, it captures behavior that circuit analysis would struggle to reach: the specific characteristics of individual transformers, the exact bias point of each tube in its current condition, the way a decades-old coupling capacitor actually behaves rather than how its nominal capacitance predicts it should.

The plugin runs as VST3 and AU on Windows and macOS, with LV2 support on Linux. Thousands of captures of commercial amplifiers circulate as free downloads from users with access to the original hardware.

NAM Architecture 2 (A2), released in June 2026, introduced a revised network architecture with changes to both model structure and runtime performance.

What This Changes

The broader implication is methodological. Traditional plugin development required circuit analysis: measure the schematic, derive differential equations, implement numerical integration. For complex nonlinear circuits with interacting stages, this was expensive and produced approximations. Neural black-box modeling shifts the work to measurement and training. You do not need to understand the circuit. You need clean I/O recordings of it.

This has limits. A capture reflects one set of hardware conditions: one set of tubes at one temperature, with one configuration of knobs. Modeling knob interaction requires either a separate capture for every configuration or parameterizing the network with knob positions as additional inputs, which increases training complexity and model size.

The method also says nothing about why a circuit sounds the way it does. The network learns the input/output relationship without any representation of the underlying physics. For engineering purposes, building new circuits or designing emulations from first principles, the black-box approach is not useful. It is useful specifically for replication.

For the specific problem it addresses, accurate capture of existing hardware for playback in a DAW, the combination of recurrent architectures and open-source tooling has made a meaningful difference. The gap between a modeled amp and the hardware it was trained on is now, in formal tests, below the threshold of reliable detection for trained listeners.