#!/usr/bin/env python3 """Add a Wander pad for the movers to shows/test.qxw, on note 93. On the movers layer (Pause on), pad 10 toggles a slow relative EFX that drifts all four movers around wherever the Pan and Tilt knobs (9 and 10, CC 38 and 39) put them, so turning the knobs moves the middle of the wander: 93 Wander a Lissajous about ±30° of pan and ±10° of tilt, 22 s round Each mover starts a quarter of the way further round, so they don't move as one. It fades in over 2 s, so the movers ease off the knob position. QLC+ counts the fade-in inside each 24 s round, which leaves 22 s. QLC+ 4.12 leaves a relative EFX's last offset on the movers when it stops (with or without a fade-out), so the pad controller nudges the two knobs when Wander goes off (padcontroller/layer.py). python3 scripts/shows/mover_wander.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 LEFT_TO_RIGHT, NO_FUNCTION, ROOT, button, note SHOW = ROOT / "shows" / "test.qxw" WIDTH, HEIGHT = 14, 10 # of 255 each way: 540° of pan, 270° of tilt ROUND_MS = 24000 FADE_IN_MS = 2000 def efx(fid: int) -> str: fixtures = "".join(f""" {f} 0 0 Forward {90 * i} """ for i, f in enumerate(LEFT_TO_RIGHT)) # Relative: the EFX adds its offset from 127 to the Pan and Tilt sliders' levels. return f""" {fixtures} Parallel Forward Loop Lissajous {WIDTH} {HEIGHT} 0 0 1 127 3 90 127 2 0 """ def main() -> None: xml = SHOW.read_text() if 'Name="Movers wander"' in xml: raise SystemExit(f"{SHOW.relative_to(ROOT)} already has the movers wander") engine, console = xml.split("") fid = max(int(i) for i in re.findall(r'", efx(fid) + " ", 1) # Beside the movers' Strobe, where Strobe 2 sits on the cans' layer. strobe = re.search(r' \n', xml, re.S).group(0) xml = xml.replace(strobe, strobe + button(wid, "Wander", 100, 100, 90, fid, note(45)), 1) SHOW.write_text(xml) print(f"Added the movers wander to {SHOW.relative_to(ROOT)} (function {fid}, widget {wid})") if __name__ == "__main__": main()