Files
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

65 lines
2.5 KiB
Python

#!/usr/bin/env python3
"""Add a Movers speed dial on knob 13 to shows/test.qxw.
Knob 13 (CC 42) sets how long Wander and Ballyhoo take to go round, as knob 1
does for the cans' chases. Wander gets the dial's time and Ballyhoo an eighth of
it. QLC+ 4.12 counts an EFX's fade-in inside every round, not just the first, so
a round takes that less its fade-in (2 s for Wander, 0.5 s for Ballyhoo):
Knob fully left 62 s Wander, 7.5 s Ballyhoo
Starting value 22 s Wander, 2.5 s Ballyhoo (as before the dial)
Knob fully right 10 s Wander, 1 s Ballyhoo
The fade-ins stay, so the movers don't jump when either starts. The dial sits
beside the cans' Speed dial.
python3 scripts/shows/mover_speed.py
Run it once on a show with Wander and Ballyhoo; it stops if the dial is already there.
QLC+ has to reopen the show to see it.
"""
from __future__ import annotations
import re
from mover_bank import NO_FUNCTION, ROOT, appearance
SHOW = ROOT / "shows" / "test.qxw"
SPEED_CC = 42 # knob 13
SLOWEST_MS, FASTEST_MS, START_MS = 64000, 12000, 24000
# Index into QLC+'s speed dial factors: (Not Sent), 0, 1/16, 1/8, 1/4, 1/2, 1, 2, 4, 8, 16
TIMES_1, TIMES_1_8 = 6, 3
NOT_SENT = 0
def main() -> None:
xml = SHOW.read_text()
if 'Caption="Movers speed"' in xml:
raise SystemExit(f"{SHOW.relative_to(ROOT)} already has the movers speed dial")
engine, console = xml.split("<VirtualConsole>")
wid = max(int(i) for i in re.findall(r' ID="(\d+)"', console) if int(i) != NO_FUNCTION) + 1
def function(name: str) -> int:
return int(re.search(rf'<Function ID="(\d+)" Type="EFX" Name="{name}">', engine).group(1))
rows = "".join(f' <Function FadeIn="{NOT_SENT}" FadeOut="{NOT_SENT}" Duration="{factor}">{function(name)}</Function>\n'
for name, factor in (("Movers wander", TIMES_1), ("Movers ballyhoo", TIMES_1_8)))
dial = (f' <SpeedDial Caption="Movers speed" ID="{wid}">\n'
' <WindowState Visible="True" X="1820" Y="10" Width="110" Height="240"/>\n'
+ appearance(" ", "Sunken")
+ f' <AbsoluteValue Minimum="{SLOWEST_MS}" Maximum="{FASTEST_MS}">\n'
f' <Input Universe="1" Channel="{SPEED_CC}"/>\n'
' </AbsoluteValue>\n'
f' <Time>{START_MS}</Time>\n'
+ rows + ' </SpeedDial>\n')
xml = xml.replace(" </Frame>\n <Properties>", dial + " </Frame>\n <Properties>", 1)
SHOW.write_text(xml)
print(f"Added the movers speed dial to {SHOW.relative_to(ROOT)} (widget {wid}, knob 13)")
if __name__ == "__main__":
main()