Files
qlcplus/scripts/shows/mover_ballyhoo.py
T
jimmyandClaude Opus 5.5 09aab70bd6 Put the movers' Wander and Ballyhoo speed on knob 13 in the test show.
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>
2026-10-23 01:46:27 +13:00

88 lines
2.9 KiB
Python

#!/usr/bin/env python3
"""Add a Ballyhoo pad for the movers to shows/test.qxw, on note 94.
On the movers layer (Pause on), pad 11 toggles a fast, wide figure of eight
around wherever the Pan and Tilt knobs (9 and 10, CC 38 and 39) put the movers,
as Wander does:
94 Ballyhoo an Eight about ±85° of pan and ±26° of tilt, 2.5 s round
All four start together. M1 and M4 turn the other way to M2 and M3, so the
same move mirrors left to right and front to back, and the beams sweep out
and cross in the middle together. It fades in over 0.5 s, which QLC+ counts inside each 3 s round. When it goes off,
the pad controller nudges the two knobs so QLC+ drops its last offset
(padcontroller/layer.py).
python3 scripts/shows/mover_ballyhoo.py
Run it once on a show with Wander and without Ballyhoo; it stops if Ballyhoo
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 = 40, 24 # of 255 each way: 540° of pan, 270° of tilt
ROUND_MS = 3000
FADE_IN_MS = 500
def efx(fid: int) -> str:
fixtures = "".join(f""" <Fixture>
<ID>{f}</ID>
<Head>0</Head>
<Mode>0</Mode>
<Direction>Forward</Direction>
<StartOffset>0</StartOffset>
</Fixture>
""" for f in 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 ballyhoo">
{fixtures} <PropagationMode>Parallel</PropagationMode>
<Speed FadeIn="{FADE_IN_MS}" FadeOut="0" Duration="{ROUND_MS}"/>
<Direction>Forward</Direction>
<RunOrder>Loop</RunOrder>
<Algorithm>Eight</Algorithm>
<Width>{WIDTH}</Width>
<Height>{HEIGHT}</Height>
<Rotation>0</Rotation>
<StartOffset>0</StartOffset>
<IsRelative>1</IsRelative>
<Axis Name="X">
<Offset>127</Offset>
<Frequency>1</Frequency>
<Phase>0</Phase>
</Axis>
<Axis Name="Y">
<Offset>127</Offset>
<Frequency>1</Frequency>
<Phase>0</Phase>
</Axis>
</Function>
"""
def main() -> None:
xml = SHOW.read_text()
if 'Name="Movers ballyhoo"' in xml:
raise SystemExit(f"{SHOW.relative_to(ROOT)} already has the movers ballyhoo")
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 Wander, on the pad after it.
wander = re.search(r' <Button Caption="Wander" ID="\d+" Icon="">\n.*? </Button>\n', xml, re.S).group(0)
xml = xml.replace(wander, wander + button(wid, "Ballyhoo", 190, 100, 90, fid, note(46)), 1)
SHOW.write_text(xml)
print(f"Added the movers ballyhoo to {SHOW.relative_to(ROOT)} (function {fid}, widget {wid})")
if __name__ == "__main__":
main()