Phase 1 group 2 (L27, L26, L28, S21, L13, ST6, S20). - L27: fixed_buffer.hpp + its test + the CMake entry — no consumers. - L26: dislike_multiplier_ and its doubling/halving bookkeeping — upstream InterfaceRL residue that drove nothing. The audit pointed at the wrong test file for the surviving reference; the actual assert was in test_mlp_geo_dislike.cpp:211, removed here. - L28: added copy_weights_to(std::span<float>) to FixedStorage and DynamicStorage and switched feedback.hpp's take_snapshot/push_undo/nudge to it. Drops the permanent whole-net flat_ scratch buffer from FixedStorage and the per-gesture double copy. Behaviour-identical: same source values, same write order, same RNG draw order in nudge(). - S21 + L13: deleted NISPS_AUDIO_MEM / NISPS_APP_SRAM / NISPS_AUDIO_FUNC — zero use sites outside perf.hpp and comments — and rewrote midi_io.hpp's one misshapen NISPS_AUDIO_FUNC use as a plain `inline void`. perf.hpp now documents only the inlining/hotness macros that actually exist, and audio_driver.hpp no longer claims an SRAM discipline the code never had. - ST6: feedback.hpp's header now describes the four current modes and the Geometric default, dropping the retracted "geometric push NOT ported" claim. S20 — OPERATOR DECISION (§7.1): the four legacy feedback behaviours (RandomiseOutputs, RandomiseMlp, AvoidStyle::Diffuse, the RandomiseMlp branch of on_drag) are KEPT, not deleted. They are wanted as building blocks for experimenting with how different instruments feel under different behaviours. Each is now marked at its definition as deliberately-retained research reserve so future audits stop flagging it as dead code. L25 (the 16 KB firmware loss-history buffer) is NOT done here — see the phase report; it turned out to be coupled into the shared mlp.hpp, and its fate belongs with the browser telemetry build (§7.3 / plan §6.5e). Gates: run-all-tests.sh ALL GREEN. |
||
|---|---|---|
| .. | ||
| MEMLNaut-NISPS | ||
| useq-celium | ||
| README.md | ||
firmware/ — Arduino sketch + hardware glue
Thin shell around nisps/. The platform-agnostic ML / DSP / engines / modes live there; this directory contains:
MEMLNaut-NISPS.ino— entry point. Picks one mode at compile time, hosts the dual-core lifecycle (Core 0: ML + UI, Core 1: audio + MIDI), and connects glue to mode.glue/audio_driver.hpp— bridges memllib'sAudioDriverblock callback toMode::process(stereosample_t). Templated trampoline so no virtual dispatch in audio path.glue/peripherals.hpp— wires MEMLNaut joystick / pots / buttons toMode::set_input(idx, value)and the ML primitives (draw_weights,move_weights,train,reset).glue/midi_io.hpp— binds incoming MIDI tomode.note_on/note_off/update_bpm/set_playing(where supported); drains outgoingControlEvents from the mode's ring buffer to the MIDI UART.glue/input_router.hpp—wire_inputs()entry point, currently a thin re-export over peripherals. Will grow into a schema-aware router.glue/output_router.hpp— drains engine events + mode events; called fromloop1().glue/mode_select.hpp— type aliases mappingMEMLNautMode<Name>identifiers tonisps::modes::<Name>ModeC++ types. Build script rewritesMEMLNAUT_MODE_TYPEbetween the alternatives.
Building
scripts/build-firmware.sh # interactive variant prompt
scripts/build-firmware.sh PAFSynth # build a specific variant
scripts/build-and-flash-firmware.sh # build + flash via UF2
Target: rp2040:rp2040:solderparty_rp2350_stamp_xl:opt=Optimize3 with compiler.cpp.extra_flags=-std=gnu++20.
Include paths
Arduino-CLI compiles every *.cpp / *.hpp reachable from the sketch directory and from any submodule under src/. Headers under nisps/ are included via relative path (#include "../../nisps/..."). No -I flag injection needed.
src/memllib and src/daisysp are git submodules; the firmware-common.sh wrapper rejects builds when submodules drift from the recorded revision.
Verification
You cannot test on hardware from a sandbox. We verify three things:
arduino-cli compilesucceeds for at least three modes (PAFSynth, ChannelStrip, BreakOr).- Host C++ tests in
nisps/buildstill pass — the firmware refactor must not perturb the platform-agnostic library. git grepconfirms no remaining references to deleted root-level files.
Removed
- Root-level
MEMLNaut-NISPS.ino,IMLInterface.hpp,*AudioApp.hpp,XiasriAnalysis.{cpp,hpp}— replaced bynisps/engines/*andfirmware/MEMLNaut-NISPS.ino. - Root-level
modes/MEMLNautMode*.hppandmodes/AudioApps/— replaced bynisps/modes/*and themode_select.hpptype aliases. - Root-level
voicespaces/— replaced by static voice space data inlined into engines (nisps/engines/paf_synth.hppetc.). src/memlp/submodule — replaced bynisps/ml/.