Implements multi-mode footswitch system for the Helix Stadium-inspired pedal UI:
- Footswitch mode context provider with 4 modes: stomp, preset, snapshot, combo
- ModeSelector in status bar (collapsed cycling mode for mobile)
- Stomp mode: footswitches toggle individual blocks on/off, scribble strips show block name + status
- Preset mode: footswitches show Bank Up/Down + preset selection, scribble strips show preset name + number
- Snapshot mode: footswitches recall 8 snapshots, scribble strips show snapshot name
- Combo mode: first 4 stomp + bank nav + preset select + global bypass
- ScribbleStrip LCD component with LED indicator and double-tap support
- Double-tap gesture hook for secondary actions (tuner, snapshot save, etc.)
- FootswitchBar container with 8 capacitive-touch footswitch buttons and LED rings
- usePedalState hook (WebSocket + API polling, ported from frontend-react/App.jsx)
- Dark pedal theme CSS (Helix-inspired) with responsive mobile layout
- Full App.tsx rewrite with status bar, footswitch bar, tab bar, and all screens
Adds snapshot system to Helix Stadium:
Backend:
- Snapshot data model (8 slots per preset, captures block bypass
+ params + master volume)
- Snapshot API endpoints: list, save, recall, rename, delete
- Integrated into preset serialization/deserialization
- Tracks current_snapshot in state / WebSocket broadcasts
Frontend:
- Camera icon in header bar with current snapshot number
- SnapshotPanel as slide-up overlay
- 8 snapshot slots in a horizontal row
- Tap to recall filled snapshot, tap empty slot to save
- Press-and-hold (600ms) to save current state
- Inline name editing on tap
- Discard Edits toggle
- Green flash indicator on save
- Delete button for active snapshot
- New Preset button: finds first empty slot, saves with default name
- Looper/Recorder tab: Record/Stop via arecord backend, list captures, play back
- Rig: shows loaded IR name more clearly + quick-link buttons to browse IRs/Models
- Backend: capture/start, capture/stop, captures API endpoints with file serve
- Status bar: CPU load + sample rate from /api/state, TUNER badge shown immediately
- Rig: optimistic toggle updates (bypass/tuner respond instantly), prominent tuner card
- FX Chain: loads real block params from /api/block-params/{fx_type}, Add Block picker with all FX types
- Record: replaced fake multitrack with real Signal Monitor (live I/O VU, clip detect, level history)
- Backend: added _gather_system_stats() returning cpu_percent and sample_rate
- Added input_level and output_level to /api/state (scaled 0-100)
- React RigScreen now reads real levels from state instead of random walk
- When no audio flows, VU meters show flat (0) instead of fake animation
- New dark UI with 7 tabs: Rig, FX Chain, Models, IRs, Presets, Settings, Record
- All screens wired to live API endpoints
- Real-time state via WebSocket + polling fallback
- Models screen: list/load/unload/upload NAM files + Tone3000 search/install
- IRs screen: list/load/unload/upload IR files + Tone3000 search/install
- Presets screen: browse banks, activate, save, delete
- Settings screen: WiFi scan/connect/hotspot, Bluetooth/MIDI, 4CM routing
- Rig screen: live state, volume, bypass, tuner, signal chain
- FX Chain screen: block params, per-block bypass
- Serves at / instead of /ui
- Built with Vite, ~71KB gzipped
- tests/test_stability.py — 1-hour continuous DSP pipeline stability test
covering all 46 FX types with CPU/memory/NaN monitoring
- tests/test_integration.py — fixed test_midi_cc_maps_expression to use
correct _on_midi_cc(value, cc_number, channel) signature matching
the Phase 6 MIDI fix
Bug: PedalApp._on_midi_cc() received (value, channel) where channel was
the MIDI channel (0-15) but was treated as the CC number (0-127). The
register_cc callback only passes value + MIDI channel, not the CC number.
Fix: Use a lambda closure in _wire_midi_callbacks to capture the CC
number so _on_midi_cc gets (value, cc_number, channel). Moved expression
pedal (CC#11) check before the presets/pipeline guard so it works even
when no preset is active.
Tests: 21 new integration tests covering:
- CC lambda closure capturing correct CC numbers
- Expression pedal → master volume (CC#11)
- Full parse→dispatch→callback chain for PC and CC
- Preset MIDI mapping lookup by CC number
- Edge cases: min/max values, rapid switching, empty slots
Add UI_DIST_DIR auto-detection and /ui static mount in the
FastAPI server so the built React frontend is served alongside
the main dashboard.
- UI_DIST_DIR env var override
- Auto-detect common project layouts (frontend-react/dist,
pi-multifx-pedal-ui/dist)
- Mount with html=True for SPA client-side routing
- 17 net definitions (GND, +3.3V/+5V, BCK/LRCK/DIN/DOUT, audio signals)
- Net assignments to 35+ pads across all components (PCM1808, PCM5102A, TL072, AMS1117)
- 20 trace segments for I2S bus and audio signal routing
- 4 GND copper pour zones (F.Cu + B.Cu)
Uses string-based S-expression manipulation with proper parenthesis tracking.
The test_state_connected test timed out because _gather_bt_state calls real
bluetoothctl which hangs for 30s when no BT adapter is present. Since these
gathers depend on hardware (nmcli, bluetoothctl) that only exists on the Pi,
mock them in the test fixture so the test suite runs cleanly on any machine.
43/43 tests pass in 2.93s.
- TestAPIRouting: 7 tests covering get/set routing mode and breakpoint
- mock_pipeline now has a real set_routing side_effect that updates properties
- Covers connected/disconnected states, mode toggle, breakpoint change, both
- Add JackAudioClient class to src/system/audio.py — real-time JACK
client owning ports and a process callback that streams audio through
the DSP pipeline. Handles mono (1ch I/O) and stereo 4CM (2ch I/O).
- Wire PedalApp.boot(): read audio.mode from config, set pipeline
routing_mode (mono/4cm), create and start JackAudioClient with
matching channel count.
- Add PedalApp.set_routing_mode(mode) — hot-switch between mono and
stereo_4cm at runtime: updates pipeline.routing_mode, restarts JACK
client with new channel count via set_channel_count(), re-connects
JACK ports.
- Wire shutdown: stop JackAudioClient before MIDI/footswitch.
- Export JackAudioClient from src.system.__init__.
- 53 tests pass (22 integration + 31 audio).
Pipeline:
- process() dispatches to _process_mono() or _process_4cm() based on routing_mode
- _process_4cm() splits chain at routing_breakpoint: pre blocks on ch0, post on ch1
- _process_single_block() extracted for reuse in both mono and 4cm paths
- routing_mode/routing_breakpoint load from preset via load_preset()
- set_routing() for runtime configuration
- Properties: routing_mode (mono|4cm), routing_breakpoint with validation
Web server:
- GET /api/routing — current routing mode and breakpoint
- POST /api/routing — set routing mode/breakpoint, persist to current preset, WS broadcast
- _gather_state() includes routing_mode and routing_breakpoint
Web UI:
- Settings page: 4CM toggle + breakpoint slider with routing description
- Dashboard: routing badge (4CM/Mono) with breakpoint info
- app.js: WebSocket handler, updateRoutingUI(), toggle4cm(), set4cmBreakpoint()
- style.css: .badge, .badge-4cm, .badge-mono, .routing-status, .routing-desc
Tests: mock pipeline fixture updated with routing_mode/routing_breakpoint
- Add routing_mode (mono/4cm) and routing_breakpoint (default 7) to Preset
- Serialize/deserialize in _preset_to_dict / _preset_from_dict
- Backward compatible — old presets default to mono/7
- Add get_4cm_config() / set_4cm_config() helpers on PresetManager
- set_4cm_config validates mode and saves back to disk
- All 48 related tests pass (46 preset + 2 integration activation)
- Full FFT overlap-add IR convolution in IRLoader (process(), set_mix(), toggle)
- Lazy FFT computation — IR FFT padded to correct block+ir size on first process()
- Wet/dry mix control, enabled/disabled toggle with tail clearing
- Fixed pipeline._apply_ir_cab() to delegate to IRLoader.process() instead of
poking internals (old code had array-size mismatch bug: IR FFT at ir_len vs
block FFT at conv_size)
- 46 tests: loading, convolution correctness, overlap-add state, mix, toggle,
directory listing, performance budget (all <5ms even at 8192 taps), edge cases
- scripts/download_irs.sh: free IR pack downloader (God's Cab, Seacow)
- 15 FX blocks implemented with per-block state isolation
- All blocks <500us per 256-sample block (reverb closest at 465us on x86)
- 57 unit tests all passing (per-effect, chain, bypass, state isolation)
- Benchmark script at scripts/benchmark_fx.py
- Vectorised delay reads via read_block_varying()
- scipy.lfilter for EQ (3-band RBJ) and reverb damping
- Fixed _DelayLine.write_block wraparound crash for large blocks
- Comb/Allpass buffers sized to BLOCK_SIZE * 2 minimum