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

+87
View File
@@ -0,0 +1,87 @@
#!/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, 24 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+ 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""" <Fixture>
<ID>{f}</ID>
<Head>0</Head>
<Mode>0</Mode>
<Direction>Forward</Direction>
<StartOffset>{90 * i}</StartOffset>
</Fixture>
""" 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""" <Function ID="{fid}" Type="EFX" Name="Movers wander">
{fixtures} <PropagationMode>Parallel</PropagationMode>
<Speed FadeIn="{FADE_IN_MS}" FadeOut="0" Duration="{ROUND_MS}"/>
<Direction>Forward</Direction>
<RunOrder>Loop</RunOrder>
<Algorithm>Lissajous</Algorithm>
<Width>{WIDTH}</Width>
<Height>{HEIGHT}</Height>
<Rotation>0</Rotation>
<StartOffset>0</StartOffset>
<IsRelative>1</IsRelative>
<Axis Name="X">
<Offset>127</Offset>
<Frequency>3</Frequency>
<Phase>90</Phase>
</Axis>
<Axis Name="Y">
<Offset>127</Offset>
<Frequency>2</Frequency>
<Phase>0</Phase>
</Axis>
</Function>
"""
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("<VirtualConsole>")
fid = max(int(i) for i in re.findall(r'<Function ID="(\d+)" Type', engine)) + 1
wid = max(int(i) for i in re.findall(r' ID="(\d+)"', console) if int(i) != NO_FUNCTION) + 1
xml = xml.replace(" </Engine>", efx(fid) + " </Engine>", 1)
# Beside the movers' Strobe, where Strobe 2 sits on the cans' layer.
strobe = re.search(r' <Button Caption="Strobe" ID="89" Icon="">\n.*? </Button>\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()