Automated Analog Circuit Modeling - C++, Python, MATLAB, and XML - Eric Tarr - ADCxGather 2024

notes.

Automated Analog Circuit Modeling - C++, Python, MATLAB, and XML - Eric Tarr - ADCxGather 2024

Source: Automated Analog Circuit Modeling - C++, Python, MATLAB, and XML - Eric Tarr - ADCxGather 2024, ADC - Audio Developer Conference, 18:20, uploaded 2025-03-12, Watch Later position 554.

Eric Tarr presents the Point To Point Library as a way to bring analog circuit modelling into ordinary audio software work. Its central promise is a shared circuit description that can move from a schematic to a quick MATLAB or Python experiment, then into a real-time C++ plug-in. The talk moves through the Analog Circuit Factory plug-in first, then the C++ library and the two prototyping environments, because each one exposes a different part of the same modelling system.

One circuit description across four tools

The C++ library is the main implementation for developers who write plug-ins, apps, or other software that processes audio in real time. Tarr says that a Linux build is also in progress for future use on embedded processors. The other tools support the stages around that implementation. Analog Circuit Factory reads simple XML files that describe circuit schematics, solves the circuit automatically, and applies the resulting DSP to audio inside a DAW. MATLAB and Python provide test scripts for prototyping and measurement, with routes back into XML or C++.

The plug-in comes with more than 100 circuit examples, according to the talk and its description. The examples cover guitar preamps, tone stacks, analogue equalisers, guitar pedals, and saturation stages built from diodes, transistors, and tubes. Tarr treats these circuits as starting points. A developer can change component values, edit the XML, or write a circuit from scratch, then hear the result in real time.

Analog Circuit Factory presents the XML circuits as 500-series rack modules. The modules can be chained inside the plug-in, which lets someone assemble a signal path from individual circuit models. The XML format includes resistors, capacitors, potentiometers, and diodes. A potentiometer can carry the direction of its knob, so the plug-in can attach the matching control to a module. A diode entry can specify properties such as silicon or germanium behaviour, a matched pair or a single diode, and the other characteristics needed by the model.

Tarr also shows a PDF collection of the circuit schematics. Each schematic supplies numbered nodes and component values, which makes the examples useful as a cross-reference when someone wants to understand the XML or build a related circuit. The presentation treats the collection as a working library for experimentation rather than as a fixed catalogue of finished effects.

From a JUCE template to a running effect

The commercial C++ package includes a circuit-examples JUCE project. Tarr opens it in Xcode and points out the parts that a developer has to set up: the external library files, the header search paths, and the plug-in’s audio processor. The processor contains an instance of one circuit from the library. Changing the circuit class name swaps the effect for another circuit, after which rebuilding the project produces a plug-in with the new processing.

The example is deliberately small. The processor prepares the circuit with the sample rate and block size, reads the channel data in the audio callback, and passes that data into the effect. Parameters such as potentiometers and variable resistors can map to plug-in controls. The library smooths those parameter changes internally, with the number of smoothing samples under the developer’s control. A few knobs in the example are therefore enough to test how a circuit responds as its component values move.

Tarr then opens the circuit classes to explain where the processing lives. A circuit model receives a circuit layout, which contains the nodes and the individual circuit elements. The developer creates vectors of those elements and passes the layout into the model. The surrounding interface has the familiar preparation and processing callbacks for a buffer or a single sample, alongside the parameter values that change during playback.

The library represents a single circuit through concrete implementations of an abstract CircuitProcessor base class. A CircuitChain uses the same interface to hold a vector of processors, so a chain can contain individual circuits, other chains, or a mixture of both. That structure gives the library its modular quality. The developer can start with one model, replace it with another, or build a larger effect from smaller processors without changing the outer audio callback.

MATLAB as a measurement bench

The MATLAB version is available as a public GitHub repository, and Tarr presents it as a prototyping tool for commercial development and teaching. It keeps the same circuit structure and includes the circuit-element classes used by the other versions. A test script selects a circuit and turns common analyses on or off through simple Boolean flags.

For the first demonstration, Tarr chooses a Boss Blues Driver clipping stage. The script can plot its waveform, frequency response, harmonic distortion, and other measurements. He changes the test frequency, number of cycles, amplitude, and waveform, then runs the script to produce a waveform plot and a harmonic analysis. The distortion stage produces even and odd harmonics, which makes the non-linear behaviour visible in the result.

The circuit itself remains editable between runs. Changing a resistor or replacing one type of diode with another lets Tarr compare the new response within seconds. A second script sweeps a variable resistor through its full range and plots the frequency response for each value. Tarr uses an equaliser with bass and treble controls for this example. One control moves from its minimum to maximum setting whilst the other stays at 0.5, which shows how a parameter changes the shape of the response across its range.

MATLAB can also export the circuit as XML. Tarr runs a function on the MATLAB version of the Boss Blues Driver circuit, loads the new file into Analog Circuit Factory, and takes the model into real-time processing. The reverse path works as well: an XML circuit created in the plug-in can be loaded into MATLAB for analysis. The same circuit description therefore serves both the measurement bench and the running effect.

Python bindings and generated C++

The Python version answers a request from developers who prefer to prototype in Python. It uses bindings to call the static C++ Point To Point library, so the notebooks contain C++ source files alongside the Python code. The test scripts organise circuits by category and expose the same measurements as the MATLAB version: waveform, frequency response, total harmonic distortion, and DC sweep.

Tarr assigns a linear circuit to one test and points out that its harmonic analysis shows no harmonics. He then switches to a parameter test that produces several plots in one window while potentiometer values change. The notebook is meant to make this kind of inspection quick enough that a developer can try several circuits before writing a real-time implementation.

Python also handles the transition from XML to C++. A script imports an XML circuit and writes C++ code into a user_circuits.h file. That generated code can then be placed in the plug-in project, which lets a developer move from an XML experiment to a C++ circuit without rewriting the model by hand.

The promise and its limits

Tarr’s conclusion returns to the same design goal: the Point To Point Library should make analog modelling approachable for audio software developers who want to put these effects into their own products. The collection of more than 100 circuits shortens the path to a first experiment, whilst the XML, MATLAB, and Python routes let a developer inspect or alter the model before committing to C++. The library still leaves room for arbitrary circuits built from a schematic, so the examples function as material for further work.

The talk supplies a convincing workflow demonstration, though it gives no benchmark for solver speed, CPU use, numerical accuracy, or the audible agreement between a model and a particular analogue circuit. The claims about the circuit count, the product formats, and the future Linux build come from Tarr and the conference description. The description says that Analog Circuit Factory supports Mac and Windows in AAX, VST3, and AU formats, while the talk focuses on the modelling workflow. The source provides no independent measurements or comparison with other circuit-modelling systems.

Further reading / references

  • Hack Audio, Tarr’s site and the home of the Point To Point Library named in the talk.
  • Audio Developer Conference, the conference that published the presentation.
  • JUCE, the framework used by the example plug-in project and the organisation named in the video description.

20 paragraphs1,424 words8,987 characters