A Movers speed dial on knob 13 (CC 42), beside the cans' Speed dial, sets how long Wander takes to go round and gives Ballyhoo an eighth of it (scripts/shows/mover_speed.py). QLC+ 4.12 counts an EFX's fade-in inside every round, so Wander has been taking 22 s and Ballyhoo 2.5 s, not 24 s and 3 s. The dial keeps those as its starting point and runs from 62 s and 7.5 s fully left to 10 s and 1 s fully right. The fade-ins stay, so the movers don't jump when either starts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
89 lines
3.1 KiB
Python
89 lines
3.1 KiB
Python
#!/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""" <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()
|