Smooth the movers' Corners in the test show.

Corners slammed the heads about 100° of pan every 0.6 s at full motor speed.
It now runs at a quarter of the speed dial like the other shapes, about 1.4 s
a corner, and its pad starts a collection with a Movers glide scene that sets
the heads' Pan/Tilt Speed to 40 while it runs, so they ease into each corner.
That channel is forced HTP on the movers, so it drops back to full speed when
Corners stops instead of QLC+ holding it for everything after
(scripts/shows/mover_corners_glide.py).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
jimmyandClaude Opus 5.5 committed 2026-10-23 01:47:26 +13:00
1 parent f674dc9fe0
commit 3b38df3dd0
2 files changed
+82 -3

No files matched your search

+64
View File
@@ -0,0 +1,64 @@
#!/usr/bin/env python3
"""Smooth the movers' Corners in shows/test.qxw.
Corners (pad 11 on the movers layer) jumps the heads corner to corner of a
square. At full motor speed each jump is a slam of about 100° of pan, and at an
eighth of the speed dial the next comes 0.6 s later. Now it runs at a quarter,
like the other shapes (about 1.4 s a corner, 5.5 s a round to start with), and
its pad starts a collection of the EFX and a Movers glide scene that sets the
heads' Pan/Tilt Speed to GLIDE while it runs (0 is fastest, 255 slowest), so
they ease into each corner and settle there before the next. The channel is
forced HTP on the movers, so like a dimmer it drops back to 0, full speed, when
Corners stops; left LTP, QLC+ would hold it at GLIDE for everything after.
python3 scripts/shows/mover_corners_glide.py
Run it once on a show with Corners; it stops if the glide is already there.
QLC+ has to reopen the show to see it.
"""
from __future__ import annotations
import re
from mover_bank import M1, M2, M3, M4, ROOT, scene
from mover_more_efx import START_MS
SHOW = ROOT / "shows" / "test.qxw"
PAN_TILT_SPEED = 4 # mover channel
GLIDE = 40
TIMES_1_4 = 4 # speed dial factor index: (Not Sent), 0, 1/16, 1/8, 1/4, ...
def main() -> None:
xml = SHOW.read_text()
if 'Name="Movers glide"' in xml:
raise SystemExit(f"{SHOW.relative_to(ROOT)} already has the movers glide")
engine = xml.split("<VirtualConsole>")[0]
corners = int(re.search(r'<Function ID="(\d+)" Type="EFX" Name="Movers corners">', engine).group(1))
glide = max(int(i) for i in re.findall(r'<Function ID="(\d+)" Type', engine)) + 1
collection = glide + 1
xml, n = re.subn(rf'(<Function ID="{corners}" Type="EFX" Name="Movers corners">\n.*?<Speed FadeIn="\d+" FadeOut="0" Duration=")\d+"',
rf'\g<1>{START_MS}"', xml, count=1, flags=re.S)
assert n == 1
xml, n = re.subn(rf'(<Function FadeIn="0" FadeOut="0" Duration=")\d+(">{corners}</Function>)', rf"\g<1>{TIMES_1_4}\2", xml)
assert n == 1
functions = (scene(glide, "Movers glide", {PAN_TILT_SPEED: GLIDE})
+ f' <Function ID="{collection}" Type="Collection" Name="Movers corners glide">\n'
f' <Step Number="0">{corners}</Step>\n <Step Number="1">{glide}</Step>\n </Function>\n')
xml = xml.replace(" </Engine>", functions + " </Engine>", 1)
for fid in (M1, M2, M3, M4):
xml, n = re.subn(rf'( <ID>{fid}</ID>\n(?: .*\n)*? <Channels>43</Channels>\n)',
rf"\1 <ForcedHTP>{PAN_TILT_SPEED}</ForcedHTP>\n", xml, count=1)
assert n == 1, fid
xml, n = re.subn(r'(<Button Caption="Corners" ID="\d+" Icon="">\n.*?<Function ID=")\d+"', rf'\g<1>{collection}"',
xml, count=1, flags=re.S)
assert n == 1
SHOW.write_text(xml)
print(f"Corners in {SHOW.relative_to(ROOT)} now glides (scene {glide}, collection {collection})")
if __name__ == "__main__":
main()