Guidance for Claude when working in this repository. Keep this file up to date: when a decision, convention, command or milestone changes, update it in the same commit.
Xythos (named NAMsayin until 2026-10-29) is a guitar rig plugin (VST3 + LV2, and AU on macOS) in C++20, built with DPF (plugin framework + NanoVG UI) and NeuralAmpModelerCore.
- Requirements:
docs/Requirements.md— the owner's feature list plus agreed decisions. Treat it as the source of truth; record new decisions there. - Architecture and milestones:
docs/Architecture.md— design, v1 milestones (M0–M10) and decisions log. - Current milestone: M1, M2 (minus resampling), M3 (delay, reverb, compressor), M5 (library, settings), M6 (split/merge), M7 (presets, undo/redo, MIDI learn), M8 (tuner) and M9 (metronome) are done, and M4 is done (every pedal now has the owner's photo with 2-3 knobs, a power LED and a clickable footswitch on its face, 2026-10-28; the neon placeholder art remains for blocks without an image). The IR loader (local .wav cab IRs) and the Doppelganger Delay (echoes alternate flanger/chorus;
docs/Architecture.md4.7b) are also done, at the owner's request, and so is the pedal set, including the second set of 18, six more synths, the Poly Chip (polyphonic chip synth), the third set of 16 (2026-10-23: Sympathetic Strings to Piano, and a Fart pedal), better note tracking (NoteTracker, Track From, Lookahead; the poly finder too, with per-band noise floors so a live input's hiss and hum don't cut notes short, 2026-10-25), MIDI Out (2026-10-24), the DI category (ten bass DI boxes and preamps, 2026-10-24; Architecture 4.11), six compressor pedals (Neve-style diode bridge and console channel, two optical, FET, OTA; 2026-10-29; their photos and a new Noise Gate photo arrived the same day) the Modulation Sweeper (sweeps between 2-3 of chorus/flanger/phaser/vibrato;docs/Requirements.md"Pedals", Architecture 4.11; owner's call: no rush to v1) and speaker cabinet photos for IR blocks, picked per IR from its hash and changeable by right-click (2026-10-29), and note tracking down to a 5-string bass's low B (single notes from 28 Hz, the poly finder's bands from B0; 2026-10-29), and (2026-11-07) an optional HQ mode for the pitch blocks (Signalsmith Stretch), and (2026-10-30) generic pedal photos for NAM pedal captures and pedals awaiting their render, a Home button in Add Block's library lists, middle-click toggling bypass, and the looper's Count In mode, and (2026-10-31) amp head photos for NAM amps, Add Block's live preview, Tab between text fields, a 10% smaller logo, and the looper's two-bar count-in, louder click and Tap, then the looper's Latency compensation and seam crossfade, two control rows with a split, knobs turning left/right too, Replace opening the file's folder, Set as Default, an arrow cursor on X11, and one image chooser. and (2026-11-01) half stack photos for NAM amp + cab and combo models, and the Vernier tuner as the default (inner ring ±10 cents; Hive removed), then (2026-11-02) the Arc and Aurora tuner views in place of the Vernier and Chevrons. and the looper as a global feature like the tuner and metronome (2026-11-01: out of the chain so a loop keeps playing across preset changes; mockup 3, a timeline with a lane per pass), then deletable passes, a count-in to overdubs, a start marker, and typed numbers and a BPM slider on its page, and (2026-11-02) MIDI Program Change: learnable onto switches, and assignable to presets in Manage Presets (loaded with the window closed too), and (2026-11-08) themes (Iris plus Kaia's, replacing the accent and highlight settings) and renaming presets in Manage Presets, and (2026-11-08) a fourth set of eight mono synths: Theremin, Sync Lead, Phase Distortion, Wavetable, Sub Bass, Laser, Drone Keeper and Harmonic Painter (photos awaiting the owner's renders), and (2026-11-08) touch mode for a pedalboard touchscreen. and (2026-11-09) the note tracking reworked against the owner's 26 new recordings of a 7-string in drop A and a 5-string bass (tests/recordings): the single-note tracker (down to 25 Hz, a bass in drop A; sustained notes, repeated notes, mutes) and a rewritten poly note finder (spectral peaks, with the single-note tracker alongside; was a semitone filter bank), with polyphonic tracking back on for the owner to test (MIDI Out's Poly mode; both it and the Poly Chip were off from 2026-11-08), and (2026-11-10) the Poly Chip removed: every pedal that follows notes has a Tracking button instead, Mono (the default) or Poly, the synths giving each note of a chord its own voice (docs/Architecture.md4.11, "Poly tracking on every pitch-following pedal"). And (2026-11-10) the Fart pedal is a sampler: 25 public-domain fart recordings from the owner (resources/farts/, made bytools/prepare_fart_samples.py), each pitched to your note, Random picking among those nearest it in pitch (docs/Architecture.md4.11), with Overlap (Single: one fart at a time) and Duration (Fixed: their length at any pitch) added the same day. And (2026-11-12) more accuracy on the recordings, mono and poly (docs/Architecture.md4.11, "More accuracy on the recordings": a low note's sharp picks, a long note's harmonics, a tremolo and a single note's neighbours; poly strays 86 -> 59 s). And (2026-11-14) the Hum Eliminator (Dynamics): a single coil's mains hum learnt while nothing plays and subtracted, phase-locked to the mains, so the guitar isn't filtered (docs/Architecture.md4.11, "The Hum Eliminator"; the owner's recordings intests/recordings/hum/; its photo a Blender render, 2026-11-26: the first pedal built from scratch in Blender,tools/blender/render_pedal.py). And (2026-11-17) improvements only on the recordings (docs/Architecture.md4.11, "Improvements only": the reported pitch holds back from unclear estimates, a tremolo's picks no longer read as mutes, a stopped string's sliding pitch starts no notes; in poly a louder peak's side lobes are no peaks and the note before ends once the next is clear; mono 24.0 -> 21.6 s missing, 25.5 -> 22.5 s of strays, poly strays 58.9 -> 48.8 s; no clip lost 30 ms). And (2026-11-17) pick scrapes: a faint picked note out of silence (under 15% of the notes before) must hold its pitch 40 ms, and a jump in the level is a pick (docs/Architecture.md4.11, "Pick scrapes"; mono strays 22.5 -> 21.0 s, poly 48.8 -> 47.3 s, no clip lost, the synthetic guitar only gained). Still weak in the poly finder: palm-muted chords chugged fast, octave doublings inside strummed chords, and a chord's notes come 50 to 150 ms after the strum (docs/Architecture.md4.11, "Tracking rework on the 7-string and bass recordings"). Next: M10 (v1.0 release: performance, DAW testing, docs).
- Formats: VST3 and LV2; on macOS also AU (owner, 2026-10-24: Logic and GarageBand load nothing else). No standalone app, no CLAP.
- Platforms: Linux and Windows, x86-64 only, AVX2/FMA required; macOS 11+ as a universal binary (arm64 + x86_64 with AVX2/FMA; owner, 2026-10-24, was "no macOS, no ARM"). ARM only on macOS. CPU-specific code goes through
src/engine/CpuHints.hpp(denormal flushing, spin-wait hint). - Name: Xythos; hosts show the developer as Xythos (
DISTRHO_PLUGIN_BRAND; owner, 2026-10-29: not their username). The VST3/AU IDs (S098,NMsy) are from the old name and stay, so saved projects keep finding the plugin (Architecture decisions log 19). - License: MIT. New source files start with
// SPDX-License-Identifier: MITand// Copyright (c) 2026 singularity098. - UI: DPF's NanoVG, very dark theme: the window shows the owner's dark background image (owner, 2026-10-28;
resources/background/, embedded as WebP bytools/embed_background.py, byte for byte as the owner gave it, else re-encoded losslessly: the owner saw artifacts in a lossy one; was plain black, and before that a wood image); everything over it is translucent black at 50% with hairline gray outlines (no gradient; owner, 2026-10-29; was 90%, which let next to nothing of the dark background through): bars, panels, tiles, buttons, tuner and metronome (theme::panelFill), and items listed in dialogs at 55% (itemFill,Surface::Item); except the popups over the chain, which are 95% so they read clearly (owner, 2026-10-29; a blur behind them was tried and dropped): tooltips, dropdown and right-click menus, Add Block, Settings, the other dialogs (Save Preset, Manage Presets, Images, Cab Image) and the toast (popupFill,Surface::Popup/Surface::Dialog; Add Block's items 97%,popupItemFill). The rule, owner 2026-10-29: what the window shows in its base state is 50%; everything that appears over it is 95%. The tuner and metronome replace the chain view, so they count as base state), hairline icons. Themes (owner, 2026-11-08): Settings' Theme row picks a fixed look fromink::themes()(src/state/Ink.*), stored by name asSettings::theme: Iris (the default: Splotchy in the owner's #7278fe, #c688d6, #a85eea, white accent, the text colours Xythos always had), then Kaia's themes but its Default (Ember, Abyss, Phosphor, Synthwave, Gold Leaf, Aurora, Blood Moon, Glacier, Graphite, Oxide; never rename one, the names are stored). A theme sets the paint on outlines, buttons, fills and knobs (a window-wide gradient texture),theme::accent,theme::text,theme::textDim, faint glows over the background (drawThemeGlows()) and Phosphor's scanlines (drawScanlines()). The accent colour, the Text & outlines mode, the colour presets and the colour picker are gone (their settings keys are ignored); Kaia's Plex Mono font and neon outlines weren't brought over. The logo's crop circle takes the highlight colour (owner, 2026-10-30; was fixed violet): it's its own white layer, tinted when drawn (with a gradient on, the gradient's colour where it sits). Colours must be light (relative luminance ≥ 0.12;ink::lighten()lifts darker ones). No animation (except the tuner's Aurora, which moves with the pitch; owner, 2026-11-02). Text can't take the gradient: NanoVG's glyphs use the paint's colour alone, sotext()/textBox()draw plain (seedocs/Architecture.md).src/state/Ink.*has the themes and makes the texture;XythosUI'sfillColor/strokeColorshadow NanoVG's and route the highlight (and text-coloured strokes) to the window paint. Each chain tile has a white power button top left (drawPowerButton(); dim gray while bypassed). Pedals have a power LED, lit while the block is on (drawLed(); image LEDs are placed inPedalFaces.cppand drawn from photos,drawFaceLed()). Font: Jost Light. The top bar (72 px) shows the logo big (drawLogo(), owner 2026-10-29; 10% smaller since 2026-10-31, for room, and the bar with it (was 80 px); under ~1000 px wide it shrinks, down to 70%, so the buttons still fit). No GitHub or Fretbored links (owner, 2026-11-13: clutter). Knobs: tick scale lit to the value, with a dot for the position. Theme tokens are at the top ofsrc/ui/XythosUI.cpp. Draw in logical pixels and scale byuiScale()(the host's scale factor, times a zoom below 1 when the window is smaller than the smallest layout, 900 × 560: the UI shrinks evenly, down to 40%; owner, 2026-11-07, small screens); mouse positions are divided by it too. - Block panel: a large block image on the left (the pedal's photo; drawn placeholder art for blocks without one), generic controls centred in the space to its right and spread out to fill it (owner, 2026-10-28; were right-justified). While the block is bypassed they're dark gray (
dimmed()), still adjustable. The photo's face knobs turn the same parameters as the generic ones; its footswitch toggles bypass. Face knob names are at most five letters (faceKnobLabel(): "Damping" is "Damp"), small (9), and three knobs sit in a shallow triangle, the middle one higher (owner, 2026-10-28). - Pedal images: Krea-2 renders chosen by the owner, or Blender renders (owner, 2026-11-26:
tools/blender/render_pedal.pymodels the enclosure, glyph, LED recess, footswitch and cables, renders with Cycles and prints the face placements;pip install bpy; seedocs/PedalImagePrompts.md, "Blender renders"). When the owner asks for a new pedal, also write its four image prompts (docs/PedalImagePrompts.md), with a glyph unique to that pedal. - Zero latency by default; only blocks that need latency add it, and it's reported to the host.
- Max 32 blocks; each block keeps a fixed parameter slot for its lifetime (automation/MIDI follow the block).
- One split at a time; branch B may run on a second core.
- v1 scope: local NAM blocks, local IR blocks, delay, Doppelganger Delay, reverb (room/hall/plate), compressor (studio style), plus tuner, metronome, presets, settings, undo/redo.
- Primary test DAW: Reaper.
CMakeLists.txt Top-level build; builds NAM Core as the static library `nam`
deps/DPF Submodule (DPF main), patched at configure time from patches/dpf/ (Linux only; see its README)
deps/NeuralAmpModelerCore Submodule, pinned to tag v0.6.0, patched at configure time from patches/nam/ (bounds-checked weights, checked config keys, LSTM and WaveNet sizes)
deps/doctest Submodule, pinned to v2.4.12 (unit tests)
deps/FFTConvolver Submodule (MIT): zero-latency partitioned convolution for the IR block
deps/miniz Submodule, pinned to 3.1.0 (MIT): reading zip files in the library
deps/xxHash Submodule, pinned to v0.8.3 (BSD-2): XXH3-128 content hashes
deps/libwebp Submodule, pinned to v1.6.0 (BSD-3): decoding the built-in images (WebP); only its decoder is built
deps/stb Submodule (nothings/stb, stb_image v2.30; public domain/MIT): PNG and JPEG decoding (src/ui/RasterImage.*)
deps/signalsmith-stretch Vendored (MIT), with our pitch-accuracy fixes (its README, xythos-changes.patch): the pitch blocks' HQ mode
deps/signalsmith-linear Submodule, pinned to 0.6.6 (MIT): Signalsmith Stretch's FFTs
src/engine/ Audio engine, independent of DPF (static library `xythos-engine`); PhaseCheck.* compares split branches' polarity (UI thread, never RT)
Params.* Host parameter indices and global parameter specs
Block.hpp Block base class, ParamSpec, BlockDescriptor, Category
BlockRegistry.* The list of built-in block types — add new effects here
TempoSync.* Note values for tempo-synced knobs (delay time, LFO rates)
Engine.* Input stage, chain (with split/merge), tone stack, output, the global looper, limiter, meters; lock-free chain swaps;
the MIDI path (blocks' MIDI timed past later blocks' latency, queued, note-offs when a block goes)
MidiOutput.hpp What blocks write MIDI into (fixed buffer), and the per-slot record of sounding notes
ParallelWorker.* Thread that runs split branch B on a second core
SpscQueue.hpp Lock-free queue (retired graphs go back to the non-RT side through it)
dsp/ Smoother, Biquad, ToneStack, Limiter, Meter, Lfo (+ RandomLfo), Svf (+ OnePole, EnvelopeFollower),
Waveshapers (clipping curves), PitchShifter (delay-line voices), Fdn (8-line reverb tank),
PitchTracker (YIN's difference function, real time; its header says how the period is chosen),
NoteTracker (notes from it: starts, ends, velocity, pick filter, lookahead, repeated notes;
synths, harmonizer, octave, MIDI Out), PolyNoteFinder (chords: the peaks of three spectra, the
NoteTracker alongside for single notes; the pedals' Poly tracking, MIDI Out Poly), PickFilter (old pick filter, kept for its tests and the benchmark),
PeriodFinder (autocorrelation; pitch-synchronous splices for the pitch shifter, chords included),
HumCanceller (the Hum Eliminator: mains hum learnt as one period's template and subtracted)
Oversampler (polyphase IIR half-band, 4x, zero latency), OnsetDetector (new pick attacks),
Oscillator (PolyBLEP saw and pulse for the synths), SpectralShifter (Signalsmith Stretch: the
pitch blocks' HQ mode)
dsp/DelayLine.hpp Delay line with Hermite reads, sine LFO, dry/wet mix law; AlignmentDelay (split branches)
tuner/ PitchDetector (MPM + sub-cent refinement), Tuner (ring buffer from the audio thread, analysis off it)
metronome/ Metronome (sample-accurate, free and DAW sync; all sounds generated in code)
looper/ Looper (the global looper: loop, Count In timeline, latency, clicks, the per-pass waveform it streams to the UI)
blocks/TrackedInput.hpp Track From (Rig In by default / Block In), Lookahead and Tracking (Mono: the NoteTracker; Poly: the
PolyNoteFinder) for the pitch-following blocks
blocks/ Block implementations (NAM, IR, delay, Doppelganger delay, reverb, compressor, gate, EQs, chorus, flanger, phaser,
modulation sweeper,
tremolo, doubler, wah, auto wah, boost, overdrive, distortion, fuzz, bitcrusher, volume,
auto swell, ring mod, rotary, octave, pitch shifter, whammy, poly octave, spring reverb,
shimmer, freeze, tape echo, ducking delay, synth, looper (retired: kept for old chains), harmonizer, filter; second set: gated fuzz,
envelope drive, kill switch, barber pole, warble, slicer, bloom and gated reverb, reverse and pitch
delay, beat repeat, detune, capo, arpeggiator, organ, sustainer, robot filter, talk box;
SynthBlocks: super saw, FM, fold, acid, string machine and chip synths;
third set: ResonatorBlocks
(sympathetic strings, jawari), CloudBlocks (grain cloud, swarm), TimeFxBlocks (tape stop,
bouncing ball, pattern delay), TextureBlocks (chaos mod, acoustic sim), PlayedBlocks (strum
machine, hard tune, drum trigger), InstrumentBlocks (fart: a sampler, FartSamples.hpp; trumpet, violin, piano); HumEliminatorBlock; MidiOutBlock
(MIDI notes from your playing, mono with bend or poly); DiBlocks: the DI category (bass DI boxes
and preamps: transformer, tube, opto, preamps, drives); CompBlocks: the compressor pedals (diode
bridge, console channel, opto leveler, opto stomp, FET limiter, OTA squash); MoreSynthBlocks: the
fourth set of synths (theremin, sync lead, phase distortion, wavetable, sub bass, laser, drone
keeper, harmonic painter))
blocks/TrackedSynth.hpp the synths' shared base (note tracking, glide, octave, amplitude; in Poly a voice per note, each an
instance of the same synth: Voiced<T>)
src/state/ Plain data shared by DSP and UI, no DPF:
ChainState the chain (JSON; the split is a block range + per-block branch tag)
ChainExchange chain file route for hosts that drop UI state messages
ChainMigration what chains from outside go through: later controls' defaults (`kMigrations`), retired Looper blocks
Paths per-user config/cache dirs, UTF-8 path conversion, atomic file writes
AudioFile WAV (read and write) and FLAC (write; our own encoder) for saving the looper's loop
Settings global settings and favorites (one JSON file per user)
Ink the themes (ink::themes()), the light-only rule, hex, HSV, colour names, the gradient texture
Library folder/zip scanning, index cache, hashes, zip extraction
LibraryScanner background scan thread used by the UI
Preset .xythos preset files (zip: preset.json + embedded files), missing-file resolution
UndoStack undo/redo of chain snapshots
UserImages the user's own block images: amp, cab and pedal libraries in images/ in the config dir
UpdateCheck the daily update check: version compare, GitHub release JSON, the shared cache file, the check thread
src/plugin/ DistrhoPluginInfo.h + DSP side (Plugin subclass; thin wrapper around Engine)
src/ui/ UI side (UI subclass, NanoVG). FolderPicker: the system folder dialog (DPF's only picks files). Immediate-mode: draw functions record hit areas, mouse handlers look them up.
Tuner, metronome and looper pages are overlays over the chain. OpenUrl.cpp and HttpGet.cpp (the update check's HTTPS GET) keep <windows.h> and Vsync.cpp keeps
GLX/Xlib out of the DPF code
BlockImages.hpp: the built-in block images (BlockImages.cpp is generated in the build dir from resources/blocks/);
KnobImages.cpp (generated) the face knobs (black, and the blue-rim one tinted per pedal: bodies drawn unrotated so their reflections stay put, pointers turned) and the sheen; BackgroundImage.cpp (generated) the window background; LogoImage.cpp (generated) the logo's two layers (the crop circle in white, tinted; the wordmark); WebpImage the WebP decoding (libwebp; no DPF, tested); RasterImage PNG and JPEG (deps/stb, size-limited; no DPF, tested); LedImages.cpp (generated) the face LED's layers; PedalFaces.cpp where knobs sit on a block's image and what they turn; BlockGlyphs.cpp the
symbol on each pedal's face; FileLooks.cpp each NAM/IR file's own amp/cab look, from its path; ParamHelp.cpp the hover help texts; TextEdit the text fields' cursor,
selection and word editing (no DPF, tested)
tests/ doctest unit tests; TestSupport.hpp has a test block and an allocation counter; GuitarSignals.hpp a
synthetic guitar (and 5-string bass scenes) with ground truth for TrackingTests.cpp (the note tracking benchmark:
XYTHOS_TRACKING_BENCH=1 ./build/xythos-tests -tc="*tracking benchmark"; PolyTrackingTests.cpp
is the chords' benchmark; RealTrackingTests.cpp scores both trackers on the owner's DI recordings,
with RealTracking.hpp, the clips, note lists and scoring, which a standalone program can include
too: a quick way to try a change on all 35 clips)
fuzz/ Fuzz targets (fuzz/README.md): every parser of outside input (chain state, presets and their zips, settings,
update check, WAV, IR, NAM, WebP, stb_image) and the engine under random host events. xythos-fuzz-replay
(a ctest: seed corpus fuzz/corpus/ + fixed mutations, any compiler); libFuzzer + ASan/UBSan binaries with
-DXYTHOS_FUZZ=ON (clang), run by fuzz/run_all.sh and in CI by hand only (.github/workflows/fuzz.yml; owner, 2026-11-20: no longer weekly)
tests/recordings/ The owner's DI recordings and their note lists (<clip>.notes; README.md; hum/: single coil vs humbucker, 2026-11-14): eight guitar clips (MP3,
hand-made lists) and, since 2026-11-09, 26 of a 7-string in drop A and a 5-string bass (16-bit
FLAC; lists made by tools/annotate/annotate.sh from the audio, a <clip>.spec for chord clips and
a <clip>.ov of overrides). Decode them with tools/decode_recordings.sh (ffmpeg) before
XYTHOS_TRACKING_BENCH=1 ./build/xythos-tests -tc="*real recordings*" (XYTHOS_TRACKING_CLIPS=1 per
clip, XYTHOS_TRACKING_ONLY=<name> some clips). Decoded, the unit tests score them too (4 minutes)
docs/ Requirements, architecture, the pedal image prompts (PedalImagePrompts.md), and the recordings asked of the owner
for note tracking, drop-A 7-string guitar and 5-string bass (RecordingList.md)
cmake/ EmbedBlockImages.cmake: turns resources/blocks/*.webp into BlockImages.cpp at build time; EmbedFartSamples.cmake the Fart's WAVs
resources/logo/ The logo: xythos.svg (the master; dark UI) and xythos-light.svg (for light backgrounds, the README), xythos-icon.svg
(the crop circle alone, square); the crop circle is crisp lines in the Iris gradient with no glow (owner, 2026-11-20: the glow
looked fuzzy), rendered to PNGs by
tools/render_logo.js (also xythos-mark.png and xythos-wordmark.png, the layers the plugin embeds) (Node + Playwright: the glows are SVG filters); tools/embed_logo.py makes LogoImage.cpp
resources/fonts/ Jost (variable TTF + OFL.txt); tools/embed_font.py makes the Light and Regular instances into src/ui/FontData.cpp
resources/pedals/ The generic pedal photos NAM pedal captures (and pedals awaiting their render) show, pedal-<n>.webp (1280 px high) and thumbs/ (384 px); made by tools/prepare_pedal_images.py
resources/amps/ The amp head photos NAM amps show, amp-<n>.webp (1280 px wide) and thumbs/ (384 px); made by tools/prepare_amp_images.py; faces in PedalFaces.cpp (ampHeadFaces()), style tags in FileLooks.cpp
resources/cabs/ The speaker cabinet photos IR blocks show, <size>-<n>.webp (896 px long side) and thumbs/ (320 px); made by tools/prepare_cab_images.py
resources/farts/ The Fart pedal's samples, <id>.wav (16-bit mono 48 kHz, peak-normalized); made by tools/prepare_fart_samples.py from the owner's
MP3s, which also prints their pitches and gains for kFartSamples (InstrumentBlocks.cpp); embedded by cmake/EmbedFartSamples.cmake
resources/blocks/ The pedal photos, <typeId>.webp (1:2, 1280 px high, WebP q96) and thumbs/<typeId>.webp (384 px); made by tools/prepare_block_image.py
resources/knobs/ The face knobs (knob.png black, rim.png the owner's blue-rim knob, pointing up) and the lighting layer (sheen.png);
tools/embed_knob_images.py makes KnobImages.cpp
resources/leds/ The face LED, photos made with Krea-2: off (in its bezel), lit lens, bloom, glass; tools/embed_led_images.py makes LedImages.cpp
deps/khronos/ Vendored glext.h + khrplatform.h (MSVC has none; DPF's download is unreliable)
.github/workflows/ CI: Linux (Ninja), Windows (MSVC) and macOS (universal, ad-hoc signed, auval) builds + tests
.github/scripts/ CI helper scripts
patches/dpf/ Our DPF patches (VST3: X11 events wake the UI at once), applied by CMake (not on Windows)
patches/nam/ Our NAM Core patches (safe loading of hostile .nam files; see its README), applied by CMake on every platform
Planned layout for later milestones is in docs/Architecture.md section 2.
git submodule update --init --recursive
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release
cmake --build build
ctest --test-dir build --output-on-failure # or ./build/xythos-tests
LV2_PATH=$PWD/build/bin lv2info https://github.com/singularity098/xythos # check the LV2 bundle loadsOutput goes to build/bin/xythos.lv2 and build/bin/xythos.vst3 (macOS: also xythos.component, the AU; universal by default, CMAKE_OSX_ARCHITECTURES). There's no Mac here: macOS is checked by CI (build, tests on arm64, auval), and the engine's ARM code can be checked by cross-compiling the engine and tests with aarch64-linux-gnu-g++ and running them under qemu-aarch64 -L /usr/aarch64-linux-gnu.
Sanitizer runs (worth doing after touching threading or the engine):
cmake -S . -B build-tsan -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="-fsanitize=thread -g" -DCMAKE_C_FLAGS="-fsanitize=thread"
cmake -S . -B build-asan -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="-fsanitize=address,undefined -g" -DCMAKE_C_FLAGS="-fsanitize=address,undefined"
cmake --build build-tsan --target xythos-tests && ./build-tsan/xythos-testsFuzzing (after touching a parser, the preset loader or the engine; setup in fuzz/README.md): build build-fuzz with -DXYTHOS_FUZZ=ON and clang's sanitizers, then fuzz/run_all.sh 60. A crash file reproduces anywhere with ./build/xythos-fuzz-replay --target <name> <file>; once fixed, add it to fuzz/corpus/<name>/.
lv2apply can't run the plugin (it doesn't support DPF's atom port). To see and drive the UI headless:
apt-get install -y xvfb jalv jackd2 imagemagick xdotool
Xvfb :99 -screen 0 1400x900x24 & jackd -d dummy -r 48000 -p 256 &
DISPLAY=:99 LV2_PATH=$PWD/build/bin jalv.gtk3 https://github.com/singularity098/xythos &
DISPLAY=:99 import -window root shot.png # screenshot; drive it with xdotoolThe file browser opens in the host's working directory. Final checks happen in Reaper.
-
Commit and push directly to
main. Don't create feature branches or open pull requests unless the owner asks for one. -
Claude Code setups (the web version especially) may create their own working branch for the session. Even then, don't use that branch: commit on
mainand pushmain(git push origin HEAD:main). Don't push the session branch. -
This is a solo project: branches and PRs add very little here and create unwanted overhead.
-
Run the tests before every push, since there's no PR CI gate.
-
DPF style: classes in
START_NAMESPACE_DISTRHO, members prefixedfin DPF subclasses, 4-space indent. -
The audio thread (
run()and everything it calls) must never allocate, lock or touch files.activate()andrun()never overlap (a flag handshake in the plugin), and a non-finite chain output is silenced and makes the plugin rebuild the chain with fresh blocks (Engine::takeChainFault();docs/Architecture.md4.2). Heavy work (model loading, chain rebuilds, tuner analysis) happens on other threads and is handed over lock-free. -
The UI may run in a separate process (LV2), so DSP↔UI communication goes through parameters and state only — no direct pointers.
-
CMAKE_CXX_EXTENSIONSis ON because DPF's UI code usestypeof. -
Host parameter indices are DAW automation IDs — never reorder or remove them. Globals come first, then 32 slots × 17 (bypass + 16; was 8, raised before release for the Doppelganger Delay — fixed from v1.0 on). Parameters added later go after the slots (
kFirstLaterParaminsrc/engine/Params.hpp). -
Slot parameters are normalized 0..1 for the host; each block's
ParamSpecmaps them to real values.Choiceparams list their labels inParamSpec::choices; the UI draws them as a button that opens a dropdown of the choices (owner, 2026-10-24; so does the Lookahead button).Momentaryparams are footswitch actions (the looper's buttons): 1 while held (the UI holds a quick click for 80 ms so the DSP sees it), and the block acts on the 0 -> 1 edge, which also suits MIDI footswitches. With a Latch control a press latches it on inside the block (Kill Switch, Beat Repeat, Tape Stop), which no host parameter holds, so blocks report it (Block::latched(), bit i = parameter i; the engine publishes it as the hidden outputslotLatchParam()) and take it back (setLatched()): the chain state stores it as a block'slatched, filled in by the UI when saving a preset and by the DSP'sgetState()for projects. Loading a preset sends the chain withrestoreLatches, so blocks the DSP keeps take it too; other chain sends leave kept blocks alone. A block keeps restored bits until Latch is switched from on to off (the host may restore Latch after the chain). The panel lights a latched button. -
When touching the note tracking (mono or poly), run both benchmarks before and after: the synthetic guitar's and the owner's recordings' (
tools/decode_recordings.shfirst). The recordings are what counts; the synthetic guitar has stronger fundamentals than a real DI (the poly finder rewritten on 2026-11-09 scores worse on it than the filter bank did, and far better on the recordings). A change that helps one clip often costs another: compare per clip (XYTHOS_TRACKING_CLIPS=1), and keep what was tried and dropped indocs/Architecture.md4.11. The bass in the recordings is in standard B (B0), except three clips in drop A (A0). -
A tracking change is kept only if no clip loses (owner, 2026-11-17: "improvements only"; about 30 ms of missing time and strays together was the line used): compare each clip in mono, mono with lookahead, poly, poly with lookahead and poly with noise, not just the totals.
-
The poly finder leans on the single-note tracker (
NoteTracker::clear(),PitchTracker::ownPeriod()): a change to the mono tracking changes the poly finder's results too, so score both. -
HQ pitch shifting (owner, 2026-11-07): the pitch blocks with
BlockDescriptor::hqtake the"hq"config (hqFromConfig()), shown as the panel's Quality button (Standard by default). HQ adds about 150 ms of reported latency in the shifting blocks (none in Shimmer and Pitch Delay). Signalsmith Stretch is vendored with changes: to update it, re-applydeps/signalsmith-stretch/xythos-changes.patchand runtests/HqPitchTests.cpp. Seedocs/Architecture.md4.11, "HQ pitch shifting". -
Pitch-following blocks use
TrackedInput(Track as their last parameter, the"lookahead"config,BlockDescriptor::lookaheadfor the UI's Lookahead button, and the"poly"config withBlockDescriptor::polyfor the Tracking button: Mono, always the default, or Poly; owner, 2026-11-10). A new pitch-following block gets Poly too: synths derive fromTrackedSynthand their descriptor makes aVoiced<TheBlock>; other blocks use whatTrackedInputreturns in Poly (the chord's lowest note) or itsframe(). MIDI Out has its own Mode instead. The Poly Chip (polychip) was removed on 2026-11-10:retirePolyChips()turns saved ones into a Chip Synth in Poly, wherever a chain comes in. Track defaults to Rig In (owner, 2026-10-24), but the sound always comes from the block's own input: the note's level and velocity are its input's (LevelFollower), so what's before the block still shapes it. Lookahead stays off by default (owner, 2026-10-23). When touching the note tracking, run the benchmark before and after. -
Blocks send MIDI through
Block::setMidiOutput()(MidiOutput: frames are the block's buffer's; the engine handles the timing and ends a block's notes when it's bypassed, removed or rebuilt). The plugin has a MIDI output (DISTRHO_PLUGIN_WANT_MIDI_OUTPUT); in Reaper the next plugin in the FX chain receives it. -
Blocks get the host tempo through
Block::setTempo()and can show a level in the UI throughBlock::meter()(one hidden output parameter per slot,slotMeterParam(); the descriptor'smeterNamemakes the panel show it).Block::setRigInput()gives blocks the chain's input (the noise gate's "Rig In" key). -
Tempo sync is generic: a descriptor's
syncParam/syncedParam/syncedIsRatemake the UI show note values (TempoSync.hpp); the block maps the knob itself. While the host plays,Block::setSongPosition()gives the position in quarter notes; synced LFOs lock to it (Lfo::syncTo), so they land on the beat. -
A
Choiceparameter's list must never grow or shrink once released: its normalized values would map to other choices in saved projects. Add a new block type instead. -
Every control needs a hover help text in
src/ui/ParamHelp.cpp(plain English: what it does and how to use it), and so does every block type (blockTypeHelp(): what it is, what it's for, where it goes in the chain; shown when hovering a tile or a block in Add Block);tests/ParamHelpTests.cppfails for a block type, block control or global control without one. Help is keyed by typeId and control name, so renaming a control means renaming its help entry. -
tests/BlockSanityTests.cppruns every registered block at default, extreme and random settings (finite, bounded, no allocation, silent for silence). New blocks get behaviour tests too (tests/PedalTests.cpp,tests/MorePedalTests.cppfor the second set,tests/SynthTests.cppfor the synths,tests/ThirdSetTests.cppfor the third set,tests/DiTests.cppfor the DI boxes,tests/CompPedalTests.cppfor the compressor pedals,tests/MoreSynthTests.cppfor the fourth set of synths,tests/HumEliminatorTests.cppfor the Hum Eliminator). Every pedal also needs its own face symbol insrc/ui/BlockGlyphs.cpp(tests/BlockGlyphTests.cpp). -
Block
typeIds are stored in presets and plugin state — never rename one. -
Parameter values live in the host.
ChainState.params/bypassare only for presets and undo; the UI pushes them to the host. -
The chain reaches the DSP as the
chainstate string (JSON).setState()runs off the audio thread and builds the new graph there. -
New audio-path code gets a test, including the no-allocation check (
testing::AllocationGuard). -
Files from outside (presets, models, IRs, images, settings) are hostile until checked: never build a path from what's in them without checking it's a plain name or a content hash (a preset's
hashonce let it write anywhere;loadPresetFile()), read JSON numbers withjsonInt()/jsonFloat()(ChainState.hpp), decode images only throughloadImage(), and a new file format or parser gets a fuzz target (fuzz/). -
No fast-math (
-ffast-math,/fp:fast) and no NaN sentinels: compilers may assume NaN never occurs. A Windows-only test failure came from exactly this. To check, build the tests with-DCMAKE_CXX_FLAGS=-ffast-mathand run them.
- CI fetches submodules with
.github/scripts/fetch-submodules.sh(retries; skips NAM Core's unused AudioDSPTools) and caches them, because Eigen is hosted on GitLab, which sometimes refuses requests under load. - NAM Core is linked as a whole archive: it registers model architectures from static initializers, which a normal static link drops.
- NAM Core is built with
NAM_SAMPLE_FLOAT, so models processfloatdirectly. - NAM tests use the models in
deps/NeuralAmpModelerCore/example_models(XYTHOS_EXAMPLE_MODELS). - The engine reports running slots through two output parameters (
kParamRunningSlotsLow/High); the UI marks blocks that haven't started 2.5 s after a chain change, and shows a banner if none have. - Reaper's LV2 hosting doesn't deliver the UI's state messages to the DSP (confirmed by the owner; VST3 works). So the chain has a second route: the UI writes it to a per-instance file and bumps the hidden Chain Revision parameter; a DSP thread reads the file (
src/state/ChainExchange.*). The DSP also keeps the chain itself (DISTRHO_PLUGIN_WANT_FULL_STATE) for project save/restore and writes the file so a reopened UI can read it. Test the fallback with a build configured with-DCMAKE_CXX_FLAGS=-DXYTHOS_TEST_NO_STATE_MESSAGE(UI never sends the state message) in jalv. - The looper is global (owner, 2026-11-01):
Looperinsrc/engine/looper/, owned by the engine after the output level (records what's heard, plays on through preset changes), its controls host parameters after the tuner's (looperParam(), LooperParam order, real values; MIDI-mappable), its state and waveform output parameters (8 cells streamed round-robin;encodeLooperCell()). The ∞ top-bar button opens its page in the chain's place (fLooperPanel,drawLooper(); one of looper/metronome/tuner at a time), with a dot in the state's colour while closed. Its 23 MB of loop memory is reserved only when the page opens (the UI pulses the hidden Looper Wake) or a looper footswitch is pressed, in that run only: the looper is ephemeral, so a saved project never brings the memory back (owner, 2026-11-01;Engine::serviceLooper()on the plugin's exchange thread). Save WAV…/Save FLAC… on its page save the loop (24-bit;src/state/AudioFile.*, our own FLAC encoder): the UI bumps the hidden Looper Export counter, the exchange thread writes a float WAV to the cache dir (looperExportFile()) and answers in Looper Exported, and the UI encodes that to the file picked. Each pass has its own lane of memory (LooperMemory; owner, 2026-11-01: any pass can be deleted, the × on its lane, which asks again), taken lock-free by the audio thread and kept topped up byserviceLooper()(23 MB for the first recording, then the loop's length per pass). In Count In mode Rec/Dub over a loop counts in to a new pass (LooperState::DubCountIn: playing, the clicks lead to the loop's start; stopped, the loop starts with the pass), records Passes passes, then plays on. A click on the timeline sets where Play starts, and a playing loop jumps there at once, crossfading (owner, 2026-11-03; right-click resets; Clear too). Deletes and the start go through the hidden counters Looper Delete and Looper Start. The page's numbers are text fields (kFieldLooper*), and BPM has a slider with -5/-1/+1/+5. No MP3 or Opus (owner, 2026-11-01: they'd need encoder libraries). The Looper block is retired: hidden from Add Block, kept registered for old chains;retireLoopers()moves a project's block settings to the global looper. See Architecture "Looper, global". The notes below describe the looper's behaviour, now the global one's. - Looper Count In mode (owner, 2026-10-30; the default): a press starts a count-in (Count-In clicks), records exactly Measures bars of Beats at BPM with the click, closes the loop itself, overdubs Loops - 1 more passes, then plays with no click. The clicks (the metronome's Classic sound,
classicMetronomeClick()) go to the output only. Old Looper blocks saved before it have no"countIn"config key;retireLoopers()gives the global looper Free mode for them. See Architecture "Looper". - Add Block and Replace Block preview (owner, 2026-10-31): a click or the arrow keys put the picked block in the chain to be heard; Add/Replace, Enter or a double-click keep it (one undo step), Cancel/Esc/× take it out (
previewBlock(),commitPreview(),cancelPreview()). Ctrl+Z does nothing while Add Block is open. - Bottom bar (owner, 2026-10-31: idea A of the mockups): one 60 px row, the five global knobs small with their name and value beside them (
drawSideKnob()), the meters lying down (drawMeterH()); was 132 px with names and values under the knobs. - Phase check (owner, 2026-10-31; near-zero cost): with a split whose branches both have NAM or IR blocks, the UI compares the branches' polarity on its own thread (
PhaseWorker,compareBranchPolarity()insrc/engine/PhaseCheck.*: private copies of those blocks, a quiet test signal, the low end below ~400 Hz correlated at Align's delay ±0.5 ms; tens of ms of CPU, once per change, 600 ms after the last one). Out of phase (after the Invert switches): a warning sign on the merge tile and a line in the merge panel that flips the Invert switch it names when clicked. - Touch mode (owner, 2026-11-08;
Settings::touchMode, off by default): a held-still press is a right-click after 550 ms (or shows the help where right-click does nothing), drags scroll the chain's empty space and dialog lists,hitAt()reaches 10 px past controls, no hover help. Left presses go throughonLeftPress(), held back in touch mode until they're a tap, drag or long press; Momentary hits act at once. Seedocs/Architecture.md7. - Tab and Shift+Tab move between the text fields drawn this frame (
fDrawnFields,tabToField()). - Looper Latency (owner, 2026-10-31; the last of its 16 slots, default 10 ms): makes up for the interface's round trip. Count In records from the downbeat plus it, and the loop comes round on the next downbeat from its first sample while the last round trip still goes into its end (
fTailPos; owner, 2026-10-31: waiting for it cut the first repeat's downbeat); overdubs are written that far behind the playback. Set too high, it clips the downbeat's attack; too low only plays the loop late. The panel shows Tap next to BPM (owner, 2026-10-31; the slots keep their order). The seam crossfades into the input just before the loop's start (no fade to zero). Tests intests/PedalTests.cpp("looper latency"). Old Looper blocks without the"latency"key get the default (retireLoopers());kMigrationsmay hold several entries per type. - Set as Default / Clear Default (block panel header; owner, 2026-10-31):
Settings::blockDefaults(typeId -> control name -> real value) is whataddBlock()and double-click reset (defaultNormalized(),blockDefault()) use for that type. - Replace Block on a NAM/IR block opens Add Block in the file's library folder with it picked (
openReplaceDialog()). - The block panel's controls take two rows down to
kCompactCellHeight(104 px) rows when the 128 px ones don't fit two (a split's shorter panel). - Knob drags count left/right movement as well as up/down.
- On X11 the UI defines an arrow cursor on its own window (
defineArrowCursor()insrc/ui/Vsync.cpp); without it X showed Reaper's resize cursor over the plugin. - The looper's clicks go to the engine's click bus (
Block::setClickOutput()), past the blocks after it; Count-In defaults to 8, Click to 150% (max 200%), and Tap sets BPM (TapTempo; the UI mirrors it into the BPM parameter,watchLooperTap()) (owner, 2026-10-31). - Middle-clicking a block enables or bypasses it (owner, 2026-10-30; it removed it from 2026-10-24).
- Metronome: see
docs/Architecture.md4.10. All its settings are host parameters (most hidden), not state, so they reach the DSP in every host. All its sounds are generated in code (Metronome.cpp), no samples (owner's decision): Classic is Fretbored's click (a tone with 2nd and 3rd harmonics, 50 ms decay; fitted from the owner's WAVs) raised two semitones at the owner's request (1683.6/1122.5 Hz; Fretbored's is 1500/1000), Digital and Beep are synthesized too. Don't add sample files. - Block images: the user's own image wins (
BlockState::image, an id in their amp, cab or pedal library:images/amps|cabs|pedals/in the config dir,src/state/UserImages.*; NAM blocks use amps, IR blocks cabs, the rest pedals; owner, 2026-10-29, replacing sidecar images next to NAM/IR files). The block panel's Image… button (or right-clicking the panel's image, or the tile menu's Image…; owner 2026-10-31: one chooser, left-click on the image does nothing) opens the Images dialog, or for IR blocks and NAM pedals/amps the photo dialog with a "Your images" section on top (drawCabDialog()): pick the stock image or one of the library's, Add Image… copies a file in (PNG, JPEG or WebP, checked byisUsableImage(); identical content is reused, a taken name gets a number), Delete asks again. User images are drawn as they are: no face knobs, LED or footswitch. A deleted image's blocks keep its id and show their stock image. Otherwise its type's built-in image fromresources/blocks/<typeId>.webp; otherwise the drawn placeholder art (the Neon style; owner's pick from six mockups; the Panel style was removed at the owner's request). Every pedal has a photo (owner, 2026-10-28; Krea-2 renders, the owner's favourite of four):tools/prepare_block_image.pycrops a render to the pedal (1:2) and writes the WebP and its thumbnail (needs Pillow); the build embeds them (cmake/EmbedBlockImages.cmake; only the WebPs are in git: 1280 px high at quality 96, about 115 KB each, 11 MB with thumbnails; the owner saw compression artifacts in the 640 px q88 JPEGs and approved adding libwebp, 2026-10-28). Every image goes throughloadImage(): WebPs throughdecodeWebp()(src/ui/WebpImage.*), PNG and JPEG throughdecodeRaster()(src/ui/RasterImage.*, a current stb_image), never NanoVG'screateImageFromMemory(), whose bundled 2016 stb_image a crafted JPEG makes write out of bounds (Architecture decisions log 20);tests/WebpImageTests.cppdecodes every one. The UI decodes a full image only when shown and keeps at most four (kMaxFullImages); tiles and lists use the thumbnails. Packaging decision: Architecture decisions log 16.src/ui/PedalFaces.cppplaces each face's knobs (2-3, the most important controls; the treadles, Volume, Whammy and Wah, have theirs at the heel), its power LED (on the photo's LED placeholder just above the footswitch, its radiusFaceLed::radiusso the drawn bezel, 1.42x that, covers the placeholder; owner, 2026-10-29), the knobs centred in the blank area between the enclosure's top and sides and the glyph's top, with roughly even margins on all sides (owner, 2026-10-29), its footswitch (Hit::FaceSwitchtoggles bypass; a treadle's toe) and its knobs' rim colour (the glyph's; zero for black knobs), as fractions of the image;tests/PedalFaceTests.cppchecks every pedal has an image, a face, and nothing overlapping, except new pedals awaiting the owner's render (itsawaitingPhoto()list; their prompts are under "Waiting for renders" indocs/PedalImagePrompts.md), which show a generic pedal photo picked by their typeId until then (owner, 2026-10-30; was the placeholder art). Face knobs turn the same host parameters as the panel's knobs. The sheen is drawn at 6% (kSheenStrength; owner, 2026-10-29: was 20%, too bright for the dark room). After changingresources/knobs/, runpython3 tools/embed_knob_images.py(needs Pillow and NumPy); it splits each knob into its body with the pointer painted out (drawn unrotated, so the lighting stays put, owner 2026-10-28) and the pointer alone (rotated to the value). Face LEDs are photos too (owner, 2026-10-26: the drawn ones didn't look real; made with Krea-2): the unlit LED in a chrome bezel, and while lit the lens, bloom and glass added over it (drawFaceLed()). The photos are hot pink, so each layer is embedded as a neutral part and a colour part that the UI tints with the LED's colour (any colour works;FaceLed's r, g, b). After changingresources/leds/, runpython3 tools/embed_led_images.py(needs Pillow and NumPy); it documents where each layer's circles must be. Each pedal's face symbol is insrc/ui/BlockGlyphs.cpp(one entry per typeId; the placeholder art's, and a starting point for its photo's glyph); a new block needs one, andtests/BlockGlyphTests.cppfails without it or if it matches another pedal's. NAM blocks instead get a drawn look per file from its path (src/ui/FileLooks.*, owner 2026-10-24; amps always wide heads in reds and oranges, mostly red, owner 2026-10-25); its mapping is pinned bytests/FileLookTests.cpp, since changing it changes how everyone's files look. IR blocks show a speaker cabinet photo (owner, 2026-10-29; Krea-2 renders): 42 inresources/cabs/<size>-<n>.webp(+thumbs/), sizes 1x10, 2x10, 4x10 (bass) and 1x12, 2x12, 4x12 (guitar), made bytools/prepare_cab_images.pyfrom a folder of per-size subfolders (896 px long side, q96; ~12 MB with thumbnails) and embedded asCabImages.cpp(cmake/EmbedBlockImages.cmakewith-DKIND=Cab). Each IR gets a 4x12 from its content hash (defaultCabImage(); owner, 2026-10-29: most IRs are of a 4x12; or one of the size its file name gives, like "2x10", if it gives one; the empty key, no file, gets 4x12-1); adding or renumbering images changes the defaults, and ids are stored in settings, so add new photos as new numbers. The user can pick another by right-clicking the IR in Add Block, right-clicking the panel's cab image, Image…, or the tile's "Image…": the Cab Image dialog (sections per size, the current one open) stores it inSettings::cabImages(hash -> id; the path when there's no hash), so it follows the file into every chain and preset until picked again or reset to default. A user image (Image…) still wins over it. NAM pedal captures (gear type Pedal) work the same way with the generic pedal photos (owner, 2026-10-30): 49 Krea-2 renders inresources/pedals/pedal-<n>.webp(+thumbs/), made bytools/prepare_pedal_images.pyand embedded asPedalImages.cpp(-DKIND=Pedal);defaultPedalImage()picks one from the content hash (ids in number order: add new photos as new numbers, never remove one), the same dialog titled Pedal Image (fCabPedal) stores the user's pick inSettings::pedalImages. Each has a face (genericPedalFace()inPedalFaces.cpp, placed by hand on each photo; owner, 2026-10-30): a working footswitch and a power LED in the glyph's colour, over the photo's LED hole or where one would go, but no knobs, since the painted ones aren't any particular controls;tests/PedalFaceTests.cppchecks every photo has one. The panel's right-click-to-pick hit sits under the footswitch. NAM amps (gear type Amp Head, Amp + Cab, Outboard or none; owner, 2026-10-31) work the same way with the amp head photos: 78 inresources/amps/amp-<n>.webp(tools/prepare_amp_images.py,AmpImages.cpp,-DKIND=Amp);defaultAmpImage()picks by content hash among the heads whose style tags (kAmpImageStyles, FileLooks.cpp) match the style the file name suggests (ampStyleInName(): clean, jazz, crunch, high gain, extreme; the strangest heads are tagged extreme), and the dialog titled Amp Image stores picks inSettings::ampImages. Each head's face (ampHeadFaces()) has five knobs (Input, Bass, Middle, Treble, Output) on its blank panel, close together (owner, 2026-10-31), coloured only on heads with that colour, an LED left of the power switch, and the switch toggling bypass;tests/PedalFaceTests.cppchecks every photo has one. Add new heads as new numbers (--append), each with a face and style tags. Half stacks (owner, 2026-11-01): 34 head-on-cab photos in the same folder asstack-<n>.webp(portrait;tools/prepare_amp_images.py --stacks), shown instead of a head by NAM models of an amp with its cab (gear type Amp + Cab;showsHalfStack(); owner, 2026-11-03: a file saying "amp" or nothing goes by its name and folders,rigInName()/namGear(gearType, path)insrc/state/Library.*: "full rig", "combo", "stack", "4x12", "SM57"... make it Amp + Cab, "head", "no cab", "DI"... an Amp Head), picked by content hash alone (defaultStackImage()); they share the Amp Image dialog (two sections) andSettings::ampImages, and their heads have the same five knobs, LED and switch (halfStackFaces(), measured per photo;tests/PedalFaceTests.cpp). Add new ones as new numbers. - Update check (owner, 2026-10-29): a notice in the top bar when GitHub's latest release is newer than this build; never a self-update (Architecture decisions log 18). On by default, off in Settings (
Settings::checkUpdates); at most once a day across instances (update-check.jsonin the cache dir); × storesdismissedUpdate. The version isproject(VERSION)inCMakeLists.txt(XYTHOS_VERSION, alsogetVersion()): bump it and tag the releasevX.Y.Zto match. Fetching: WinHTTP on Windows, thecurlcommand elsewhere (src/ui/HttpGet.*). To see the notice without a release, put{"checkedAt": <now in Unix seconds>, "latest": "9.9.9"}in the cache dir'supdate-check.json(XYTHOS_CACHE_DIRpoints it elsewhere). - Tuner: see
docs/Architecture.md4.9. Views (owner, 2026-11-02: needle 4 and strobe 6 of a third round of mockups, replacing the Vernier and Chevrons): Arc (the default; a plain needle from a pivot at the bottom to a ±50 cent arc, green in tune;drawArc(); owner, 2026-11-14: was a bolt of lightning that writhed further off), Runes (owner, 2026-10-31, concept 8 of ten mockups;drawRunes(), the hiddenkParamTunerRunes, the first parameter after the latches, default off) and Aurora (the strobe: three curtains of light, the fundamental and two octaves, drifting the way of the error;drawAurora(): its rays are rendered on the CPU each frame at screen resolution in float and dithered to an image, since NanoVG's faint gradients banded, owner 2026-11-14). Its glows use additive blending (beginAdditive()/endAdditive()). The view is two hidden parameters: Runes over Tuner Strobe (Arc or Aurora);kParamTunerChevrons(after Tuner Runes) picked Chevrons over Hive, a honeycomb strobe the owner removed on 2026-11-01 (too strange to use), and is unused. The plugin runsEngine::analyzeTuner()on its own thread every 20 ms while the tuner is on. Accuracy tests are intests/TunerTests.cpp; keep them passing (±0.1 cent from 31 to 1319 Hz) when touching the detector. - Split/merge: see
docs/Architecture.md4.4. The merge controls are host parameters (after the slots; Align,kParamMergeAlign, was added after the metronome's, 2026-10-29). Mono mode turns stereo after the merge and at blocks withBlockDescriptor::stereo(the Delay);processNodes()/processChain()return the channel count. Parallel processing is the Settings toggle; the DSP reads it when it builds a chain. - Not done yet in the NAM block: resampling when the host rate differs from the model's training rate.
- NAM block tone controls (owner, 2026-10-28): Bass, Middle and Treble after the model (the global
ToneStack), for sculpting each side of a split. Blocks saved before them have no"tone"in their config and stay flat in the DSP; the UI sets their controls to 0 dB and adds the key (migrateBlocks(),kMigrations, insrc/state/ChainMigration.*, shared with the DSP's preset loading), since their unused slots were saved as 0 (-12 dB). Controls added to a released block type later work the same way: a config key, and an entry inkMigrations. The panel shows Input, Bass, Middle, Treble, Output, Normalize, then the A2 Full/Lite button (owner, 2026-10-29); the slots keep their order (host parameters), so the order is the UI's, indrawSelectedPanel(). - IR block: WAV files via NAM Core's
nam::detail::load_wav_ir(PCM 16/24/32, float 32; channels stored contiguously), linearly resampled to the host rate, normalized (Normalize) to unity gain on a guitar amp's spectrum (flat from 60 Hz, -6 dB/octave above 800 Hz;normalizationGain(); owner, 2026-11-25: unit energy left cabs 4-8 dB louder than their input, the main reason the plugin was louder than others), convolved with FFTConvolver'sTwoStageFFTConvolver(head 64, tail 2048; zero latency). Never call the convolvers'reset()outsideinit(): it unloads the IR (that silenced the block after the host reactivated the plugin). Low/High Cut are off at the ends of their ranges. - Normalized levels (owner, 2026-11-25): Settings' Normalized levels row sets what Normalize brings NAM models to (
Settings::namLevel, -18 dB by default, -30..-6) and IRs to (irLevel, 0 dB on a guitar amp's spectrum, -12..+12), for every block in every project on that computer (not saved in projects or presets). The DSP's exchange thread reads the settings file when it changes (checked once a second) and callsEngine::setNormalizeLevels(); blocks getBlock::setNormalizeLevels()before every process() and follow smoothly, without a rebuild. - NAM gear type and architecture (owner, 2026-10-30): Add Block, tiles and the panel show a model's gear type (Amp + Cab, Amp Head, Cabinet, Pedal, Outboard, Spaces, Experimental;
namGear()) and architecture ("A1 Standard", "A2", "LSTM";describeNamFile()), and warn about a missing or doubled cab (cabProblem()in the UI; seedocs/Architecture.mdlibrary section). - NAM A2 Full/Lite:
nam::SlimmableModel::SetSlimmableSize(1.0)= Full,0.0= Lite (NAM/slimmable.h). Not real-time safe — call it off the audio thread. - Paths shown in the UI go through
shortenHomePath()(src/state/Paths.*: "/home/me/NAM" -> "~/NAM"; owner, 2026-10-30); the Settings folder fields show them that way andexpandHomePath()turns what's typed back into a full path before it's stored. Settings and block configs always store full paths. - Add Block's NAM/IR list header: Up, Home, Favorites and Browse are icon buttons (owner, 2026-10-30: the path needs the room), named in their hover help.
- Add Block's NAM/IR list keeps a back/forward history per list (
openLibraryDir(),stepLibraryHistory()): Alt+Left/Right, Cmd+[ / Cmd+], mouse buttons 4/5 (back/forward in DPF on every platform); its path is a breadcrumb (Hit::LibraryCrumb, index = folders below the root). - Library paths: a file inside a zip is
archive.zip!/inner/path. Blocks accept these directly:materializeLibraryFile()extracts to the cache dir on the non-RT thread. Block configs storepathandhash(XXH3-128). - Font: the UI draws in Jost, embedded as
src/ui/FontData.cpp: Light (and the fallback logo if the logo image can't load), and Regular for small text (layout sizes under 13). Jost runs small, so the UI'sfontSize()(which hides NanoVG's) draws text 1.69x the layout size (owner: too small at 1x, then asked for 30% more than 1.3x). Long names are shortened to fit withfitText(). Glyphs Jost lacks (★, ▾) fall back to DPF's DejaVu. After changingresources/fonts/or the weight, runpython3 tools/embed_font.py(needs fontTools); never editFontData.cppby hand. - User images can be PNG (8 or 16-bit; owner, 2026-11-02: DPF's old decoder couldn't take 16-bit), JPEG or WebP (
isUsableImage(), by their first bytes). PNG and JPEG are decoded bydecodeRaster()(up to 16384 px a side, 50 megapixels; a 16-bit PNG keeps its high bytes), WebP by libwebp. - Settings live in
~/.config/xythos/settings.json(Windows:%APPDATA%\Xythos; macOS:~/Library/Application Support/Xythos); the user's images inimages/beside it; the library index caches are in~/.cache/xythos(%LOCALAPPDATA%\Xythos\Cache;~/Library/Caches/Xythos). Every UI polls the settings file once a second, so instances stay in sync. Change settings withupdateSettings()in the UI, which reloads before saving. - Text fields (search, folders) need keyboard focus: focusing one calls
getWindow().focus()to take it from the host. VST3 hosts may forward keys themselves (onKeyDown); DPF then sends character input with an emptystring, soonCharacterInputencodescharacteritself. Some hosts keep keys for themselves; in Reaper, check that typing in the plugin window works (FX window option "Send all keyboard input to plugin" if not). - MIDI learn: the map (CC → host parameter) is part of the chain state, so it travels like the chain and is in undo and presets. The DSP applies mapped CCs at the start of each buffer and reports every CC (
kParamMidiLastCc/LastValue/CcCount); the UI learns from those, and also writes mapped values to the host, because LV2 hosts mostly can't take parameter changes from the DSP (VST3 can:requestParameterValueChange). The host must route MIDI to the plugin's track. - Treadles (Wah, Whammy, Volume;
treadleParam()): right-clicking the panel's photo opens a menu with MIDI Learn for what the pedal moves, Clear MIDI and Image… (owner, 2026-11-07: an expression pedal had nowhere obvious to go); other blocks' photos still open the image chooser directly. - MIDI Program Change (owner, 2026-11-02; footswitches like the M-Vave Chocolate Plus send only those out of the box): MIDI learn takes one too (
MidiMapping::program); each press flips a switch (bypass, Toggle controls, global switches) or presses a footswitch control (Momentary, the looper's buttons) for one buffer; knobs take none (ChainState::programAction()). Manage Presets' Program button assigns one to a preset (Settings::programPresets, any channel), and the DSP's exchange thread loads it itself (loadProgramPreset()), so it works with the window closed; an open UI adopts it from the exchange file when Preset Program changes. A learned mapping wins over a preset's. In LV2 hosts that can't take parameter changes from the DSP (Reaper), the host doesn't see the values while the window is closed. See Architecture 4.3, "Program Change". - Undo covers the chain (blocks, block values, bypass, MIDI map), not the global knobs. Call
beginEdit()before changingfChainin the UI. The UI mirrors host slot values intofChain(syncChainValue), so presets save automated values too. - Presets: Save and Save As write to the preset folder (
presetsDir(),presets/in the config dir; subfolders allowed) through an in-app dialog, without embedding files. Export writes a copy anywhere through the system dialog and embeds files when "Embed files when exporting" is on. Open File… opens a preset from anywhere; Save on one outside the preset folder acts as Save As. The preset menu lists the preset folder's presets as they are on disk (no Recent list): top-level presets in the menu, each folder an entry that opens a submenu of its presets and subfolders when hovered (owner, 2026-10-30; were indented headings;MenuEntry::parent/submenu,drawMenuPanel()). Manage Presets… loads saved presets, sets the default (Settings::defaultPreset), renames them (owner, 2026-11-08: Rename edits the name in place;renamePreset()renames the file in its own folder, never over another preset, and the default, Program Change, recent list and open chain follow it) and deletes them (a second click confirms;deletePreset()only removes preset files inside the preset folder). New instances load the default in the UI (presets set host parameters): a second after the UI knows its instance ID, if the host gave it no saved chain (an empty chain state means a new instance). So it only happens once the UI has opened. - Presets store the global sound controls (input mode, input, bass, middle, treble, output, limiter) and the merge controls by parameter symbol; ones a preset lacks go back to their defaults on load. Embedded files live under
files/<hash>/in the zip and are extracted tocache/presets/<hash>/. Exported presets also carry the user's images their blocks use (images/<amps|cabs|pedals>/<id>); loading one adds them to the user's libraries (an identical image is reused, one whose name is taken by other content gets a new name and the blocks follow). - jalv 1.6.8 (the headless test host) crashes ("stack smashing detected", in its JACK thread) once the UI's chain state message passes about 1.4 KB (7-8 blocks): it copies UI messages into a fixed stack buffer. Not our bug; for longer chains in jalv use the
-DXYTHOS_TEST_NO_STATE_MESSAGEbuild. That build found the UI reloading the exchange chain (and clearing undo) on every repeated instance-ID report; it now reloads only when the instance ID changes. - DPF's file browser doesn't open in the headless test setup (no desktop portal), so presets were tested there through the Recent list; check Open/Save As in Reaper.
- Fretbored (the owner's other app, https://github.com/singularity098/fretbored) is the reference for the metronome and tuner features (
js/metronome.js,js/pitch.js,js/tuner.js). - Redraw rate: on Linux the UI can only redraw once per host idle tick (pugl processes X11 events and exposes from the host's idle/timer callback; DPF asks VST3 hosts for 16 ms, LV2 hosts choose their own rate, jalv ~30 Hz). A frame costs well under 1 ms of CPU, so drawing isn't the bottleneck. Windows redraws from the native message loop. The owner saw choppy dragging in Reaper on Linux in both LV2 and VST3. DPF leaves the GL swap interval at the driver default (usually vsync on), so each swap could block the host's GUI thread until the next refresh; the UI now turns vsync off for its window (
src/ui/Vsync.cpp, GLX). Start the host withXYTHOS_SHOW_FPS=1to show a readout (idle ticks/s, frames/s, worst gap, draw time) to see what limits it. The owner's readout in Reaper: idle 36/s, frames 36/s, worst gap 31 ms, draw 0.17 ms, so Reaper's tick rate is the limit. Fix for VST3:patches/dpf/0001-vst3-x11-event-handler.patchregisters the X11 connection with the host run loop's event handler, so mouse events are handled and redrawn as they arrive (owner: 70-80 frames/s in Reaper with it, on a 120 Hz monitor; was 36; the timer callback also handles events Xlib queued during its redraws, which changed nothing measurable). With a 1000 Hz mouse (readout: mouse 800-900/s) frames stay ~80/s and the worst gap ~21 ms while draws take 0.17 ms, so Reaper seems to dispatch run-loop fd events at only ~80 Hz; going further would mean not drawing on Reaper's thread at all (a render thread in DPF), which is a large, risky change. The readout also shows mouse motion events/s. LV2 has no such mechanism (only the host's idle calls), so in Reaper the VST3 version is the smooth one.