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.
435 lines
11 KiB
TypeScript
435 lines
11 KiB
TypeScript
// AUTOGENERATED — do not edit. Source: schemas/modes/paf_synth.json. Run `bun run codegen/generate.ts` to regenerate.
|
|
import type { ModeSchema } from './types';
|
|
|
|
export interface PafSynthParams {
|
|
readonly p00: number;
|
|
readonly p01: number;
|
|
readonly paf0_cf: number;
|
|
readonly paf1_cf: number;
|
|
readonly p04: number;
|
|
readonly paf0_bw: number;
|
|
readonly paf1_bw: number;
|
|
readonly p07: number;
|
|
readonly paf0_vib: number;
|
|
readonly paf1_vib: number;
|
|
readonly p10: number;
|
|
readonly paf0_vfr: number;
|
|
readonly paf1_vfr: number;
|
|
readonly p13: number;
|
|
readonly paf0_shift: number;
|
|
readonly paf1_shift: number;
|
|
readonly p16: number;
|
|
readonly dl1mix: number;
|
|
readonly p18: number;
|
|
readonly dlfb: number;
|
|
readonly env_decay: number;
|
|
readonly p21: number;
|
|
readonly p22: number;
|
|
readonly p23: number;
|
|
readonly p24: number;
|
|
readonly p25: number;
|
|
readonly shape_gain: number;
|
|
readonly shape_asym: number;
|
|
readonly shape_mix: number;
|
|
readonly rm_gain: number;
|
|
readonly env_attack: number;
|
|
readonly env_sustain: number;
|
|
readonly env_release: number;
|
|
}
|
|
|
|
export const PafSynthSchema: ModeSchema = {
|
|
mode_id: 'paf_synth',
|
|
engine_id: 'paf_synth',
|
|
ml: {
|
|
input_channels: [
|
|
'joy_x',
|
|
'joy_y',
|
|
'joy_z',
|
|
'joy_w',
|
|
],
|
|
input_size: 4,
|
|
hidden_layers: [
|
|
10,
|
|
10,
|
|
14,
|
|
],
|
|
output_size: 33,
|
|
default_spread: 0.6,
|
|
},
|
|
params: [
|
|
{
|
|
name: 'p00',
|
|
label: 'Param 00',
|
|
min: 0,
|
|
max: 1,
|
|
default: 0.5,
|
|
curve: 'linear',
|
|
group: 'general',
|
|
},
|
|
{
|
|
name: 'p01',
|
|
label: 'Param 01',
|
|
min: 0,
|
|
max: 1,
|
|
default: 0.5,
|
|
curve: 'linear',
|
|
group: 'general',
|
|
},
|
|
{
|
|
name: 'paf0_cf',
|
|
label: 'PAF0 Center Freq',
|
|
min: 0,
|
|
max: 1,
|
|
default: 0.5,
|
|
curve: 'linear',
|
|
group: 'operators',
|
|
},
|
|
{
|
|
name: 'paf1_cf',
|
|
label: 'PAF1 Center Freq',
|
|
min: 0,
|
|
max: 1,
|
|
default: 0.5,
|
|
curve: 'linear',
|
|
group: 'operators',
|
|
},
|
|
{
|
|
name: 'p04',
|
|
label: 'Param 04',
|
|
min: 0,
|
|
max: 1,
|
|
default: 0.5,
|
|
curve: 'linear',
|
|
group: 'general',
|
|
},
|
|
{
|
|
name: 'paf0_bw',
|
|
label: 'PAF0 Bandwidth',
|
|
min: 0,
|
|
max: 1,
|
|
default: 0.5,
|
|
curve: 'linear',
|
|
group: 'operators',
|
|
},
|
|
{
|
|
name: 'paf1_bw',
|
|
label: 'PAF1 Bandwidth',
|
|
min: 0,
|
|
max: 1,
|
|
default: 0.5,
|
|
curve: 'linear',
|
|
group: 'operators',
|
|
},
|
|
{
|
|
name: 'p07',
|
|
label: 'Param 07',
|
|
min: 0,
|
|
max: 1,
|
|
default: 0.5,
|
|
curve: 'linear',
|
|
group: 'general',
|
|
},
|
|
{
|
|
name: 'paf0_vib',
|
|
label: 'PAF0 Vibrato Depth',
|
|
min: 0,
|
|
max: 1,
|
|
default: 0,
|
|
curve: 'square',
|
|
group: 'modulation',
|
|
},
|
|
{
|
|
name: 'paf1_vib',
|
|
label: 'PAF1 Vibrato Depth',
|
|
min: 0,
|
|
max: 1,
|
|
default: 0,
|
|
curve: 'square',
|
|
group: 'modulation',
|
|
},
|
|
{
|
|
name: 'p10',
|
|
label: 'Param 10',
|
|
min: 0,
|
|
max: 1,
|
|
default: 0.5,
|
|
curve: 'linear',
|
|
group: 'general',
|
|
},
|
|
{
|
|
name: 'paf0_vfr',
|
|
label: 'PAF0 Vibrato Rate',
|
|
min: 0,
|
|
max: 1,
|
|
default: 0.5,
|
|
curve: 'square',
|
|
group: 'modulation',
|
|
},
|
|
{
|
|
name: 'paf1_vfr',
|
|
label: 'PAF1 Vibrato Rate',
|
|
min: 0,
|
|
max: 1,
|
|
default: 0.5,
|
|
curve: 'square',
|
|
group: 'modulation',
|
|
},
|
|
{
|
|
name: 'p13',
|
|
label: 'Param 13',
|
|
min: 0,
|
|
max: 1,
|
|
default: 0.5,
|
|
curve: 'linear',
|
|
group: 'general',
|
|
},
|
|
{
|
|
name: 'paf0_shift',
|
|
label: 'PAF0 Shift',
|
|
min: 0,
|
|
max: 1,
|
|
default: 0.5,
|
|
curve: 'linear',
|
|
group: 'operators',
|
|
},
|
|
{
|
|
name: 'paf1_shift',
|
|
label: 'PAF1 Shift',
|
|
min: 0,
|
|
max: 1,
|
|
default: 0.5,
|
|
curve: 'linear',
|
|
group: 'operators',
|
|
},
|
|
{
|
|
name: 'p16',
|
|
label: 'Param 16',
|
|
min: 0,
|
|
max: 1,
|
|
default: 0.5,
|
|
curve: 'linear',
|
|
group: 'general',
|
|
},
|
|
{
|
|
name: 'dl1mix',
|
|
label: 'Delay Mix',
|
|
min: 0,
|
|
max: 1,
|
|
default: 0,
|
|
curve: 'square',
|
|
group: 'delay',
|
|
},
|
|
{
|
|
name: 'p18',
|
|
label: 'Param 18',
|
|
min: 0,
|
|
max: 1,
|
|
default: 0.5,
|
|
curve: 'linear',
|
|
group: 'general',
|
|
},
|
|
{
|
|
name: 'dlfb',
|
|
label: 'Delay Feedback',
|
|
min: 0,
|
|
max: 1,
|
|
default: 0.5,
|
|
curve: 'linear',
|
|
group: 'delay',
|
|
},
|
|
{
|
|
name: 'env_decay',
|
|
label: 'Env Decay',
|
|
min: 0,
|
|
max: 1,
|
|
default: 0.3,
|
|
curve: 'square',
|
|
group: 'envelope',
|
|
},
|
|
{
|
|
name: 'p21',
|
|
label: 'Param 21',
|
|
min: 0,
|
|
max: 1,
|
|
default: 0.5,
|
|
curve: 'linear',
|
|
group: 'general',
|
|
},
|
|
{
|
|
name: 'p22',
|
|
label: 'Param 22',
|
|
min: 0,
|
|
max: 1,
|
|
default: 0.5,
|
|
curve: 'linear',
|
|
group: 'general',
|
|
},
|
|
{
|
|
name: 'p23',
|
|
label: 'Param 23',
|
|
min: 0,
|
|
max: 1,
|
|
default: 0.5,
|
|
curve: 'linear',
|
|
group: 'general',
|
|
},
|
|
{
|
|
name: 'p24',
|
|
label: 'Param 24',
|
|
min: 0,
|
|
max: 1,
|
|
default: 0.5,
|
|
curve: 'linear',
|
|
group: 'general',
|
|
},
|
|
{
|
|
name: 'p25',
|
|
label: 'Param 25',
|
|
min: 0,
|
|
max: 1,
|
|
default: 0.5,
|
|
curve: 'linear',
|
|
group: 'general',
|
|
},
|
|
{
|
|
name: 'shape_gain',
|
|
label: 'Sine Shape Gain',
|
|
min: 0,
|
|
max: 1,
|
|
default: 0,
|
|
curve: 'square',
|
|
group: 'shaper',
|
|
},
|
|
{
|
|
name: 'shape_asym',
|
|
label: 'Sine Shape Asym',
|
|
min: 0,
|
|
max: 1,
|
|
default: 0,
|
|
curve: 'square',
|
|
group: 'shaper',
|
|
},
|
|
{
|
|
name: 'shape_mix',
|
|
label: 'Sine Shape Mix',
|
|
min: 0,
|
|
max: 1,
|
|
default: 0,
|
|
curve: 'linear',
|
|
group: 'shaper',
|
|
},
|
|
{
|
|
name: 'rm_gain',
|
|
label: 'Ring Mod Gain',
|
|
min: 0,
|
|
max: 1,
|
|
default: 0,
|
|
curve: 'square',
|
|
group: 'shaper',
|
|
},
|
|
{
|
|
name: 'env_attack',
|
|
label: 'Env Attack',
|
|
min: 0,
|
|
max: 1,
|
|
default: 0,
|
|
curve: 'linear',
|
|
group: 'envelope',
|
|
},
|
|
{
|
|
name: 'env_sustain',
|
|
label: 'Env Sustain',
|
|
min: 0,
|
|
max: 1,
|
|
default: 0.5,
|
|
curve: 'linear',
|
|
group: 'envelope',
|
|
},
|
|
{
|
|
name: 'env_release',
|
|
label: 'Env Release',
|
|
min: 0,
|
|
max: 1,
|
|
default: 0.3,
|
|
curve: 'linear',
|
|
group: 'envelope',
|
|
},
|
|
],
|
|
voice_spaces: [
|
|
'Ellipticacacia',
|
|
'Rowantares',
|
|
'Neemeda',
|
|
'Aquillow',
|
|
'Magnetarch',
|
|
'Elderstar',
|
|
'Ipeleiades',
|
|
],
|
|
curve_overrides: [
|
|
{ voice_space: 0, param: 8, curve: 'linear' }, // Ellipticacacia.paf0_vib
|
|
{ voice_space: 0, param: 9, curve: 'linear' }, // Ellipticacacia.paf1_vib
|
|
{ voice_space: 0, param: 11, curve: 'linear' }, // Ellipticacacia.paf0_vfr
|
|
{ voice_space: 0, param: 12, curve: 'linear' }, // Ellipticacacia.paf1_vfr
|
|
{ voice_space: 0, param: 14, curve: 'square' }, // Ellipticacacia.paf0_shift
|
|
{ voice_space: 0, param: 17, curve: 'linear' }, // Ellipticacacia.dl1mix
|
|
{ voice_space: 0, param: 18, curve: 'square' }, // Ellipticacacia.p18
|
|
{ voice_space: 0, param: 19, curve: 'square' }, // Ellipticacacia.dlfb
|
|
{ voice_space: 0, param: 20, curve: 'linear' }, // Ellipticacacia.env_decay
|
|
{ voice_space: 0, param: 26, curve: 'linear' }, // Ellipticacacia.shape_gain
|
|
{ voice_space: 0, param: 27, curve: 'linear' }, // Ellipticacacia.shape_asym
|
|
{ voice_space: 0, param: 29, curve: 'linear' }, // Ellipticacacia.rm_gain
|
|
{ voice_space: 2, param: 10, curve: 'square' }, // Neemeda.p10
|
|
{ voice_space: 2, param: 13, curve: 'square' }, // Neemeda.p13
|
|
{ voice_space: 2, param: 23, curve: 'square' }, // Neemeda.p23
|
|
{ voice_space: 2, param: 24, curve: 'square' }, // Neemeda.p24
|
|
{ voice_space: 3, param: 10, curve: 'square' }, // Aquillow.p10
|
|
{ voice_space: 3, param: 13, curve: 'square' }, // Aquillow.p13
|
|
{ voice_space: 3, param: 23, curve: 'square' }, // Aquillow.p23
|
|
{ voice_space: 3, param: 24, curve: 'square' }, // Aquillow.p24
|
|
{ voice_space: 3, param: 26, curve: 'linear' }, // Aquillow.shape_gain
|
|
{ voice_space: 3, param: 27, curve: 'linear' }, // Aquillow.shape_asym
|
|
{ voice_space: 3, param: 29, curve: 'linear' }, // Aquillow.rm_gain
|
|
{ voice_space: 3, param: 32, curve: 'square' }, // Aquillow.env_release
|
|
{ voice_space: 4, param: 5, curve: 'square' }, // Magnetarch.paf0_bw
|
|
{ voice_space: 4, param: 8, curve: 'linear' }, // Magnetarch.paf0_vib
|
|
{ voice_space: 4, param: 9, curve: 'linear' }, // Magnetarch.paf1_vib
|
|
{ voice_space: 4, param: 11, curve: 'linear' }, // Magnetarch.paf0_vfr
|
|
{ voice_space: 4, param: 12, curve: 'linear' }, // Magnetarch.paf1_vfr
|
|
{ voice_space: 4, param: 17, curve: 'linear' }, // Magnetarch.dl1mix
|
|
{ voice_space: 4, param: 20, curve: 'linear' }, // Magnetarch.env_decay
|
|
{ voice_space: 4, param: 26, curve: 'linear' }, // Magnetarch.shape_gain
|
|
{ voice_space: 4, param: 27, curve: 'linear' }, // Magnetarch.shape_asym
|
|
{ voice_space: 4, param: 29, curve: 'linear' }, // Magnetarch.rm_gain
|
|
{ voice_space: 5, param: 8, curve: 'linear' }, // Elderstar.paf0_vib
|
|
{ voice_space: 5, param: 9, curve: 'linear' }, // Elderstar.paf1_vib
|
|
{ voice_space: 5, param: 11, curve: 'linear' }, // Elderstar.paf0_vfr
|
|
{ voice_space: 5, param: 12, curve: 'linear' }, // Elderstar.paf1_vfr
|
|
{ voice_space: 5, param: 14, curve: 'square' }, // Elderstar.paf0_shift
|
|
{ voice_space: 5, param: 17, curve: 'linear' }, // Elderstar.dl1mix
|
|
{ voice_space: 5, param: 18, curve: 'square' }, // Elderstar.p18
|
|
{ voice_space: 5, param: 19, curve: 'square' }, // Elderstar.dlfb
|
|
{ voice_space: 5, param: 21, curve: 'square' }, // Elderstar.p21
|
|
{ voice_space: 5, param: 22, curve: 'square' }, // Elderstar.p22
|
|
{ voice_space: 5, param: 23, curve: 'square' }, // Elderstar.p23
|
|
{ voice_space: 5, param: 26, curve: 'linear' }, // Elderstar.shape_gain
|
|
{ voice_space: 5, param: 27, curve: 'linear' }, // Elderstar.shape_asym
|
|
{ voice_space: 5, param: 29, curve: 'linear' }, // Elderstar.rm_gain
|
|
{ voice_space: 6, param: 8, curve: 'linear' }, // Ipeleiades.paf0_vib
|
|
{ voice_space: 6, param: 9, curve: 'linear' }, // Ipeleiades.paf1_vib
|
|
{ voice_space: 6, param: 11, curve: 'linear' }, // Ipeleiades.paf0_vfr
|
|
{ voice_space: 6, param: 12, curve: 'linear' }, // Ipeleiades.paf1_vfr
|
|
{ voice_space: 6, param: 14, curve: 'square' }, // Ipeleiades.paf0_shift
|
|
{ voice_space: 6, param: 17, curve: 'linear' }, // Ipeleiades.dl1mix
|
|
{ voice_space: 6, param: 18, curve: 'square' }, // Ipeleiades.p18
|
|
{ voice_space: 6, param: 21, curve: 'square' }, // Ipeleiades.p21
|
|
{ voice_space: 6, param: 22, curve: 'square' }, // Ipeleiades.p22
|
|
{ voice_space: 6, param: 23, curve: 'square' }, // Ipeleiades.p23
|
|
{ voice_space: 6, param: 26, curve: 'linear' }, // Ipeleiades.shape_gain
|
|
{ voice_space: 6, param: 27, curve: 'linear' }, // Ipeleiades.shape_asym
|
|
{ voice_space: 6, param: 29, curve: 'linear' }, // Ipeleiades.rm_gain
|
|
],
|
|
ui: {
|
|
primary_input: 'xy_pad',
|
|
show_voice_space_selector: true,
|
|
show_synth_visualizer: true,
|
|
},
|
|
};
|