memlnaut-nisps/schemas/modes/verb_fx.json

143 lines
12 KiB
JSON
Raw Permalink Normal View History

{
"$schema": "../schema.json",
"_note": "47-param Freeverb-style reverb + 3-delay bank + 8-band filterbank. NN outputs are smoothed then fed into voice spaces; this schema reports the [0,1] NN-output space. Per-param semantics from voicespaces/VerbFX/basic.hpp (Default voice space). Index 3 (filterbank xfade) is reused across voice spaces; remaining params follow the same layout.",
"mode_id": "verb_fx",
"engine_id": "verb_fx",
"ml": {
"input_channels": ["joy_x", "joy_y", "joy_z", "joy_w"],
"input_size": 4,
"hidden_layers": [10, 14, 18],
"output_size": 47,
refactor(ml): one runtime-configurable training default (S26) The operator's call: "there should be one default learning rate and one default max iterations and they should both be configurable at runtime." There were SIX copies, not the four the audit described, and they did not agree: nisps/ml/mlp.hpp no-arg train() hardcoding 1.f / 1000u / 0.001f — and firmware's ONLY training path calls exactly this, so firmware had no runtime knob at all wasm-iml.ts train() and trainAsync() TS default params (x2) engine-api.ts learningRate ?? 1.0, with no maxIterations knob vcv/src/iml.hpp 200 / 0.1 / 0.00001 — silently divergent external_synth_midi.hpp its own kDefaultLearningRate/kDefaultMaxIterations schemas/modes/*.json x9, identical, read by nobody at runtime Now: schemas/ml_defaults.json is the single declaration (validated against a sibling meta-schema, matching the midi_device.schema.json convention), codegen emits it to C++ and TS in the same run, and MLPCore carries a TrainConfig whose default member initialisers read the generated constant. set_train_config()/nisps_ml_set_train_config() make it runtime-overridable on every target; the explicit-argument train() overload is untouched. min_error joins the tuple — it was duplicated identically and belongs with the other two. The per-mode ml block loses default_learning_rate/default_max_iterations. default_spread stays (genuinely wired on both targets) and input_channels stays (codegen-time validated, real information for sound_analysis_midi). VCV BEHAVIOUR CHANGE, deliberate: MEMLNaut.cpp constructs IML positionally and relies on those defaults, so the module moves to 1000/1.0/0.001 — 5x the max iterations, 10x the learning rate, and a 100x looser early-stop threshold. The old values were never justified anywhere; they arrived with fbc68eb alongside an unrelated module rewrite and no tuning rationale. Firmware and WASM have shipped 1.0/1000 all along. It is now runtime-settable if this turns out worse. The generated header lands in nisps/ml/generated/, not nisps/modes/generated/ where the rest of codegen output lives: training hyperparameters are an ML fact, and nisps/ml sits below nisps/modes, so emitting them there would make mlp.hpp include upward. The agent that built this flagged the directory-crossing rather than hiding it; this is the fix. CI's generated-freshness gate learns the new directory. Gates: run-all-tests.sh ALL GREEN — 4/4 ctest, parity PASS (max delta 2.38e-7), lint clean, manifold typecheck + 17 unit + 33 e2e (which exercise train() and trainAsync() through a real browser).
2026-07-21 17:20:10 +02:00
"default_spread": 0.6
},
"params": [
{ "name": "fb_delay_xfade", "label": "Bank/Delay XFade", "min": 0.0, "max": 1.0, "default": 0.0, "curve": "linear", "group": "routing" },
{ "name": "lp0_fb", "label": "LP Comb 0 FB", "min": 0.0, "max": 1.0, "default": 0.5, "curve": "linear", "group": "verb" },
{ "name": "lp0_cutoff", "label": "LP Comb 0 Cutoff", "min": 0.0, "max": 1.0, "default": 0.5, "curve": "linear", "group": "verb" },
{ "name": "lp1_fb", "label": "LP Comb 1 FB", "min": 0.0, "max": 1.0, "default": 0.5, "curve": "linear", "group": "verb" },
{ "name": "lp1_cutoff", "label": "LP Comb 1 Cutoff", "min": 0.0, "max": 1.0, "default": 0.5, "curve": "linear", "group": "verb" },
{ "name": "lp2_fb", "label": "LP Comb 2 FB", "min": 0.0, "max": 1.0, "default": 0.5, "curve": "linear", "group": "verb" },
{ "name": "lp2_cutoff", "label": "LP Comb 2 Cutoff", "min": 0.0, "max": 1.0, "default": 0.5, "curve": "linear", "group": "verb" },
{ "name": "lp3_fb", "label": "LP Comb 3 FB", "min": 0.0, "max": 1.0, "default": 0.5, "curve": "linear", "group": "verb" },
{ "name": "lp3_cutoff", "label": "LP Comb 3 Cutoff", "min": 0.0, "max": 1.0, "default": 0.5, "curve": "linear", "group": "verb" },
{ "name": "lp4_fb", "label": "LP Comb 4 FB", "min": 0.0, "max": 1.0, "default": 0.5, "curve": "linear", "group": "verb" },
{ "name": "lp4_cutoff", "label": "LP Comb 4 Cutoff", "min": 0.0, "max": 1.0, "default": 0.5, "curve": "linear", "group": "verb" },
{ "name": "lp5_fb", "label": "LP Comb 5 FB", "min": 0.0, "max": 1.0, "default": 0.5, "curve": "linear", "group": "verb" },
{ "name": "lp5_cutoff", "label": "LP Comb 5 Cutoff", "min": 0.0, "max": 1.0, "default": 0.5, "curve": "linear", "group": "verb" },
{ "name": "lp6_fb", "label": "LP Comb 6 FB", "min": 0.0, "max": 1.0, "default": 0.5, "curve": "linear", "group": "verb" },
{ "name": "lp6_cutoff", "label": "LP Comb 6 Cutoff", "min": 0.0, "max": 1.0, "default": 0.5, "curve": "linear", "group": "verb" },
{ "name": "lp7_fb", "label": "LP Comb 7 FB", "min": 0.0, "max": 1.0, "default": 0.5, "curve": "linear", "group": "verb" },
{ "name": "lp7_cutoff", "label": "LP Comb 7 Cutoff", "min": 0.0, "max": 1.0, "default": 0.5, "curve": "linear", "group": "verb" },
{ "name": "allp0_fb", "label": "Allpass 0 FB", "min": 0.0, "max": 1.0, "default": 0.5, "curve": "linear", "group": "verb" },
{ "name": "allp1_fb", "label": "Allpass 1 FB", "min": 0.0, "max": 1.0, "default": 0.5, "curve": "linear", "group": "verb" },
{ "name": "allp2_fb", "label": "Allpass 2 FB", "min": 0.0, "max": 1.0, "default": 0.5, "curve": "linear", "group": "verb" },
{ "name": "allp3_fb", "label": "Allpass 3 FB", "min": 0.0, "max": 1.0, "default": 0.5, "curve": "linear", "group": "verb" },
{ "name": "fbank_f0", "label": "Filterbank Freq 0","min": 0.0, "max": 1.0, "default": 0.5, "curve": "linear", "group": "filterbank" },
{ "name": "fbank_f1", "label": "Filterbank Freq 1","min": 0.0, "max": 1.0, "default": 0.5, "curve": "linear", "group": "filterbank" },
{ "name": "fbank_f2", "label": "Filterbank Freq 2","min": 0.0, "max": 1.0, "default": 0.5, "curve": "linear", "group": "filterbank" },
{ "name": "fbank_f3", "label": "Filterbank Freq 3","min": 0.0, "max": 1.0, "default": 0.5, "curve": "linear", "group": "filterbank" },
{ "name": "fbank_f4", "label": "Filterbank Freq 4","min": 0.0, "max": 1.0, "default": 0.5, "curve": "linear", "group": "filterbank" },
{ "name": "fbank_f5", "label": "Filterbank Freq 5","min": 0.0, "max": 1.0, "default": 0.5, "curve": "linear", "group": "filterbank" },
{ "name": "fbank_f6", "label": "Filterbank Freq 6","min": 0.0, "max": 1.0, "default": 0.5, "curve": "linear", "group": "filterbank" },
{ "name": "fbank_f7", "label": "Filterbank Freq 7","min": 0.0, "max": 1.0, "default": 0.5, "curve": "linear", "group": "filterbank" },
{ "name": "fbank_res0", "label": "Filterbank Res 0", "min": 0.0, "max": 1.0, "default": 0.0, "curve": "linear", "group": "filterbank" },
{ "name": "fbank_res1", "label": "Filterbank Res 1", "min": 0.0, "max": 1.0, "default": 0.0, "curve": "linear", "group": "filterbank" },
{ "name": "fbank_res2", "label": "Filterbank Res 2", "min": 0.0, "max": 1.0, "default": 0.0, "curve": "linear", "group": "filterbank" },
{ "name": "fbank_res3", "label": "Filterbank Res 3", "min": 0.0, "max": 1.0, "default": 0.0, "curve": "linear", "group": "filterbank" },
{ "name": "fbank_res4", "label": "Filterbank Res 4", "min": 0.0, "max": 1.0, "default": 0.0, "curve": "linear", "group": "filterbank" },
{ "name": "fbank_res5", "label": "Filterbank Res 5", "min": 0.0, "max": 1.0, "default": 0.0, "curve": "linear", "group": "filterbank" },
{ "name": "fbank_res6", "label": "Filterbank Res 6", "min": 0.0, "max": 1.0, "default": 0.0, "curve": "linear", "group": "filterbank" },
{ "name": "fbank_res7", "label": "Filterbank Res 7", "min": 0.0, "max": 1.0, "default": 0.0, "curve": "linear", "group": "filterbank" },
{ "name": "delay0_time", "label": "Long Delay Time", "min": 0.0, "max": 1.0, "default": 0.5, "curve": "linear", "group": "delays" },
{ "name": "delay0_fb", "label": "Long Delay FB", "min": 0.0, "max": 1.0, "default": 0.5, "curve": "linear", "group": "delays" },
{ "name": "delay1_time", "label": "Med Delay Time", "min": 0.0, "max": 1.0, "default": 0.5, "curve": "linear", "group": "delays" },
{ "name": "delay1_fb", "label": "Med Delay FB", "min": 0.0, "max": 1.0, "default": 0.5, "curve": "linear", "group": "delays" },
{ "name": "delay2_time", "label": "Short Delay Time", "min": 0.0, "max": 1.0, "default": 0.5, "curve": "linear", "group": "delays" },
{ "name": "delay2_fb", "label": "Short Delay FB", "min": 0.0, "max": 1.0, "default": 0.5, "curve": "linear", "group": "delays" },
{ "name": "verb_vs_delay", "label": "Verb vs Delay", "min": 0.0, "max": 1.0, "default": 0.5, "curve": "linear", "group": "routing" },
{ "name": "delay_to_verb", "label": "Delay→Verb Send", "min": 0.0, "max": 1.0, "default": 0.0, "curve": "linear", "group": "routing" },
{ "name": "delay_morph", "label": "Delay Morph", "min": 0.0, "max": 1.0, "default": 0.5, "curve": "linear", "group": "delays" },
{ "name": "delay_blend", "label": "Delay Blend", "min": 0.0, "max": 1.0, "default": 0.0, "curve": "linear", "group": "delays" }
],
"voice_spaces": [
"Default",
feat: curve truth, DriverConfig, real telemetry, engine benchmark Four items from one workflow, committed together because their build and CI wiring genuinely interleaves — nisps/CMakeLists.txt, run-all-tests.sh and ci.yml each carry hunks from two of them, and the stage renumbering (1/5 -> 1/6) touches every line. Splitting would produce commits that do not build, which is worse than a commit that does four things and says so. S26 part 2 — the curve declaration now matches reality. params[].curve stays the mode-wide DEFAULT; a voice_spaces entry may now be {name, curve_overrides} declaring only the slots where THAT voice space deviates. The 6 modes with one voice space are byte-identical. The values were derived MECHANICALLY by a new codegen/curve-audit.ts that models the four idioms a p[N]*p[N] regex misses (alias form, memlcelium's implicit-counter sq() lambda, loop-generated indices, smooth_params_), inlines helpers, and RAISES rather than guessing when it cannot reduce an expression. A drift gate cross-checks 1179 (voice space x param) slots against engine source on every run and was proved to fail loudly on three drift classes. Application stays in the engine: nisps/engines, nisps/pipeline and nisps/core are untouched, generated output is pure insertion (755 insertions, 0 deletions), and the rebuilt nisps.wasm was byte-identical. S4 / 7.2 — firmware reads the active mode's driver config at mode start, and mic/line is real. My brief assumed the engine owns this; the code disagreed and the code was right. sound_analysis_midi's EngineT is NoOpEngine — the mic lives on a separately-composed AnalysisEngine member — so engine-level wiring would have compiled, passed every gate, and left the one mic mode on line input. Hence a mode-level seam defaulting to engine().driver_config(). Separately, DriverConfig's defaults (line_level 0, output_volume 1.0) had drifted from memllib's actual 3/0.8 because nothing had ever read them; wiring them as-is would have made every silent mode louder and its line input maximally insensitive — a behaviour change disguised as plumbing. Now pinned by a test. Also: GetSysClockSpeed() panic()s on unsupported sample rates and runs on the first line of setup(), so sample_rate needed a fallback ahead of clock setup. CI's firmware env list gains soundanalysismidi — it is the only mic variant and nothing else compiles that path. Plan 5e — telemetry is real. A loss_history C-API entry across the full 5-layer chain lets the browser read the per-iteration loss the core already records. The audit named one fabrication site; there were two — wasm-iml.ts's synchronous train() published lossHistory: [loss] as well. A third, ctx.loss, was not merely dead but actively synthetic (fallbacks of prev * 0.82 and a literal 0.5, rendered by nothing) and is deleted. The firmware buffer stays untouched, per the L25 call. EngineApi.lossHistory() reads spine state rather than the MLP handle, because trainAsync() fits on the worker's mirror net and the handle would give a subtly-wrong second answer. Plan 5f — engine throughput is measurable. One source compiled twice (CMake natively, emcc for WASM) so the targets compare directly and no WASM export is added. Sequencers are driven into a working state, and every row prints its own working-state evidence so a number produced by an idle engine is visible rather than plausible. Reports, never asserts: a wall-clock threshold on shared hardware is meaningless or flaky, same call as the firmware size job. ALIGNMENT: the telemetry defect is deleted (built, not deferred); the performance defect is rewritten to what is actually left — these are HOST numbers, and nothing measures the RP2350 at 150 MHz, which is the target the mission's constraint is about. Q4 (memllib ownership) and Q5 (legacy feedback modes) are closed. Corrections to my own earlier claims, both found by agents contradicting the brief: manifold/ONBOARDING.md was NOT "now accurate" — its primitives list still named five deleted primitives and cited a seededGradient() that does not exist. And the parity harness misses the sequencer engines because it runs 128 frames while their sequencers evaluate every 400-500 samples, NOT because all-params-0.5 fails to trigger them (it does trigger: 0.5 maps to ratio 2, firing three times per bar). The fix is a longer window, not different params. Gates: run-all-tests.sh ALL GREEN — 4/4 ctest, parity PASS, lint clean, curve drift 1179 slots ok, 39 e2e (was 33). Firmware: 5 envs built including the mic variant.
2026-07-21 22:02:23 +02:00
{ "name": "Resonant", "curve_overrides": {
"fbank_res0": "sqrt", "fbank_res1": "sqrt", "fbank_res2": "sqrt", "fbank_res3": "sqrt",
"fbank_res4": "sqrt", "fbank_res5": "sqrt", "fbank_res6": "sqrt", "fbank_res7": "sqrt"
} },
{ "name": "Soft", "curve_overrides": {
"lp0_fb": "square", "lp1_fb": "square", "lp2_fb": "square", "lp3_fb": "square",
"lp4_fb": "square", "lp5_fb": "square", "lp6_fb": "square", "lp7_fb": "square",
"allp0_fb": "square", "allp1_fb": "square", "allp2_fb": "square", "allp3_fb": "square",
"fbank_res0": "square", "fbank_res1": "square", "fbank_res2": "square", "fbank_res3": "square",
"fbank_res4": "square", "fbank_res5": "square", "fbank_res6": "square", "fbank_res7": "square",
"delay0_fb": "square", "delay1_fb": "square", "delay2_fb": "square"
} },
{ "name": "Cathedral", "curve_overrides": {
"lp0_fb": "sqrt", "lp1_fb": "sqrt", "lp2_fb": "sqrt", "lp3_fb": "sqrt",
"lp4_fb": "sqrt", "lp5_fb": "sqrt", "lp6_fb": "sqrt", "lp7_fb": "sqrt",
"allp0_fb": "sqrt", "allp1_fb": "sqrt", "allp2_fb": "sqrt", "allp3_fb": "sqrt",
"delay0_time": "sqrt", "delay0_fb": "sqrt", "delay1_time": "sqrt", "delay1_fb": "sqrt",
"delay2_time": "sqrt", "delay2_fb": "sqrt", "verb_vs_delay": "square"
} },
{ "name": "Shimmer", "curve_overrides": {
"lp0_fb": "sqrt", "lp1_fb": "sqrt", "lp2_fb": "sqrt", "lp3_fb": "sqrt",
"lp4_fb": "sqrt", "lp5_fb": "sqrt", "lp6_fb": "sqrt", "lp7_fb": "sqrt",
"allp0_fb": "sqrt", "allp1_fb": "sqrt", "allp2_fb": "sqrt", "allp3_fb": "sqrt",
"fbank_res0": "sqrt", "fbank_res1": "sqrt", "fbank_res2": "sqrt", "fbank_res3": "sqrt",
"fbank_res4": "sqrt", "fbank_res5": "sqrt", "fbank_res6": "sqrt", "fbank_res7": "sqrt",
"delay0_fb": "sqrt", "delay1_fb": "sqrt", "delay2_fb": "sqrt", "verb_vs_delay": "square"
} },
{ "name": "Chamber", "curve_overrides": {
"lp0_fb": "square", "lp1_fb": "square", "lp2_fb": "square", "lp3_fb": "square",
"lp4_fb": "square", "lp5_fb": "square", "lp6_fb": "square", "lp7_fb": "square",
"allp0_fb": "square", "allp1_fb": "square", "allp2_fb": "square", "allp3_fb": "square",
"fbank_res0": "square", "fbank_res1": "square", "fbank_res2": "square", "fbank_res3": "square",
"fbank_res4": "square", "fbank_res5": "square", "fbank_res6": "square", "fbank_res7": "square",
"delay0_time": "square", "delay0_fb": "square", "delay1_time": "square", "delay1_fb": "square",
"delay2_time": "square", "delay2_fb": "square"
} },
{ "name": "Metallic", "curve_overrides": {
"allp0_fb": "sqrt", "allp1_fb": "sqrt", "allp2_fb": "sqrt", "allp3_fb": "sqrt",
"fbank_res0": "sqrt", "fbank_res1": "square", "fbank_res2": "sqrt", "fbank_res3": "square",
"fbank_res4": "sqrt", "fbank_res5": "square", "fbank_res6": "sqrt", "fbank_res7": "square"
} },
{ "name": "Granular", "curve_overrides": {
"lp0_fb": "square", "lp1_fb": "square", "lp2_fb": "square", "lp3_fb": "square",
"lp4_fb": "square", "lp5_fb": "square", "lp6_fb": "square", "lp7_fb": "square",
"allp0_fb": "square", "allp1_fb": "square", "allp2_fb": "square", "allp3_fb": "square",
"fbank_res0": "square", "fbank_res1": "square", "fbank_res2": "square", "fbank_res3": "square",
"fbank_res4": "square", "fbank_res5": "square", "fbank_res6": "square", "fbank_res7": "square",
"delay0_fb": "square", "delay1_fb": "square", "delay2_fb": "sqrt", "verb_vs_delay": "sqrt",
"delay_morph": "square", "delay_blend": "sqrt"
} },
{ "name": "Diffuse", "curve_overrides": {
"fb_delay_xfade": "sqrt", "allp0_fb": "sqrt", "allp1_fb": "sqrt", "allp2_fb": "sqrt",
"allp3_fb": "sqrt", "fbank_res0": "square", "fbank_res1": "square", "fbank_res2": "square",
"fbank_res3": "square", "fbank_res4": "square", "fbank_res5": "square", "fbank_res6": "square",
"fbank_res7": "square", "delay0_fb": "sqrt", "delay1_fb": "sqrt", "delay2_fb": "sqrt"
} },
{ "name": "Dark", "curve_overrides": {
"fbank_f0": "square", "fbank_f1": "square", "fbank_f2": "square", "fbank_f3": "square",
"fbank_f4": "square", "fbank_f5": "square", "fbank_f6": "square", "fbank_f7": "square",
"fbank_res0": "sqrt", "fbank_res1": "sqrt", "fbank_res2": "sqrt", "fbank_res3": "sqrt",
"fbank_res4": "square", "fbank_res5": "square", "fbank_res6": "square", "fbank_res7": "square"
} },
{ "name": "Bright", "curve_overrides": {
"fbank_f0": "sqrt", "fbank_f1": "sqrt", "fbank_f2": "sqrt", "fbank_f3": "sqrt",
"fbank_f4": "sqrt", "fbank_f5": "sqrt", "fbank_f6": "sqrt", "fbank_f7": "sqrt",
"fbank_res0": "square", "fbank_res1": "square", "fbank_res2": "square", "fbank_res3": "square",
"fbank_res4": "sqrt", "fbank_res5": "sqrt", "fbank_res6": "sqrt", "fbank_res7": "sqrt"
} },
{ "name": "Harmonic", "curve_overrides": {
"fbank_res0": "sqrt", "fbank_res1": "sqrt", "fbank_res2": "sqrt", "fbank_res3": "sqrt",
"fbank_res4": "sqrt", "fbank_res5": "sqrt", "fbank_res6": "sqrt", "fbank_res7": "sqrt"
} }
],
"ui": {
"primary_input": "joystick",
"show_voice_space_selector": true,
"show_synth_visualizer": false
}
}