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:
jimmyandClaude Haiku 5.5 committed 2026-11-17 07:16:51 +13:00
1 parent 8c783ab926
commit cb51a726bc
79 files changed
+5183 -934

No files matched your search

+9 -6
View File
@@ -38,17 +38,20 @@
}
/**
* Fit the room to a width x height canvas with one scale.
* @returns {object} {scale, sx(x), sy(y), mx(px), my(py)} metres -> px and back
* Fit the room to a width x height canvas with one scale, then zoom and pan it.
* @param zoom {z, x, y}: z scales about the room's centre (1 = fitted), x and y move it in canvas px.
* @returns {object} {scale, base, sx(x), sy(y), mx(px), my(py)} metres -> px and back
*/
function fit(room, width, height, margin = 28) {
const scale = Math.max(
function fit(room, width, height, margin = 28, zoom = {}) {
const base = Math.max(
1e-3,
Math.min((width - 2 * margin) / room.width, (height - 2 * margin) / room.depth),
);
const ox = width / 2;
const oy = height / 2 + (room.depth / 2) * scale;
const scale = base * (zoom.z || 1);
const ox = width / 2 + (zoom.x || 0);
const oy = height / 2 + (room.depth / 2) * scale + (zoom.y || 0);
return {
base,
scale,
sx: (x) => ox + x * scale,
sy: (y) => oy - y * scale,