How we build

How do we model circuits?

We model circuits in two ways. Most of what we make is now netlist-based: the whole schematic, every part of it, solved by a circuit solver. The rest is component-modeled: each circuit written as the equations of its topology and solved as you play. Both are precise claims, and limited ones. This page says exactly what each means and where it stops. It also shows the part of component modeling nobody can see from the outside: how an oscillator draws its edges between two samples.

Two ways to model a circuit

Both start from a real circuit, and neither is a curve fitted to a recording of one. They differ in what they solve, and so in what they can promise.

Component-modeled and netlist-solved circuits, side by side
Component-modeledSolved from the netlist
Starts fromThe circuit's topology, written out as its equations.The schematic itself, transcribed part by part into a netlist.
The partsThe ones whose tolerance you can hear are drawn one by one. A resistor that only sets a gain lives inside its stage's equation.Every part on the sheet, at its value, under its reference designator.
Solved byEquations written by hand for each topology. Every loop that holds a nonlinearity is solved at once, every sample.A general circuit solver: every node at once, at every step, with Newton's method for the transistors, diodes and tubes.
SpeedReal time. What you play is what you bounce.Usually slower than real time, often many times slower, and the cost follows the signal.
PlaybackThe model itself.A faster live engine built from the same circuit. When your DAW renders offline, the netlist is solved.
Checked againstA test bench that re-measures every figure the product prints.A reference circuit simulator or the schematic's printed levels, block by block; and the live engine against the netlist.
WhereTitanframe in full, and our other component-modeled instruments in part.The Netlist Effects and the Overtime Eight-Tone.

The rest of this page takes them in turn: component modeling first, as Titanframe does it, then the netlist.

The claim

Each circuit is modeled as the idealized equations of its topology. These are capacitor currents, the exponential law of a junction, the hyperbolic tangent of a differential pair, the Shockley law of a diode and the recombination of carriers in a photocell. The equations are integrated with the trapezoidal rule, with the cutoff prewarped so that a filter's corner lands where its converter puts it.

Wherever a nonlinearity sits inside a feedback loop, the whole loop is solved simultaneously at every sample, by Newton's method on the node voltages. Examples are a ladder's resonance path, the damping path of a state-variable filter and a diode pair in a Sallen-Key loop. The loop is not broken with a sample of delay. The delay-free loop is what lets a resonant filter's pitch, loudness and saturation depend on one another as the circuit's do.

This claim is precise but limited. Not every resistor on a schematic is simulated. Parts that set a gain or a bias are folded into the idealized equation of the stage they belong to. The parts drawn individually are those whose tolerance changes what is heard.

Which instrument this describes

The examples on this page come from Titanframe, the instrument in which every piece of the method is in place. Our other component-modeled instruments are built from the same engine, but they were built over time, and not every one of them has every piece described here. Each product page says what its own instrument does, and that is the page to hold us to.

The parts are one example of the difference. In most of our component-modeled instruments the parts are drawn once, from a fixed bin, so every copy is the same instrument: the same slightly-off resistors and the same mismatched pairs, on every computer. In Titanframe they are drawn from a serial number that belongs to your copy, so your nine voices disagree with each other, and with everybody else's.

Edges drawn between two samples

An analog oscillator is continuous. Its capacitor empties at some instant and its comparator trips at some instant, and none of those instants lines up with a digital sample clock. The obvious way to build a digital oscillator ignores that. It works out the wave at each sample, and when an edge falls between two samples, it jumps on the next one. Much of the harshness of a cheap digital oscillator starts there.

Why a sampled edge is a problem

A jump in value, such as a saw's reset or a pulse's edge, has a spectrum that falls at only 6 dB per octave. A corner, where the wave keeps its value but changes direction, falls at 12 dB per octave: a triangle does this at its peaks, and a wavefolder at every fold. Both reach far above the highest frequency a sample rate can carry. Sampled naively, everything above that limit folds back down into the audible band as tones that are not harmonics of the note. They move the wrong way when you bend the pitch. They are loudest exactly where synthesizers spend their time: high notes, bright waves and hard sync.

Running everything at a higher sample rate helps, but slowly: each doubling of the rate buys roughly 6 dB against a jump and 12 against a corner. That is why the edges are drawn instead.

Finding the instant

Titanframe's oscillators work out where each event falls inside the sample. They do it from the circuit, not by estimating from the samples either side:

  • Between events, a saw core's capacitor, a triangle core's integrator and a counter's phase all move in straight lines, at the frequency the converter gives for that sample. The time until the next threshold is a division.
  • A capacitor charging through a resistor approaches its rail exponentially, and the moment it crosses a threshold is a logarithm.
  • A counter knows on which tick of its clock an edge falls. Only the edge's position inside the sample needs working out.
  • A sync arrives carrying the instant at which the master reset. The slave resets, reverses or restarts at that instant, not on the next sample.

Several events can land in one sample, say a reset, then a pulse edge, then a sync. Each is placed where it falls. The instants are exact for the frequency the board is running at during that sample.

Drawing the event

Once the instant is known, the ideal event is replaced with a band-limited one. A step becomes a smooth rise four samples wide, centered on the instant. A corner becomes the smooth bend you get by integrating that rise. The shape is the cubic B-spline and its integrals, a published family of kernels for exactly this job. The output is read two samples late, so the kernel can be centered on an instant that lies between samples.

A STEP (A RESET, AN EDGE, A WRAP)-3-2-10+1+2+3+4the instantA CORNER (A TURN, A FOLD, A KNEE)-3-2-10+1+2+3+4the instantsamples, counted from the one before the event
A step and a corner falling 0.4 of the way between two samples. Dashed: the ideal event. Hollow squares: the ideal event sampled, which is where aliasing comes from. Solid dots: the event as the kernel draws it. Worked out from the kernel's formula, not measured.

What it buys, and what it costs

For a wave made of straight segments, correcting the samples around each event is exactly the same as passing the continuous wave through a gentle low-pass filter shaped like the kernel, and then sampling it. That equivalence says precisely what the method buys and what it costs.

What it buys is a small residue. The only aliasing left is what the kernel's tails let through: harmonics far above the limit, already reduced by the kernel, folding back. At A7 (3520 Hz), the loudest line any of Titanframe's oscillators makes that is not a harmonic stands between 64 and 118 dB under the note. The saw core's saw sits 77.4 dB under.

What it costs is a little top end. A kernel four samples wide rounds the very top of the spectrum slightly. The voices run at twice the host's sample rate, so most of that rounding falls above anything you can hear. Worked out from the kernel's shape, with the host at 48 kHz, an oscillator on its own loses about half a decibel at 10 kHz and two and a half at 20 kHz. A longer kernel would round less, but it would cost more and delay every note further.

Where drawing is not enough

  • An event has to be one you can find. The diode shaper's ladder has 128 knees, each narrower than a sample, too many to draw one by one. It is integrated exactly over each sample instead, which is antiderivative anti-aliasing.
  • A stage placed after an oscillator only ever sees the drawn wave. The wave wrapper receives a saw's reset already smoothed into a steep curve a couple of samples wide, and at high drive it wraps several times inside that curve. That is its weak case: 50.0 dB clean for a saw, against 65.8 dB for a sine.
  • Audio-rate FM spreads a spectrum without leaving any single event to draw. There, the doubled sample rate is what helps. The digital wavetable doubles it again for its FM and RING warps.
  • A filter's curve has no edge to find. Pushed hard, a filter makes harmonics of its own, and a smooth curve inside a feedback loop leaves nothing to place and draw. Titanframe meets it three ways. Filter inputs are first trimmed of content that could only fold. Worked out from the trim's shape for a 48 kHz session, that costs about half a decibel at 15 kHz and a little over one at 20 kHz. The two diode filters integrate their diodes exactly over every sample, by the same method as the diode shaper. And the filters that measurably need it run their circuits at 192 kHz in a 48 kHz session, four times the host's rate. Played at the level it was designed for, with the resonance down, every filter keeps a saw's folds at least 78.5 dB under the note, all the way up to A7. Each filter's RATE switch can drop it back to the voices' own rate when a session needs the CPU.

What it means, and what it does not

It means

  • Each circuit is its equations, written from its topology. It is not a curve fitted to a recording of one.
  • A loop with a nonlinearity in it is solved all at once, every sample, with no delay put in to make the arithmetic easy.
  • In Titanframe's oscillators, every edge and corner is placed at its instant between two samples and drawn band-limited. So is every wrap in the wave wrapper and every knee in the resonance folder.
  • In Titanframe's filters, what could only fold is trimmed away before it reaches the circuit, the two diode filters are integrated exactly over every sample, and the filters that need it run at up to four times the host's sample rate.
  • Parts have values. They sit a little off nominal, and the ones whose tolerance you can hear are drawn one by one.
  • The measured figures on this page come from Titanframe's test bench, which re-measures them each time it runs and fails if one moves from the number printed here.

It does not mean

  • That every part of a schematic is simulated. A resistor that only sets a gain lives inside its stage's equation.
  • That a component-modeled instrument runs a circuit simulator. Each topology's equations are written out by hand and solved, and nothing in it reads a netlist. That is the other method, below.
  • That every magnitude was checked against a hardware specimen. A few were derived from the physics. They behave correctly in kind, and Titanframe's service manual marks each one.
  • That everything in the instrument is band-limited. Some sources are computed at the sample instants: an LFO's flips, a sample-and-hold's steps, an envelope's corners and the ring modulator's diodes. Driven at audio rate, they alias like any sampled signal.
  • That a filter never aliases. Push one to the top of its drive at the top of the keyboard and its own harmonics can still fold back. In the hardest cases we measure, eleven of Titanframe's twelve filters keep that at least 36 dB under the note, and five keep it more than 60 dB under. SLEW, a filter built from slew limits rather than capacitors, has corners too sharp for even the raised rate to tame, and reaches 21.9 dB under at its most extreme setting. Every figure improves by about 6 dB for each octave down the keyboard, and switching a filter's RATE to save CPU lets more through.
  • That every oscillator is a circuit. Titanframe's DIGITAL WAVETABLE, DIGITAL SUPER SAW and DIGITAL KARPLUS-STRONG are digital oscillators, and they say so in their names.
  • That every instrument we make has every piece on this page.
  • That it is a copy of any particular instrument. We name a circuit by what it is, never by whose it was.

Solved from the netlist

A netlist is a schematic written as text: every part, its value and the nodes it joins. For a netlist instrument we transcribe the schematic into one, part by part, each part keeping its reference designator from the sheet, and our solver reads it as it is. These are the instruments on the Netlist Effects shelf and the Overtime Eight-Tone.

At every step the solver works out every node voltage in the circuit together. Transistors and diodes are solved from their device equations, tubes from theirs, and op-amps and transconductance amplifiers from behavioral models that carry their datasheets' figures. Newton's method settles the nonlinear parts at each step, and an implicit integrator carries every capacitor from one step to the next, at several times the host's sample rate. Nothing is folded into a neighbouring stage to save work, and no loop is cut.

That is what makes it slow. The work follows the signal: a quiet passage solves quickly, while bright, loud, resonant material asks for more and smaller steps. A plug-in has to keep up in its worst case, not its average, so a netlist instrument plays through a live engine, a faster model of the same circuit, and solves the netlist when your DAW renders offline. Both engines run with the same latency, so a bounce lines up with playback to the sample, and the panel says which one you are hearing.

The solved circuit is checked against its references, block by block: the same netlist in a reference circuit simulator, or the levels and timings printed on the schematic itself. The live engine is checked against the solved circuit, and each product page says how close it comes.

It means

  • Every part on the schematic is in the circuit, at its value. A resistor that sets a gain is a resistor. Where the schematic leaves something open, the choice is marked in the netlist.
  • Every node is solved together at every step. No loop is broken with a delay, and no stage is replaced with a curve.
  • A bounce with the circuit engine is the netlist's own answer, however long that takes.

It does not mean

  • That the live engine is the circuit. It is a model of it, close but not identical, and the product page says how close.
  • That every part is a measured part. Transistors and diodes are modeled from published data for parts of their class, not from measurements of the originals, unless a product page says otherwise.
  • That the whole unit is in the netlist. A power supply is usually left out, its rails made ideal, and so is anything that never reaches the sound, such as a lamp. Each product page says what its netlist leaves out.
  • That it is a copy of any particular unit. Here too, we name a circuit by what it is, never by whose it was.

If you find one of our pages claiming more than this, tell us.

Aphelion

Further reading

  • V. Välimäki, J. Pekonen and J. Nam, “Perceptually informed synthesis of bandlimited classical waveforms using integrated polynomial interpolation,” J. Acoust. Soc. Am. 131(1), 2012. The kernel family drawn above.
  • V. Välimäki and A. Huovilainen, “Antialiasing oscillators in subtractive synthesis,” IEEE Signal Processing Magazine 24(2), 2007.
  • S. Bilbao, F. Esqueda, J. D. Parker and V. Välimäki, “Antiderivative antialiasing for memoryless nonlinearities,” IEEE Signal Processing Letters 24(7), 2017.
  • V. Zavalishin, The Art of VA Filter Design, 2020. The trapezoidal integration the filters use.

Titanframe, the synths, the netlist effects and why they have so few presets.