diff --git a/padcontroller/layer.py b/padcontroller/layer.py index f5cb1d6..5c67ee9 100644 --- a/padcontroller/layer.py +++ b/padcontroller/layer.py @@ -36,7 +36,7 @@ cans, 68–83 for the movers), or None once it is pressed again: the colour buttons toggle in a solo frame. QLC+ does not save which buttons are on, so reopen() presses them again when QLC+ loads the show. -The movers' Wander and Ballyhoo pads (notes 93 and 94, pads 10 and 11 on the +The movers' Wander and Ballyhoo pads (notes 96 and 97, pads 13 and 14 on the movers layer) each toggle a relative EFX around the Pan and Tilt knobs (9 and 10, CC 38 and 39). QLC+ 4.12 leaves an EFX's last offset on the movers when it stops, until those sliders change, so when either goes off, settle asks for the two @@ -60,7 +60,7 @@ SUBMASTER_CC = 100 KNOB_CHANNEL = 0 PEAK_CC = 35 # knob 6 SIDE_CCS = (34, 37) # knobs 5 and 8: Cans 9–15 and Cans 1, 2, 7, 8 -RELATIVE_NOTES = (93, 94) # Wander and Ballyhoo, pads 10 and 11 on the movers layer +RELATIVE_NOTES = (96, 97) # Wander and Ballyhoo, pads 13 and 14 on the movers layer POSITION_CCS = (38, 39) # knobs 9 and 10: the movers' Pan and Tilt diff --git a/scripts/shows/mover_pads_top_row.py b/scripts/shows/mover_pads_top_row.py new file mode 100644 index 0000000..e4eee46 --- /dev/null +++ b/scripts/shows/mover_pads_top_row.py @@ -0,0 +1,71 @@ +#!/usr/bin/env python3 +"""Drop the movers' chases from shows/test.qxw and put Wander and Ballyhoo on the top row. + +The movers layer loses its Chase, Chase reverse, Zigzag and Opposing pads +(notes 96–99), their runs, holds, colour matrices and fixture groups, and their +place on the Speed dial. Wander and Ballyhoo move up from notes 93 and 94 to +the first two pads of the top row: + + 96 Wander pad 13 on the movers layer + 97 Ballyhoo pad 14 on the movers layer + +The movers' Strobe (92) and Peak stay. padcontroller/layer.py settles the knobs +after notes 96 and 97. + + python3 scripts/shows/mover_pads_top_row.py + +Run it once on a show with the mover chases; it stops if they are gone. +QLC+ has to reopen the show to see it. +""" + +from __future__ import annotations + +import re + +from mover_bank import (F_DIMMER, F_OPP, GROUP_OPPOSING, GROUP_RINGS, GROUP_ZIGZAG, ROOT, note) + +SHOW = ROOT / "shows" / "test.qxw" + +CHASE_FUNCTIONS = range(F_DIMMER, F_OPP + 1) # 57–63 +CHASE_GROUPS = (GROUP_RINGS, GROUP_ZIGZAG, GROUP_OPPOSING) +CHASE_PADS = ("Chase", "Chase reverse", "Zigzag", "Opposing") +TOP_ROW = (("Wander", 10, note(48)), ("Ballyhoo", 100, note(49))) + + +def cut(xml: str, pattern: str) -> str: + xml, n = re.subn(pattern, "", xml, count=1, flags=re.S) + assert n == 1, pattern + return xml + + +def main() -> None: + xml = SHOW.read_text() + if 'Name="Movers chase forward run"' not in xml: + raise SystemExit(f"{SHOW.relative_to(ROOT)} has no mover chases") + + for fid in CHASE_FUNCTIONS: + xml = cut(xml, rf' \n') + xml = re.sub(rf' {fid}\n', "", xml) + for gid in CHASE_GROUPS: + xml = cut(xml, rf' \n.*? \n') + + pads = re.search(r' \n.*?\n \n', xml, re.S).group(0) + kept = pads + for caption in CHASE_PADS: + kept = cut(kept, rf' \n') + for caption, x, channel in TOP_ROW: + kept, n = re.subn(rf'( - - - @@ -2742,462 +2529,6 @@ - - - Sunken - Default - Default - None - Default - - - True - True - True - False - True - False - - - - - - - - Sunken - Default - Default - None - Default - - - True - True - True - False - True - False - - - - Sunken - Default - Default - None - Default - - - 6 - - StartColor - #ff0000 - - - - StartColor - #ff7f00 - - - - StartColor - #ffbf00 - - - - StartColor - #ffff00 - - - - StartColor - #7fff00 - - - - StartColor - #00ff00 - - - - StartColor - #00ff7f - - - - StartColor - #00ffff - - - - StartColor - #007fff - - - - StartColor - #0000ff - - - - StartColor - #7f00ff - - - - StartColor - #ff00ff - - - - StartColor - #ff2878 - - - - StartColor - #ff7828 - - - - StartColor - #ffffff - - - - StartColor - #5078ff - - - - - - - Sunken - Default - Default - None - Default - - - 6 - - StartColor - #ff0000 - - - - StartColor - #ff7f00 - - - - StartColor - #ffbf00 - - - - StartColor - #ffff00 - - - - StartColor - #7fff00 - - - - StartColor - #00ff00 - - - - StartColor - #00ff7f - - - - StartColor - #00ffff - - - - StartColor - #007fff - - - - StartColor - #0000ff - - - - StartColor - #7f00ff - - - - StartColor - #ff00ff - - - - StartColor - #ff2878 - - - - StartColor - #ff7828 - - - - StartColor - #ffffff - - - - StartColor - #5078ff - - - - - - - Sunken - Default - Default - None - Default - - - 6 - - StartColor - #ff0000 - - - - StartColor - #ff7f00 - - - - StartColor - #ffbf00 - - - - StartColor - #ffff00 - - - - StartColor - #7fff00 - - - - StartColor - #00ff00 - - - - StartColor - #00ff7f - - - - StartColor - #00ffff - - - - StartColor - #007fff - - - - StartColor - #0000ff - - - - StartColor - #7f00ff - - - - StartColor - #ff00ff - - - - StartColor - #ff2878 - - - - StartColor - #ff7828 - - - - StartColor - #ffffff - - - - StartColor - #5078ff - - - - - - - Sunken - Default - Default - None - Default - - - 6 - - StartColor - #ff0000 - - - - StartColor - #ff7f00 - - - - StartColor - #ffbf00 - - - - StartColor - #ffff00 - - - - StartColor - #7fff00 - - - - StartColor - #00ff00 - - - - StartColor - #00ff7f - - - - StartColor - #00ffff - - - - StartColor - #007fff - - - - StartColor - #0000ff - - - - StartColor - #7f00ff - - - - StartColor - #ff00ff - - - - StartColor - #ff2878 - - - - StartColor - #ff7828 - - - - StartColor - #ffffff - - - - StartColor - #5078ff - - - - Sunken @@ -3353,14 +2684,8 @@ 47 49 52 - 58 - 60 - 61 - 63 45 50 - 59 - 62 diff --git a/tests/test_pad_layer.py b/tests/test_pad_layer.py index 9447c7d..d1a2d4c 100644 --- a/tests/test_pad_layer.py +++ b/tests/test_pad_layer.py @@ -191,28 +191,28 @@ class PlayLayerTest(unittest.TestCase): self.assertEqual(layer.handle([0xB0, 38, 40]), [[0xB0, 38, 40]]) layer.handle([0xB0, 39, 0]) layer.handle(PAUSE_DOWN) - self.assertEqual(layer.handle([0x99, 45, 100]), [[0x99, 93, 100]]) - layer.handle([0x89, 45, 0]) - self.assertEqual((layer.moving, layer.settle), ({93}, False)) - layer.handle([0x99, 45, 100]) + self.assertEqual(layer.handle([0x99, 48, 100]), [[0x99, 96, 100]]) + layer.handle([0x89, 48, 0]) + self.assertEqual((layer.moving, layer.settle), ({96}, False)) + layer.handle([0x99, 48, 100]) self.assertEqual((layer.moving, layer.settle), (set(), True)) self.assertEqual(layer.nudge(), [[0xB0, 38, 39], [0xB0, 39, 1]]) self.assertEqual(layer.positions(), [[0xB0, 38, 40], [0xB0, 39, 0]]) - def test_strobe_2_on_the_cans_layer_is_not_wander(self): + def test_chase_on_the_cans_layer_is_not_wander(self): layer = PlayLayer() - layer.handle([0x99, 45, 100]) - layer.handle([0x99, 45, 100]) + layer.handle([0x99, 48, 100]) + layer.handle([0x99, 48, 100]) self.assertEqual((layer.moving, layer.settle), (set(), False)) def test_ballyhoo_off_settles_while_wander_runs_on(self): layer = PlayLayer() layer.handle(PAUSE_DOWN) - layer.handle([0x99, 45, 100]) - self.assertEqual(layer.handle([0x99, 46, 100]), [[0x99, 94, 100]]) - self.assertEqual((layer.moving, layer.settle), ({93, 94}, False)) - layer.handle([0x99, 46, 100]) - self.assertEqual((layer.moving, layer.settle), ({93}, True)) + layer.handle([0x99, 48, 100]) + self.assertEqual(layer.handle([0x99, 49, 100]), [[0x99, 97, 100]]) + self.assertEqual((layer.moving, layer.settle), ({96, 97}, False)) + layer.handle([0x99, 49, 100]) + self.assertEqual((layer.moving, layer.settle), ({96}, True)) if __name__ == "__main__":