Repository navigation
Detailed documentation explaining how the technology works
Quentin Stoll edited this page Jul 12, 2026
·
1 revision
This document details the software architecture enabling the cloning of guitar amplification circuits and their real-time execution via the JUCE framework and the RTNeural engine.
The cloning process relies on supervised machine learning, where the behavior of a target analog system is learned by an artificial neural network.
- Data Acquisition: The source signal (e.g., a DI box signal fed into the amp) and the corresponding output (captured after the power stage or via a line out) are recorded as synchronized audio signal pairs.
- Network Architecture: The system employs Recurrent Neural Network (RNN) or Long Short-Term Memory (LSTM) architectures, capable of modeling the non-linear temporal dependencies characteristic of tube amplification circuits (saturation, compression, dynamic frequency response).
- Training: The model is trained on a Google Colab instance. The loss function minimizes the error between the output predicted by the model and the actual output of the physical amplifier.
- Export: The final model is converted into a weight format (typically JSON or ONNX) containing the fixed tensors of the trained network.
Once the model is trained, it must be executed with near-zero latency within the audio plugin. This is where RTNeural intervenes.
- Graph Abstraction: RTNeural takes the exported model (computational graph) and converts it into a data structure optimized for real-time computation on the CPU.
-
Deterministic Execution: Unlike frameworks like PyTorch or TensorFlow, which handle memory and graph execution dynamically, RTNeural is designed specifically for real-time processing. It allocates necessary buffers during initialization (
prepareToPlay), avoiding any memory allocation within the audio rendering loop (the audio thread). - SIMD and Vectorization: RTNeural leverages modern CPU instructions (SSE, AVX, NEON) to perform matrix multiplications and network activation calculations in parallel across audio buffers, ensuring minimal CPU cost per sample.
The project uses JUCE as a hardware and software abstraction layer for cross-platform audio development.
-
Audio Thread Management: The plugin interacts with the sound card via
audioDeviceIOCallback. The RTNeural model is encapsulated in a dedicated object within theAudioProcessorclass. -
Process Block:
- The incoming guitar signal is retrieved into the
AudioBuffer<float>. - Samples are passed to the RTNeural engine.
- The engine performs inference: for each incoming sample, it calculates the corresponding output based on the neural model's response.
- The processed signal is written back into the output buffer.
- The incoming guitar signal is retrieved into the
- GUI: JUCE manages the link between the user interface and model parameters (gain, volume, amp settings), allowing dynamic updates of model weights or parameters without interrupting the audio stream.
-
Offline:
Physical Amplifier→Acquisition→Training (Colab)→Model Weights (.json). -
Real-time:
Guitar→JUCE Buffer→RTNeural Inference→Output Buffer→Audio Output.
The system ensures tonal fidelity through deep learning and maintains performance viability via mathematical optimization specific to real-time environments (RTNeural).