Most “AI preset generators” write a file that looks like a preset. This project obsesses
over the part after the model answers.
01Real formats, from the source
The Surge XT writer implements Surge’s actual patch container — reverse-engineered from the
GPL source, not guessed. Parameters are stored in Surge’s internal units: cutoff as semitones
from 440 Hz, envelope times as log2(seconds), pitch decomposed into octave + semitone.
02Schema-constrained generation
Each synth’s parameter table generates a JSON Schema, and the LLM is forced to answer inside it
(structured outputs). Out-of-range values are clamped, missing ones fall back to sane defaults —
the output is always a valid parameter set.
03Tested against the real thing
Every encoding has a unit test citing the Surge source line it was derived from. Generated
patches are load-tested headlessly with surge-xt-cli, and the DX7 writer is
byte-parity-tested against the original implementation.
A war story: the legacy version of this code embedded a JSON blob inside the FXP wrapper.
Files were produced, extensions matched, everyone was happy — except Surge XT, which can’t read
them at all. And once the real format was implemented, a patch that asked for an octave-down bass
was silently playing a fifth down instead: Surge stores oscillator pitch in a ±7 semitone field.
Both bugs were only found by loading generated files into the real synth. That’s why
verification against the actual instrument is a design principle here, not an afterthought.