Expand description
NAM model → pedal user AMP data: the official app’s converter, reimplemented (docs/05).
The pedal doesn’t run the network. It runs G1 → its own static nonlinearity → G2, two 1024-tap FIR filters fitted to the model:
- Best linear approximation: a pink multisine at about −90 dBFS through the model;
H = |Y| / |X|per FFT bin, plus a 1/24-octave smoothed copy. - Tone test: a full-scale sine at each of 94 frequencies (58.6 Hz – 14.6 kHz); the level of the fundamental and of the 3rd harmonic at the output.
G1 = smoothed H / max(fundamental, 3rd harmonic)at the tone frequencies, interpolated in log-frequency;G2 = H / G1.- Both become minimum-phase impulse responses; the upload is the first 1024 taps of each, reversed, and a factor of 1.0.
The pedal only runs the first PEDAL_TAPS (512) taps of each uploaded filter (found by
re-amping, docs/05): the app’s extra 512 taps per filter are ignored. Measure::App keeps the
app’s layout byte for byte; the other modes upload exactly what the pedal runs (upload_data).
Every stage was checked against the vendor code (open-stomp-manager tools/namconv). The one
difference is the excitation: the vendor’s 8192-sample multisine is a stored table, so
excitation generates our own with the same spectrum (see Converted for how close the
results are).
Structs§
- Converted
- The result of a conversion, with every intermediate stage.
Enums§
- Measure
- How the small-signal response
His measured.
Constants§
- N
- FFT length of every measurement (48 kHz → 5.859375 Hz per bin).
- NORMALISED_
LEVEL_ DB - The common output level imports are normalised to (
normalise_level): the pedal’s output, in dB re full scale, for pink noise at −18 dBFS into the pedal (the re-amp rig’s units). Calibrated on the pedal so normalised imports play at the level of its built-in bass amps (Ampug SV Bass, Mes 400 Bass) with the same knobs (re-amped,tools/pedalsim/nam_level_rig.py). - PEDAL_
TAPS - Impulse-response taps of each uploaded filter that the pedal actually runs. An upload holds
1024 floats per filter, the response reversed (
data[1023 − k]is tapkof G1,data[2047 − k]of G2), but the pedal uses only taps 0..511 (data[512..1024],data[1536..2048]) and ignores the rest. - TONE_
BINS - Tone-test frequencies as FFT bins (the app’s
ToneTest_FftBins): roughly 1/12 octave apart.
Functions§
- convert
- Convert a model with our excitation (see
excitation), the app’s way. Differs from the official app’s result by the app’s own measurement noise (1/3-octave response typically within 0.1–1.5 dB). For an exact match, useconvert_withandofficial_excitation. - convert_
measured - Convert with a given excitation and measurement mode. Resets the model first.
- convert_
optimised Measure::Optimisedwith progress:on_step(done, total)after each optimiser step (the clean measurement and the model render before the first take about a fifth of the time). Returningfalsestops early with the best result so far.- convert_
with - Convert a model with a given 8192-sample BLA excitation, the app’s way. Resets the model first.
- excitation
- Our BLA excitation: the same spectrum as the app’s (amplitude
√(1/max(f, 40 Hz))per bin, overall scale 1e-5, about −90 dBFS peak), with phases from a fixed-seed generator. - find_
official_ excitation official_excitationfrom the first standard install location that has it.- normalise_
level - Normalise a conversion’s output level like NAM plugins do, so every import plays at the same
level (
NORMALISED_LEVEL_DB) whatever level its model was captured at. Only G2 (after the pedal’s saturation) is scaled, so this is a pure volume change: the tone and the way the amp breaks up stay the same. Returns the gain applied, in dB. - official_
app_ locations - Standard install locations of the official app, for
official_excitation. - official_
excitation - Read the official app’s BLA excitation from an installed copy of Stomp Manager: a file (macOS
imagelib.framework/imagelib) or a directory searched recursively (the.appbundle on macOS, the install folder on Windows). Nothing is executed; the table is located by a fingerprint. - pedal_
irs - The two impulse responses the pedal actually runs for 2048 floats of upload data
(
PEDAL_TAPStaps each; the inverse ofupload_data). - pedal_
level_ db - The pedal’s output level for
modelwith the optimiser’s input/output calibration, in dB, for pink noise at −18 dBFS: what an upload that matches the model plays at (resets the model). - upload_
data - Upload data for two impulse responses as the pedal runs them: the first
PEDAL_TAPStaps of each, reversed, in the second half of each 1024-float block; the halves the pedal ignores are 0.