From 8caf341d305167d3838dde1f6abd580e2731c32e Mon Sep 17 00:00:00 2001 From: jimmy Date: Fri, 23 Oct 2026 00:49:37 +1300 Subject: [PATCH] Point the back movers at the back wall at pan knob 0 in the test show. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit M3 and M4 are mounted 90° round from M1 and M2, so at pan 0 they face the middle. Knob 9 now drives a Pan slider for M1 and M2 over 0–212 and a Pan back slider for M3 and M4 over 43–255 (scripts/shows/mover_pan_back.py). The same span keeps the pairs 90° of pan apart all the way round: at knob 0 the front pair face the audience and the back pair the back wall, and the left and right pairs point at the centre and the side walls together. Co-Authored-By: Claude Opus 5.5 --- scripts/shows/mover_pan_back.py | 70 +++++++++++++++++++++++++++++++++ shows/test.qxw | 27 ++++++++++--- 2 files changed, 92 insertions(+), 5 deletions(-) create mode 100644 scripts/shows/mover_pan_back.py diff --git a/scripts/shows/mover_pan_back.py b/scripts/shows/mover_pan_back.py new file mode 100644 index 0000000..a74ecb0 --- /dev/null +++ b/scripts/shows/mover_pan_back.py @@ -0,0 +1,70 @@ +#!/usr/bin/env python3 +"""Split the movers' Pan slider in shows/test.qxw so the back pair face the back wall at knob 0. + +M3 and M4 are mounted 90° round from M1 and M2: at pan 0 the front pair face +the audience and the back pair face the middle. Knob 9 (CC 38) now drives two +sliders over the same span of 212 steps, so the pairs keep that 90° of pan +(about 43 steps of 540°) between them all the way round: + + Pan M1, M2 0–212 + Pan back M3, M4 43–255 + +At knob 0 the front pair face the audience and the back pair the back wall. +Turning it, the left pair (M1, M3) and the right pair (M2, M4) point at the +centre together and at the side walls together. + + python3 scripts/shows/mover_pan_back.py + +Run it once on a show without it; it stops if it is already there. +QLC+ has to reopen the show to see it. +""" + +from __future__ import annotations + +import re + +from mover_bank import M1, M2, M3, M4, NO_FUNCTION, ROOT + +SHOW = ROOT / "shows" / "test.qxw" + +BACK_OFFSET = 43 # 90° of pan, of 540° over 256 steps +ORDER = ("Brightness", "Pan", "Pan back", "Tilt", "Focus", "Rotate") + + +def main() -> None: + xml = SHOW.read_text() + if 'Caption="Pan back"' in xml: + raise SystemExit(f"{SHOW.relative_to(ROOT)} already has the back movers' pan") + wid = max(int(i) for i in re.findall(r' ID="(\d+)"', xml.split("")[1]) + if int(i) != NO_FUNCTION) + 1 + start = xml.index('", start) + frame = xml[start:end] + + pan = re.search(r' \n', frame, re.S).group(0) + level = re.search(r'', pan).group(0) + + def rows(*fixtures: int) -> str: + return "".join(f' 0\n' for f in fixtures) + + channels = rows(M1, M2, M3, M4) + assert channels in pan + front = (pan.replace(level, f'') + .replace(channels, rows(M1, M2))) + back = (re.sub(r'Caption="Pan" ID="\d+"', f'Caption="Pan back" ID="{wid}"', pan) + .replace(level, f'') + .replace(channels, rows(M3, M4))) + frame = frame.replace(pan, front + back) + + # Six sliders 58 apart fit the frame as it is. + for i, caption in enumerate(ORDER): + frame, n = re.subn(rf'(]*>\n\s*{5 + 58 * i}"', frame) + assert n == 1, caption + + SHOW.write_text(xml[:start] + frame + xml[end:]) + print(f"Split the movers' Pan in {SHOW.relative_to(ROOT)} (Pan back is widget {wid})") + + +if __name__ == "__main__": + main() diff --git a/shows/test.qxw b/shows/test.qxw index 34a70da..618771d 100644 --- a/shows/test.qxw +++ b/shows/test.qxw @@ -3171,7 +3171,7 @@ - + Sunken Default @@ -3181,9 +3181,26 @@ Level - + 0 0 + + + 4294967295 + + + + + + Sunken + Default + Default + None + Default + + + Level + 0 0 @@ -3192,7 +3209,7 @@ - + Sunken Default @@ -3213,7 +3230,7 @@ - + Sunken Default @@ -3234,7 +3251,7 @@ - + Sunken Default