Remove the sound-reactive cans from the test show.

The Sound and Threshold audio triggers go, with the Sound submaster beside the
cans' Front and Back sliders (CC 100) and the Sound peak frame with its Peak
submaster and Hit button and the Cans hit functions only Hit ran. Pads 1 and 2
are plain spare buttons again (scripts/shows/drop_sound.py). The pads frame's
own Peak (knob 6) stays: it is the chases' peak.

The pad controller drops its side of it: the Pump and Threshold modes, the
CC 100 resets, holding the side knobs at the peak and the pad lamps that showed
which mode was on. Pads 1 and 2 and knobs 5, 6 and 8 pass straight through.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
jimmyandClaude Opus 5.5 committed 2026-10-23 13:57:00 +13:00
1 parent 3b38df3dd0
commit e7e1cf656b
6 files changed
+92 -349

No files matched your search

+68
View File
@@ -0,0 +1,68 @@
#!/usr/bin/env python3
"""Take the sound-reactive cans out of shows/test.qxw.
Removes the Sound and Threshold audio triggers, the Sound submaster beside the
cans' Front and Back sliders (CC 100), and the Sound peak frame with its Peak
submaster and Hit button, with the Cans hit scene and chaser that only Hit ran.
The Pump and Threshold buttons on pads 1 and 2 (notes 36 and 37) were empty;
they go back to plain spare buttons like the rest of that row. The pads frame's
own Peak (CC 35) stays: it is the chases' peak.
padcontroller/layer.py drops its side of it in the same change: the two pads'
modes, the CC 100 resets and the pad lamps that showed which was on.
python3 scripts/shows/drop_sound.py
Run it once; it stops if the audio triggers are already gone. QLC+ has to
reopen the show to see it.
"""
from __future__ import annotations
import re
from mover_bank import ROOT
SHOW = ROOT / "shows" / "test.qxw"
SOUND_SLIDER_W = 55 # the Sound slider and the gap before it in the Cans frame
def cut(xml: str, pattern: str, what: str) -> str:
xml, n = re.subn(pattern, "", xml, count=1, flags=re.S)
if n != 1:
raise SystemExit(f"Couldn't find {what}")
return xml
def main() -> None:
xml = SHOW.read_text()
if "<AudioTriggers" not in xml:
raise SystemExit(f"{SHOW.relative_to(ROOT)} has no sound triggers left")
for caption in ("Sound", "Threshold"):
xml = cut(xml, rf' <AudioTriggers BarsNumber="\d+" Caption="{caption}" ID="\d+">\n.*? </AudioTriggers>\n',
f"the {caption} audio trigger")
xml = cut(xml, r' <Slider Caption="Sound" ID="66" .*? </Slider>\n', "the Sound submaster")
xml = cut(xml, r' <Frame Caption="Sound peak" ID="76">\n.*? </Frame>\n', "the Sound peak frame")
for fid, name in ((55, "Cans hit"), (56, "Cans hit 100 ms")):
xml = cut(xml, rf' <Function ID="{fid}" Type="\w+" Name="{name}">\n.*? </Function>\n', name)
# The Dimmers frame and its Cans frame lose the Sound slider's width.
for caption, wid, x, y, w, h in (("Dimmers", 68, 880, 15, 264, 250), ("Cans", 73, 70, 40, 165, 205)):
old = f'<WindowState Visible="True" X="{x}" Y="{y}" Width="{w}" Height="{h}"/>'
frame = re.search(rf'<Frame Caption="{caption}" ID="{wid}">\n(?:.*\n){{0,8}}?\s*{re.escape(old)}', xml)
if frame is None:
raise SystemExit(f"Couldn't find the {caption} frame at {w} wide")
xml = xml.replace(frame.group(0), frame.group(0).replace(f'Width="{w}"', f'Width="{w - SOUND_SLIDER_W}"'), 1)
for caption, wid in (("Pump", 57), ("Threshold", 58)):
old = f'<Button Caption="{caption}" ID="{wid}" Icon="">'
if old not in xml:
raise SystemExit(f"Couldn't find the {caption} button")
xml = xml.replace(old, f'<Button Caption="Button {wid}" ID="{wid}" Icon="">', 1)
SHOW.write_text(xml)
print(f"Took the sound pieces out of {SHOW.relative_to(ROOT)}")
if __name__ == "__main__":
main()