Add a Wander pad for the movers to the test show.

Pad 10 on the movers layer (note 93) toggles a relative EFX that drifts all
four movers around the Pan and Tilt knobs: a 24 s Lissajous of about ±30° pan
and ±10° tilt, each mover a quarter of the way further round, easing in over
2 s (scripts/shows/mover_wander.py).

QLC+ 4.12 leaves a relative EFX's last offset on the movers when it stops,
until the sliders under it change. So when Wander goes off, the pad
controller nudges the Pan and Tilt knobs a step and puts them back, 0.1 s
apart.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
jimmyandClaude Opus 5.5 committed 2026-10-23 00:49:33 +13:00
1 parent f8c8cea3ef
commit 00c8c2d35d
5 files changed
+213

No files matched your search

+15
View File
@@ -19,6 +19,10 @@ the pad controller runs means the show has just loaded with every button off.
REOPEN_DELAY later it presses the last colour pads again (see PlayLayer.colours),
which it keeps in COLOURS_FILE so they outlive a restart of the pad controller.
When the movers' Wander pad goes off, SETTLE_DELAY later it nudges the Pan and
Tilt knobs a step and puts them back, so QLC+ drops the EFX's last offset
(see PlayLayer.settle).
Usage:
.venv/bin/python -m padcontroller.midi
# optional: --tau 0.05 (seconds; lower = snappier, higher = silkier)
@@ -39,6 +43,7 @@ import threading
import time
from dataclasses import dataclass, field
from pathlib import Path
from typing import Callable
ROOT = Path(__file__).resolve().parents[1]
import glob
@@ -56,6 +61,7 @@ from pad_lamps import set_lamps, set_sound_lamps # noqa: E402
VIRTUAL_NAME = "padcontroller"
COLOURS_FILE = Path(os.environ.get("XDG_STATE_HOME", Path.home() / ".local" / "state")) / "padcontroller" / "colours.json"
REOPEN_DELAY = 1.5 # s for QLC+ to finish loading the virtual console
SETTLE_DELAY = 0.1 # s for QLC+ to stop the Wander EFX before the knob nudge, and between its two steps
# Bluetooth first when the pad is paired, USB otherwise.
SOURCE_HINTS = (
"SMC-PAD Bluetooth",
@@ -222,6 +228,8 @@ def main() -> None:
load_colours(layer)
saved_colours = dict(layer.colours)
reopen_at: float | None = None
# (when, messages to send then), for the Wander settle
later: list[tuple[float, Callable[[], list[list[int]]]]] = []
# Links made this soon after start are ours being restored, with QLC+'s buttons as they were.
reopen_from = time.monotonic() + 5.0
@@ -289,6 +297,13 @@ def main() -> None:
midiout.send_message(out)
if sound_lamps:
sound_lamps.show(layer.pump, layer.threshold)
if layer.settle:
layer.settle = False
later += [(now + SETTLE_DELAY, layer.nudge), (now + 2 * SETTLE_DELAY, layer.positions)]
for due in [item for item in later if now >= item[0]]:
later.remove(due)
for out in due[1]():
midiout.send_message(out)
if layer.colours != saved_colours:
save_colours(layer)
saved_colours = dict(layer.colours)