Add ParamPopup component with full parameter controls:
- Curve canvas with vertical drag to adjust response curve
- Dual min/max range sliders with visual fill bar
- Freeze/unfreeze toggle that captures current value
- Param override system in ML store with curve/range/freeze state
- 19 Playwright e2e tests covering VAL-PARAM-001 through VAL-PARAM-004
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
17 e2e tests covering thumbsUp example capture, sync train returning
finite loss, training convergence, async train via worker resolving to
finite loss, and loss history population. All existing and new tests pass.
- Implement undo stack (max 20 entries) in ML store with pushUndoSnapshot before thumbsDown/randomise
- Add undo() method that restores weights within 1e-4 tolerance and noise level
- Add reactive undoDepthSignal for UI button state tracking
- Add undo button to RLButtons component between thumbs-down and thumbs-up
- Update debug probe with undo method
- Add 17 e2e tests covering VAL-ML-003, VAL-ML-013, VAL-ML-014, VAL-CROSS-007
- Update architecture docs with undo stack and RLButtons details
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Build training drawer UI for milestone training-rl:
- Dock component with 6 icons (Train, Mode, Synth, NISPS, FX, Help)
- TrainingDrawer with Add Example, Train, Clear Ex, Clear All, Randomize
- StatusLine showing 'N examples · loss/noise' reactively
- Loss plot canvas with training history visualization
- ML store: add noiseLevel, exampleCountSignal, lastLossSignal, clearAll, addExample
- Debug probe: add clearAll() and getLossHistory() methods
- 22 Playwright e2e tests covering VAL-TRAIN-001 through VAL-TRAIN-009
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Create ML store wrapping dual WasmIML instances (imlJoy for joystick with
2 inputs, imlHand for hand tracking with 14 inputs) with warm-start weight
transfer on mode switch. Outputs stored as Float32Array signal. Mode switching
triggers MLP resize (visual=20, synth=126, midi-cc=8, audio-canvas=36).
Initial state: 0 examples, null loss, all outputs bounded [0,1].
Fulfills: VAL-ML-001, VAL-ML-002, VAL-ML-022
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
All validators passed: 35 e2e tests, TypeScript typecheck, lint.
Three features reviewed (f01, f02, f03) — all pass with no blocking issues.
Updated environment.md with WASM patterns, probe details, and platform notes.
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Extract window.__nisps debug probe into its own module (src/probe/debug-probe.ts)
with typed DebugProbe interface. Probe is only exposed when ?debug=1 is present.
Add 17 Playwright e2e tests validating VAL-PROJ-005 and VAL-PROJ-006, including
method enumeration, smoke tests for all 15 methods, and undefined check without debug flag.
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Add signal bus (src/bus/signal-bus.ts) with:
- Named topics using createSignal with equals:false for event semantics
- emit() triggers all subscribers even with identical data
- subscribe() returns unsubscribe function
- match() with wildcard patterns: * (single segment) and ** (multi-segment)
- Callable topic interface (topic() reads current value)
Wire bus into App.tsx, expose as window.__nispsBus for tests.
10 e2e tests covering all bus behaviors (VAL-PROJ-004).
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
- Vite config with COOP/COEP headers for SharedArrayBuffer
- SolidJS app renders at root URL without JS errors
- WASM ML engine loads and inference returns 126 bounded [0,1] outputs
- Debug probe (window.__nisps) exposed only with ?debug=1
- TypeScript strict mode with complete type coverage
- Playwright e2e tests (8 tests) for VAL-PROJ-001/002/003
- WasmIML TypeScript port from playground/js/nisps/nisps-wasm.js
- Dataset TypeScript port with FIFO ring buffer and sample weighting
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Add #shapeseq-container div with a canvas and chain mount point,
positioned above the bottom controls. Visible when ?shapeseq=1 is
set and synth mode is active.
Move the lazy AudioCanvas initialization above the outputCountForMode()
call in setOutputMode() so that the real output count is available
instead of the 12-output fallback.
Add serializeShapeSeqState/restoreShapeSeqState for complete ShapeSeq
state capture (chain config, primitive states, projection knobs, voice
mode, MLP weights, freeze state, clock config). SessionPresetManager
lazily imports the session module when a ShapeSeq engine is registered,
including ShapeSeq state in save/load without a hard dependency.
When frozen, param rows dim to indicate frozen state. Tapping a row
toggles it to "live" (highlighted, receives ML deltas). Unfreezing
clears all visual indicators.
Replace the inline chain builder with a full-screen slide-up drawer
(overlay + glass backdrop + drag handle). Param sliders now subscribe
to a vanilla signal (createArraySignal) for O(changed params) updates
instead of querySelectorAll sweeps. Card list uses keyed reconciliation.
Mono mode (default) kills the previous note before firing a new one —
classic monophonic synth behavior. Poly mode retriggers same-pitch
notes without killing others. All active notes are released on mode
switch.
Unified mode: a single MLP drives both timbre and sequence — the timbre
MLP's outputs are partitioned and a configurable slice feeds the
sequencer pipeline via setSequenceOutputsFromTimbre().
Dual mode (default): separate MLPs for timbre and sequence with
independent training. The sequencer owns its own IML instance.
Two freeze modes for capturing and preserving musical state:
- Algorithm freeze: snapshot all primitive params + seeds. Individual
params can be selectively unfrozen for ML-driven exploration via
DeltaController (applies MLP deltas to frozen base values with
per-param boundary enforcement).
- Pattern freeze: snapshot the realized note pattern. The sequencer
bypasses the primitive chain entirely and loops the frozen pattern.
Extracts _runPipeline() from setSequenceInputs() for reuse.
The dirty-check that skips re-evaluation when inputs haven't changed now
also checks a generation counter. Config changes (tempo, step count,
projection, chain edits) bump the counter, ensuring the pipeline re-runs
even when joystick position is static.
The sequence MLP output count is now configurable (default 16). Hidden
layer widths scale with the output count to keep inference cheap while
providing sufficient capacity. The sequencer exposes setOutputCount()
to resize the MLP at runtime.
Replace the composable transform chain (VelocityCurve, GateThreshold,
RangeMap, OctaveFolder, StutterMap, presets) with 3 straightforward
post-chain knobs: velocityCurve, gateThreshold, and pitchRange. The
old system was over-engineered for a research prototype — the new API
is easier to wire to UI controls and reason about.
PitchWalker was classified as a generator but always consumed the
incoming pattern's triggers. Reclassify as a processor so it modifies
the pattern produced by an upstream generator (clonePattern instead of
createPattern). Add reEvalOnLoop flag on the Primitive base class; when
set, the sequencer re-evaluates the chain at each loop start so
stateful primitives produce evolving patterns across loops.
Generators can now have independent step counts. When merging patterns
of different lengths, both are tiled to their LCM. Chain exposes
setGeneratorStepCount/getGeneratorStepCount for polyrhythmic control.
Replace the pitch*127 encoding hack with a dedicated midiNote field on
pattern steps. IntervalLock now writes integer MIDI notes to step.midiNote
while preserving the original [0,1] pitch for other consumers. The clock
and sequencer bridge pass midiNote through the event pipeline.
Also reworks mergePatterns to be trigger-aware: when only one generator
fires at a step, use its values directly instead of averaging with the
other generator's defaults.
The EventBus was duplicated inside shapeseq/ but is used by other
playground code too. Move the canonical implementation to js/event-bus.js
and turn the shapeseq copy into a re-export shim.
- Per-file loop count (0-4) with stepper UI on each waveform cell;
dynamic MLP output sizing (8 range + N_loops × 4 position outputs)
- Beat-synced loop length: global bars/beats selector (2/4/8/16/32/64)
with per-loop overrides via long-press dropdown, persistent badges
- Global param range groups: dual-thumb range sliders (volume, pitch,
position, filter) with ML-driven min/max and per-loop position mapping
- Pitch lock toggle (1×) to freeze playback rate across all submodes
- Fix: _resizeOutputs now syncs _loopOutputs to prevent stale reads
- Fix: granular visuals consolidated per-clip to prevent multi-loop flicker
Tests cover:
- Default state (C15, 126 params, heatmap cells)
- Engine switcher UI (3 cards, active state)
- Switch to Additive (48 params, outputs bounded, training works)
- Switch to FM Matrix (55 params, outputs bounded, training works)
- Round-trip switching (C15→Add→C15, C15→FM→Add→C15)
- Warm-start weight preservation across resize
- EOC chain accessibility across engines
- SynthVisualizer visibility across engines
- No console errors during any switch
Also fixes: faustJsonToParamMeta now filters [hidden:1] params,
giving correct counts (48 additive, 55 FM) instead of including
freq/gate/_vel control inputs.