Add a Ballyhoo pad for the movers to the test show.

Pad 11 on the movers layer (note 94) toggles a fast figure of eight around
the Pan and Tilt knobs, like Wander: about ±85° of pan and ±26° of tilt, all
four movers together so the pairs mirror left to right and front to back
(scripts/shows/mover_ballyhoo.py).

The pad controller now settles the knobs after Ballyhoo goes off as well as
Wander, and keeps track of each separately.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
jimmyandClaude Opus 5.5 committed 2026-10-23 01:46:03 +13:00
1 parent 8caf341d30
commit 913494c0aa
5 files changed
+180 -18

No files matched your search

+87
View File
@@ -0,0 +1,87 @@
#!/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, 3 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. 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()