feat: pattern gallery as a preset editor; chase steps; sim split with the preset editor
- Pattern gallery shows the controller's presets, one at a time, with a dropdown, Save, Add preset, and the controller's field labels, delay limits and colour counts. Edits show in the preview; Save writes to the controller only. - Presets are always timed in ms (beat_time is no longer sent to drivers); beats stay in sequences. - Chase steps of 0 hold still; the marquee style is removed from the controller, the gallery and the driver (submodule commit 12a8e22). - The rig's split pane opens the preset editor too (Rig / Presets switch and a Preset editor menu entry). - Sequence editor, room layout and simulator controls from earlier work are included. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
8c783ab926
commit
cb51a726bc
79 files changed
+5183
-934
No files matched your search
+3
-3
@@ -98,7 +98,7 @@ A store with no profile gets one at boot, `default`, with the same seed, a start
|
||||
|
||||
## Presets — `/presets`
|
||||
|
||||
A preset has `name`, `pattern`, `colors` (`#RRGGBB`), `brightness`, `delay`, `n1`–`n8`, `profile_id`, and optionally `auto`, `palette_refs` (palette index per colour slot), `background` / `background_palette_ref`, `mode` (sent as `n6`), `manual_beat_n`, `fade` (0–10000 ms: crossfade from what the strip showed when the preset is selected) and `beat_time` (`true`: the delay and timing parameters of patterns that support it count quarter beats, so the preset follows the tempo). New presets start with every field set and belong to the current profile.
|
||||
A preset has `name`, `pattern`, `colors` (`#RRGGBB`), `brightness`, `delay`, `n1`–`n8`, `profile_id`, and optionally `auto`, `palette_refs` (palette index per colour slot), `background` / `background_palette_ref`, `mode` (sent as `n6`), `manual_beat_n`, `fade` (0–10000 ms: crossfade from what the strip showed when the preset is selected). New presets start with every field set and belong to the current profile.
|
||||
|
||||
**Animation patterns** (driver patterns, labels in `/patterns`). Each plays once with `auto: false` and holds its end state; with `auto: true` it repeats.
|
||||
- One-shots: `hit` (flash with attack, hold and decay), `keyframes` (ramp through the colours with easing).
|
||||
@@ -307,7 +307,7 @@ On connect the controller sends `{"type": "device_tcp_snapshot", "connected_ips"
|
||||
The UI, `/presets/push`, `/ws` and the controller itself send drivers **v1 messages**: JSON objects with `"v": "1"`. The controller does not send them as they are:
|
||||
- **Binary envelope.** A message that only carries presets, a select, brightness, `save` and `groups` goes out as a compact binary envelope (`main/envelope.c`, mirrored by `test/binary_envelope.py`).
|
||||
- Version 2 is the usual frame.
|
||||
- A frame whose presets use `fade` or `beat_time` is version 3: each preset record is followed by `[ext_len][key, len, value]…`, with key 1 the fade ms (u16) and key 2 the beat timing (u8).
|
||||
- A frame whose presets use `fade` is version 3: each preset record is followed by `[ext_len][key, len, value]…`, with key 1 the fade ms (u16).
|
||||
- Drivers skip keys they don't know. Drivers without v3 support ignore v3 frames, so they miss only presets that use the new fields.
|
||||
- **JSON.** Any other message goes as JSON with short keys, split across several messages when it does not fit one ESP-NOW frame. A preset with a background colour (`bg`) is one of these: the envelope has no field for it.
|
||||
- **Delivery.** Broadcasts are never acked (envelopes go out twice, JSON once); drivers that miss a state change notice from the state digest and ask to be brought up to date. Messages with `targets` are unicast to each MAC, acked and retried.
|
||||
@@ -327,7 +327,7 @@ The UI, `/presets/push`, `/ws` and the controller itself send drivers **v1 messa
|
||||
| `manifest` | `mf` | Pattern files to fetch (Wi-Fi drivers) |
|
||||
| `b` | | Driver brightness 0–255 |
|
||||
|
||||
Preset fields: `p`/`pattern`, `c`/`colors` (`#RRGGBB`), `d`/`delay` (ms, default 100), `b`/`brightness` (0–255), `a`/`auto` (`true` runs freely, `false` steps once per beat), `bg`/`background`, `n1`–`n6` (pattern parameters; `n5` is reverse, `n6` the style mode), `f`/`fade`, `tb`/`beat_time`. Other fields (`name`, `manual_beat_n`, …) are dropped on the way out.
|
||||
Preset fields: `p`/`pattern`, `c`/`colors` (`#RRGGBB`), `d`/`delay` (ms, default 100), `b`/`brightness` (0–255), `a`/`auto` (`true` runs freely, `false` steps once per beat), `bg`/`background`, `n1`–`n6` (pattern parameters; `n5` is reverse, `n6` the style mode), `f`/`fade`. Presets are always timed in ms; beats are for sequences only. Other fields (`name`, `manual_beat_n`, …) are dropped on the way out.
|
||||
|
||||
Sending `select` again with the same preset is a beat for that preset. Selecting `off` resets the step, so the next select starts every driver at step 0 unless a step is given.
|
||||
|
||||
|
||||
Reference in new issue
Block a user