From c3fe965e7951abf77bb05cbcfbf5cb41825150a8 Mon Sep 17 00:00:00 2001 From: jimmy Date: Fri, 23 Oct 2026 01:47:05 +1300 Subject: [PATCH] Add Circle and Sweep for the movers to the test show. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit They fill the movers layer's top row, pads 15 and 16 (notes 98 and 99), in the Movement solo frame with Wander and Ballyhoo: a circle of about ±45° of pan and ±21° of tilt, and a straight pan sweep of about ±60°, both mirrored and relative to the knobs. Knob 13's speed dial gives them a quarter of its time, 5.5 s a round to start with (scripts/shows/mover_more_efx.py). The pad controller settles the knobs after them too. Co-Authored-By: Claude Opus 5.5 --- padcontroller/layer.py | 8 +- padcontroller/midi.py | 8 +- scripts/shows/mover_more_efx.py | 102 ++++++++++++++++++++++++ shows/test.qxw | 132 +++++++++++++++++++++++++++++++- tests/test_pad_layer.py | 8 ++ 5 files changed, 249 insertions(+), 9 deletions(-) create mode 100644 scripts/shows/mover_more_efx.py diff --git a/padcontroller/layer.py b/padcontroller/layer.py index c0b96ba..eb81830 100644 --- a/padcontroller/layer.py +++ b/padcontroller/layer.py @@ -36,9 +36,9 @@ cans, 68–83 for the movers), or None once it is pressed again: the colour buttons toggle in a solo frame. QLC+ does not save which buttons are on, so reopen() presses them again when QLC+ loads the show. -The movers' Wander and Ballyhoo pads (notes 96 and 97, pads 13 and 14 on the -movers layer) each toggle a relative EFX around the Pan and Tilt knobs (9 and 10, -CC 38 and 39). They share a solo frame in QLC+, so starting one stops the other. +The movers' Wander, Ballyhoo, Circle and Sweep pads (notes 96–99, pads 13–16 on +the movers layer) each toggle a relative EFX around the Pan and Tilt knobs (9 and +10, CC 38 and 39). They share a solo frame in QLC+, so starting one stops the others. QLC+ 4.12 leaves an EFX's last offset on the movers when it stops, until those sliders change, so when the one that is on goes off, settle asks for the two knobs one step off and then back (nudge() and positions()). Swapping needs @@ -62,7 +62,7 @@ SUBMASTER_CC = 100 KNOB_CHANNEL = 0 PEAK_CC = 35 # knob 6 SIDE_CCS = (34, 37) # knobs 5 and 8: Cans 9–15 and Cans 1, 2, 7, 8 -RELATIVE_NOTES = (96, 97) # Wander and Ballyhoo, pads 13 and 14 on the movers layer +RELATIVE_NOTES = (96, 97, 98, 99) # Wander, Ballyhoo, Circle, Sweep: pads 13–16 on the movers layer POSITION_CCS = (38, 39) # knobs 9 and 10: the movers' Pan and Tilt diff --git a/padcontroller/midi.py b/padcontroller/midi.py index 0fe6ac8..be4ca06 100644 --- a/padcontroller/midi.py +++ b/padcontroller/midi.py @@ -19,9 +19,9 @@ 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 or Ballyhoo 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). +When the movers' Wander, Ballyhoo, Circle or Sweep 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 @@ -228,7 +228,7 @@ def main() -> None: load_colours(layer) saved_colours = dict(layer.colours) reopen_at: float | None = None - # (when, messages to send then), for the Wander and Ballyhoo settle + # (when, messages to send then), for the settle after a mover EFX 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 diff --git a/scripts/shows/mover_more_efx.py b/scripts/shows/mover_more_efx.py new file mode 100644 index 0000000..c70267f --- /dev/null +++ b/scripts/shows/mover_more_efx.py @@ -0,0 +1,102 @@ +#!/usr/bin/env python3 +"""Add Circle and Sweep for the movers to shows/test.qxw, on notes 98 and 99. + +They fill the top row of the movers layer after Wander and Ballyhoo, in the same +Movement solo frame, so only one of the four runs at a time. Like them, each is +a relative EFX around wherever the Pan and Tilt knobs (9 and 10) put the movers: + + 98 Circle pad 15 a circle about ±45° of pan and ±21° of tilt + 99 Sweep pad 16 a straight pan sweep, about ±60° side to side + +All four movers start together, so the pairs mirror left to right and front to +back as in Ballyhoo. Each fades in over 0.5 s. Knob 13's Movers speed dial gives +them a quarter of its time, less the fade-in that QLC+ counts in each round: +5.5 s a round to start with, from 15.5 s fully left to 2.5 s fully right. +padcontroller/layer.py settles the knobs after them too. + + python3 scripts/shows/mover_more_efx.py + +Run it once on a show with the Movement solo frame and the Movers speed dial; +it stops if Circle is already there. QLC+ has to reopen the show to see it. +""" + +from __future__ import annotations + +import re + +from mover_bank import LEFT_TO_RIGHT, NO_FUNCTION, ROOT, button, note + +SHOW = ROOT / "shows" / "test.qxw" + +FADE_IN_MS = 500 +START_MS = 6000 # a quarter of the speed dial's starting 24 s +TIMES_1_4 = 4 # speed dial factor index: (Not Sent), 0, 1/16, 1/8, 1/4, ... +SIZE = 90 + +# Caption, function name, algorithm, width, height (of 255 each way), can note, column +MOVES = ( + ("Circle", "Movers circle", "Circle", 21, 20, 50, 2), + ("Sweep", "Movers sweep", "Line", 28, 0, 51, 3), +) + + +def efx(fid: int, name: str, algorithm: str, width: int, height: int) -> str: + fixtures = "".join(f""" + {f} + 0 + 0 + Forward + 0 + +""" for f in LEFT_TO_RIGHT) + axes = "".join(f""" + 127 + 1 + 0 + +""" for axis in "XY") + # Relative: the EFX adds its offset from 127 to the Pan and Tilt sliders' levels. + return f""" +{fixtures} Parallel + + Forward + Loop + {algorithm} + {width} + {height} + 0 + 0 + 1 +{axes} +""" + + +def main() -> None: + xml = SHOW.read_text() + if 'Name="Movers circle"' in xml: + raise SystemExit(f"{SHOW.relative_to(ROOT)} already has the movers circle") + engine, console = xml.split("") + fid = max(int(i) for i in re.findall(r'\n.*? \n', xml, re.S).group(0) + dial = re.search(r' \n.*? \n', xml, re.S).group(0) + functions, buttons, rows = "", "", "" + for i, (caption, name, algorithm, width, height, can_note, column) in enumerate(MOVES): + functions += efx(fid + i, name, algorithm, width, height) + buttons += button(wid + i, caption, SIZE * column, 0, SIZE, fid + i, note(can_note), indent=" ") + rows += f' {fid + i}\n' + + columns = 2 + len(MOVES) + grown = re.sub(r'({SIZE * columns}"', solo, count=1) + grown = grown.replace(" \n", buttons + " \n") + xml = xml.replace(solo, grown, 1) + xml = xml.replace(dial, dial.replace(" \n", rows + " \n"), 1) + xml = xml.replace(" ", functions + " ", 1) + SHOW.write_text(xml) + print(f"Added Circle and Sweep to {SHOW.relative_to(ROOT)} (functions {fid}–{fid + len(MOVES) - 1}, " + f"widgets {wid}–{wid + len(MOVES) - 1})") + + +if __name__ == "__main__": + main() diff --git a/shows/test.qxw b/shows/test.qxw index 9a3c69f..dd95130 100644 --- a/shows/test.qxw +++ b/shows/test.qxw @@ -970,6 +970,106 @@ 0 + + + 17 + 0 + 0 + Forward + 0 + + + 8 + 0 + 0 + Forward + 0 + + + 9 + 0 + 0 + Forward + 0 + + + 18 + 0 + 0 + Forward + 0 + + Parallel + + Forward + Loop + Circle + 21 + 20 + 0 + 0 + 1 + + 127 + 1 + 0 + + + 127 + 1 + 0 + + + + + 17 + 0 + 0 + Forward + 0 + + + 8 + 0 + 0 + Forward + 0 + + + 9 + 0 + 0 + Forward + 0 + + + 18 + 0 + 0 + Forward + 0 + + Parallel + + Forward + Loop + Line + 28 + 0 + 0 + 0 + 1 + + 127 + 1 + 0 + + + 127 + 1 + 0 + + @@ -2478,7 +2578,7 @@ None Default - + True True False @@ -2514,6 +2614,34 @@ 100 + +