From 31ccbab3407c0b02a4f03b04d4e7e0c65519a0e7 Mon Sep 17 00:00:00 2001 From: jimmy Date: Fri, 23 Oct 2026 13:57:27 +1300 Subject: [PATCH] Make a click on a cans chase button run the whole chase in the test show. Each chase was two buttons on one pad note: the pads frame's ran the side dimmer hold under Peak, and the Chase runs frame's ran the stripe outside it. The pad pressed both; a click pressed only the hold, which lit nothing. Now the pads frame's button runs a hold of the chase's own whose step is the Sides dimmer and a Script that starts the stripe. Peak reaches the dimmer through the chaser and collection but not the stripe through the script, as with the pad (scripts/shows/chase_clicks.py). The Chase runs buttons no longer listen to the pad. Co-Authored-By: Claude Opus 5.5 --- scripts/shows/chase_clicks.py | 106 ++++++++++++++++++++++++++++++++++ shows/test.qxw | 88 +++++++++++++++++++++++----- 2 files changed, 178 insertions(+), 16 deletions(-) create mode 100644 scripts/shows/chase_clicks.py diff --git a/scripts/shows/chase_clicks.py b/scripts/shows/chase_clicks.py new file mode 100644 index 0000000..1b67fcb --- /dev/null +++ b/scripts/shows/chase_clicks.py @@ -0,0 +1,106 @@ +#!/usr/bin/env python3 +"""Make a click on a chase button in shows/test.qxw do what its pad does. + +Each cans chase was two buttons on one pad note: the pads frame's button runs +the side dimmer hold, under the frame's Peak (CC 35), and the Chase runs frame's +button runs the stripe matrix, outside it, so Peak caps the dimmers and not the +stripe's colour. The pad pressed both; a click pressed only the hold. + +Now the pads frame's button runs a hold of the chase's own, which runs both. +Its one step is a collection of the Sides dimmer scene and a Script that starts +the stripe and waits. A chaser and a collection pass Peak on to what they run, +but a script doesn't, so the dimmers are capped and the stripe isn't, as with +the pad. QLC+ 4.12 stops what a script started when the script ends (it has no +stoponexit), so the script waits until the hold's step ends and the chaser stops +it; the stripe has run its course by then. The holds are on the Speed dial (knob +1) as the shared ones were. The Chase runs buttons no longer listen to the pad, +which would otherwise toggle the stripe straight back off; clicked, they still +run the stripe on its own. + + python3 scripts/shows/chase_clicks.py + +Run it once; it stops if the chases' own holds are already there. QLC+ has to +reopen the show to see it. +""" + +from __future__ import annotations + +import re + +from mover_bank import ROOT + +SHOW = ROOT / "shows" / "test.qxw" +SPEED_DIAL = 111 # the cans' Speed dial, knob 1 +SIDES_DIMMER = 44 # the Sides dimmer scene the shared holds run +WAIT_MS = 3600000 # longer than any hold: the chaser stops the script first + +# pads frame button, Chase runs button, collection, stripe matrix, shared hold +CHASES = ( + ("Chase forward", 45, 79, 46, 43, 45), + ("Chase reverse", 46, 80, 48, 47, 45), + ("Zigzag forward", 47, 81, 51, 49, 50), + ("Opposing zigzag", 48, 82, 53, 52, 45), +) + + +def script(fid: int, name: str, start: int) -> str: + return f""" + + Forward + SingleShot + startfunction%3A{start} + wait%3A{WAIT_MS} + +""" + + +def main() -> None: + xml = SHOW.read_text() + if any(f'Name="{name} hold"' in xml for name, *_ in CHASES): + raise SystemExit(f"{SHOW.relative_to(ROOT)} already has the chases' own holds") + next_fid = max(int(i) for i in re.findall(r'.*? \n', xml, re.S) + if dial is None: + raise SystemExit("Couldn't find the Speed dial") + new_dial = dial.group(0) + functions = "" + for k, (name, pad_button, run_button, coll, stripe, hold) in enumerate(CHASES): + sid, hid = next_fid + 2 * k, next_fid + 2 * k + 1 + functions += script(sid, f"{name} start", stripe) + + # The chase's own hold: the shared one, running the dimmer and the stripe's script. + shared = re.search(rf' \n.*? \n', xml, re.S).group(0) + if f">{SIDES_DIMMER}" not in shared: + raise SystemExit(f"Hold {hold} doesn't run the Sides dimmer") + own = re.sub(r'', + f'', shared) + functions += own.replace(f">{SIDES_DIMMER}", f">{coll}") + row = re.search(rf' {hold}\n', new_dial) + if row is None: + raise SystemExit(f"Hold {hold} isn't on the Speed dial") + new_dial = new_dial.replace(" \n", row.group(0).replace(f">{hold}<", f">{hid}<") + " \n") + + old = re.search(rf' \n.*? \n', xml, re.S) + if old is None or f">{stripe}" not in old.group(0) or f">{hold}" not in old.group(0): + raise SystemExit(f"The {name} collection is not the stripe and hold it was") + xml = xml.replace(old.group(0), f' \n' + f' {SIDES_DIMMER}\n {sid}\n \n', 1) + + btn = re.search(rf' @@ -4011,6 +4063,10 @@ 99 101 102 + 105 + 107 + 109 + 111