Add Circle and Sweep for the movers to the test show.

They fill the movers layer's top row, pads 15 and 16 (notes 98 and 99), in
the Movement solo frame with Wander and Ballyhoo: a circle of about ±45° of
pan and ±21° of tilt, and a straight pan sweep of about ±60°, both mirrored
and relative to the knobs. Knob 13's speed dial gives them a quarter of its
time, 5.5 s a round to start with (scripts/shows/mover_more_efx.py). The pad
controller settles the knobs after them too.

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:05 +13:00
1 parent 80df550916
commit c3fe965e79
5 files changed
+249 -9

No files matched your search

+4 -4
View File
@@ -36,9 +36,9 @@ 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 buttons toggle in a solo frame. QLC+ does not save which buttons are on, so
reopen() presses them again when QLC+ loads the show. reopen() presses them again when QLC+ loads the show.
The movers' Wander and Ballyhoo pads (notes 96 and 97, pads 13 and 14 on the The movers' Wander, Ballyhoo, Circle and Sweep pads (notes 96–99, pads 13–16 on
movers layer) each toggle a relative EFX around the Pan and Tilt knobs (9 and 10, the movers layer) each toggle a relative EFX around the Pan and Tilt knobs (9 and
CC 38 and 39). They share a solo frame in QLC+, so starting one stops the other. 10, CC 38 and 39). They share a solo frame in QLC+, so starting one stops the others.
QLC+ 4.12 leaves an EFX's last offset on the movers when it stops, until those QLC+ 4.12 leaves an EFX's last offset on the movers when it stops, until those
sliders change, so when the one that is on goes off, settle asks for the two sliders change, so when the one that is on goes off, settle asks for the two
knobs one step off and then back (nudge() and positions()). Swapping needs knobs one step off and then back (nudge() and positions()). Swapping needs
@@ -62,7 +62,7 @@ SUBMASTER_CC = 100
KNOB_CHANNEL = 0 KNOB_CHANNEL = 0
PEAK_CC = 35 # knob 6 PEAK_CC = 35 # knob 6
SIDE_CCS = (34, 37) # knobs 5 and 8: Cans 9–15 and Cans 1, 2, 7, 8 SIDE_CCS = (34, 37) # knobs 5 and 8: Cans 9–15 and Cans 1, 2, 7, 8
RELATIVE_NOTES = (96, 97) # Wander and Ballyhoo, pads 13 and 14 on the movers layer RELATIVE_NOTES = (96, 97, 98, 99) # Wander, Ballyhoo, Circle, Sweep: pads 13–16 on the movers layer
POSITION_CCS = (38, 39) # knobs 9 and 10: the movers' Pan and Tilt POSITION_CCS = (38, 39) # knobs 9 and 10: the movers' Pan and Tilt
+4 -4
View File
@@ -19,9 +19,9 @@ the pad controller runs means the show has just loaded with every button off.
REOPEN_DELAY later it presses the last colour pads again (see PlayLayer.colours), REOPEN_DELAY later it presses the last colour pads again (see PlayLayer.colours),
which it keeps in COLOURS_FILE so they outlive a restart of the pad controller. which it keeps in COLOURS_FILE so they outlive a restart of the pad controller.
When the movers' Wander or Ballyhoo pad goes off, SETTLE_DELAY later it nudges the Pan and When the movers' Wander, Ballyhoo, Circle or Sweep pad goes off, SETTLE_DELAY
Tilt knobs a step and puts them back, so QLC+ drops the EFX's last offset later it nudges the Pan and Tilt knobs a step and puts them back, so QLC+ drops
(see PlayLayer.settle). the EFX's last offset (see PlayLayer.settle).
Usage: Usage:
.venv/bin/python -m padcontroller.midi .venv/bin/python -m padcontroller.midi
@@ -228,7 +228,7 @@ def main() -> None:
load_colours(layer) load_colours(layer)
saved_colours = dict(layer.colours) saved_colours = dict(layer.colours)
reopen_at: float | None = None reopen_at: float | None = None
# (when, messages to send then), for the Wander and Ballyhoo settle # (when, messages to send then), for the settle after a mover EFX
later: list[tuple[float, Callable[[], list[list[int]]]]] = [] later: list[tuple[float, Callable[[], list[list[int]]]]] = []
# Links made this soon after start are ours being restored, with QLC+'s buttons as they were. # Links made this soon after start are ours being restored, with QLC+'s buttons as they were.
reopen_from = time.monotonic() + 5.0 reopen_from = time.monotonic() + 5.0
+102
View File
@@ -0,0 +1,102 @@
#!/usr/bin/env python3
"""Add Circle and Sweep for the movers to shows/test.qxw, on notes 98 and 99.
They fill the top row of the movers layer after Wander and Ballyhoo, in the same
Movement solo frame, so only one of the four runs at a time. Like them, each is
a relative EFX around wherever the Pan and Tilt knobs (9 and 10) put the movers:
98 Circle pad 15 a circle about ±45° of pan and ±21° of tilt
99 Sweep pad 16 a straight pan sweep, about ±60° side to side
All four movers start together, so the pairs mirror left to right and front to
back as in Ballyhoo. Each fades in over 0.5 s. Knob 13's Movers speed dial gives
them a quarter of its time, less the fade-in that QLC+ counts in each round:
5.5 s a round to start with, from 15.5 s fully left to 2.5 s fully right.
padcontroller/layer.py settles the knobs after them too.
python3 scripts/shows/mover_more_efx.py
Run it once on a show with the Movement solo frame and the Movers speed dial;
it stops if Circle 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"
FADE_IN_MS = 500
START_MS = 6000 # a quarter of the speed dial's starting 24 s
TIMES_1_4 = 4 # speed dial factor index: (Not Sent), 0, 1/16, 1/8, 1/4, ...
SIZE = 90
# Caption, function name, algorithm, width, height (of 255 each way), can note, column
MOVES = (
("Circle", "Movers circle", "Circle", 21, 20, 50, 2),
("Sweep", "Movers sweep", "Line", 28, 0, 51, 3),
)
def efx(fid: int, name: str, algorithm: str, width: int, height: 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)
axes = "".join(f""" <Axis Name="{axis}">
<Offset>127</Offset>
<Frequency>1</Frequency>
<Phase>0</Phase>
</Axis>
""" for axis in "XY")
# Relative: the EFX adds its offset from 127 to the Pan and Tilt sliders' levels.
return f""" <Function ID="{fid}" Type="EFX" Name="{name}">
{fixtures} <PropagationMode>Parallel</PropagationMode>
<Speed FadeIn="{FADE_IN_MS}" FadeOut="0" Duration="{START_MS}"/>
<Direction>Forward</Direction>
<RunOrder>Loop</RunOrder>
<Algorithm>{algorithm}</Algorithm>
<Width>{width}</Width>
<Height>{height}</Height>
<Rotation>0</Rotation>
<StartOffset>0</StartOffset>
<IsRelative>1</IsRelative>
{axes} </Function>
"""
def main() -> None:
xml = SHOW.read_text()
if 'Name="Movers circle"' in xml:
raise SystemExit(f"{SHOW.relative_to(ROOT)} already has the movers circle")
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
solo = re.search(r' <SoloFrame Caption="Movement" ID="\d+">\n.*? </SoloFrame>\n', xml, re.S).group(0)
dial = re.search(r' <SpeedDial Caption="Movers speed" ID="\d+">\n.*? </SpeedDial>\n', xml, re.S).group(0)
functions, buttons, rows = "", "", ""
for i, (caption, name, algorithm, width, height, can_note, column) in enumerate(MOVES):
functions += efx(fid + i, name, algorithm, width, height)
buttons += button(wid + i, caption, SIZE * column, 0, SIZE, fid + i, note(can_note), indent=" ")
rows += f' <Function FadeIn="0" FadeOut="0" Duration="{TIMES_1_4}">{fid + i}</Function>\n'
columns = 2 + len(MOVES)
grown = re.sub(r'(<WindowState Visible="True" X="10" Y="10" Width=")\d+"', rf'\g<1>{SIZE * columns}"', solo, count=1)
grown = grown.replace(" </SoloFrame>\n", buttons + " </SoloFrame>\n")
xml = xml.replace(solo, grown, 1)
xml = xml.replace(dial, dial.replace(" </SpeedDial>\n", rows + " </SpeedDial>\n"), 1)
xml = xml.replace(" </Engine>", functions + " </Engine>", 1)
SHOW.write_text(xml)
print(f"Added Circle and Sweep to {SHOW.relative_to(ROOT)} (functions {fid}–{fid + len(MOVES) - 1}, "
f"widgets {wid}–{wid + len(MOVES) - 1})")
if __name__ == "__main__":
main()
+131 -1
View File
@@ -970,6 +970,106 @@
<Phase>0</Phase> <Phase>0</Phase>
</Axis> </Axis>
</Function> </Function>
<Function ID="71" Type="EFX" Name="Movers circle">
<Fixture>
<ID>17</ID>
<Head>0</Head>
<Mode>0</Mode>
<Direction>Forward</Direction>
<StartOffset>0</StartOffset>
</Fixture>
<Fixture>
<ID>8</ID>
<Head>0</Head>
<Mode>0</Mode>
<Direction>Forward</Direction>
<StartOffset>0</StartOffset>
</Fixture>
<Fixture>
<ID>9</ID>
<Head>0</Head>
<Mode>0</Mode>
<Direction>Forward</Direction>
<StartOffset>0</StartOffset>
</Fixture>
<Fixture>
<ID>18</ID>
<Head>0</Head>
<Mode>0</Mode>
<Direction>Forward</Direction>
<StartOffset>0</StartOffset>
</Fixture>
<PropagationMode>Parallel</PropagationMode>
<Speed FadeIn="500" FadeOut="0" Duration="6000"/>
<Direction>Forward</Direction>
<RunOrder>Loop</RunOrder>
<Algorithm>Circle</Algorithm>
<Width>21</Width>
<Height>20</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>
<Function ID="72" Type="EFX" Name="Movers sweep">
<Fixture>
<ID>17</ID>
<Head>0</Head>
<Mode>0</Mode>
<Direction>Forward</Direction>
<StartOffset>0</StartOffset>
</Fixture>
<Fixture>
<ID>8</ID>
<Head>0</Head>
<Mode>0</Mode>
<Direction>Forward</Direction>
<StartOffset>0</StartOffset>
</Fixture>
<Fixture>
<ID>9</ID>
<Head>0</Head>
<Mode>0</Mode>
<Direction>Forward</Direction>
<StartOffset>0</StartOffset>
</Fixture>
<Fixture>
<ID>18</ID>
<Head>0</Head>
<Mode>0</Mode>
<Direction>Forward</Direction>
<StartOffset>0</StartOffset>
</Fixture>
<PropagationMode>Parallel</PropagationMode>
<Speed FadeIn="500" FadeOut="0" Duration="6000"/>
<Direction>Forward</Direction>
<RunOrder>Loop</RunOrder>
<Algorithm>Line</Algorithm>
<Width>28</Width>
<Height>0</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>
</Engine> </Engine>
<VirtualConsole> <VirtualConsole>
<Frame Caption=""> <Frame Caption="">
@@ -2478,7 +2578,7 @@
<BackgroundImage>None</BackgroundImage> <BackgroundImage>None</BackgroundImage>
<Font>Default</Font> <Font>Default</Font>
</Appearance> </Appearance>
<WindowState Visible="True" X="10" Y="10" Width="180" Height="90"/> <WindowState Visible="True" X="10" Y="10" Width="360" Height="90"/>
<AllowChildren>True</AllowChildren> <AllowChildren>True</AllowChildren>
<AllowResize>True</AllowResize> <AllowResize>True</AllowResize>
<ShowHeader>False</ShowHeader> <ShowHeader>False</ShowHeader>
@@ -2514,6 +2614,34 @@
<Intensity Adjust="False">100</Intensity> <Intensity Adjust="False">100</Intensity>
<Input Universe="1" Channel="37089"/> <Input Universe="1" Channel="37089"/>
</Button> </Button>
<Button Caption="Circle" ID="117" Icon="">
<WindowState Visible="True" X="180" Y="0" Width="90" Height="90"/>
<Appearance>
<FrameStyle>None</FrameStyle>
<ForegroundColor>Default</ForegroundColor>
<BackgroundColor>Default</BackgroundColor>
<BackgroundImage>None</BackgroundImage>
<Font>Default</Font>
</Appearance>
<Function ID="71"/>
<Action>Toggle</Action>
<Intensity Adjust="False">100</Intensity>
<Input Universe="1" Channel="37090"/>
</Button>
<Button Caption="Sweep" ID="118" Icon="">
<WindowState Visible="True" X="270" Y="0" Width="90" Height="90"/>
<Appearance>
<FrameStyle>None</FrameStyle>
<ForegroundColor>Default</ForegroundColor>
<BackgroundColor>Default</BackgroundColor>
<BackgroundImage>None</BackgroundImage>
<Font>Default</Font>
</Appearance>
<Function ID="72"/>
<Action>Toggle</Action>
<Intensity Adjust="False">100</Intensity>
<Input Universe="1" Channel="37091"/>
</Button>
</SoloFrame> </SoloFrame>
<Button Caption="Strobe" ID="89" Icon=""> <Button Caption="Strobe" ID="89" Icon="">
<WindowState Visible="True" X="10" Y="100" Width="90" Height="90"/> <WindowState Visible="True" X="10" Y="100" Width="90" Height="90"/>
@@ -2719,6 +2847,8 @@
<Time>24000</Time> <Time>24000</Time>
<Function FadeIn="0" FadeOut="0" Duration="6">69</Function> <Function FadeIn="0" FadeOut="0" Duration="6">69</Function>
<Function FadeIn="0" FadeOut="0" Duration="3">70</Function> <Function FadeIn="0" FadeOut="0" Duration="3">70</Function>
<Function FadeIn="0" FadeOut="0" Duration="4">71</Function>
<Function FadeIn="0" FadeOut="0" Duration="4">72</Function>
</SpeedDial> </SpeedDial>
</Frame> </Frame>
<Properties> <Properties>
+8
View File
@@ -214,6 +214,14 @@ class PlayLayerTest(unittest.TestCase):
layer.handle([0x99, 49, 100]) layer.handle([0x99, 49, 100])
self.assertEqual((layer.moving, layer.settle), (None, True)) self.assertEqual((layer.moving, layer.settle), (None, True))
def test_sweep_off_settles(self):
layer = PlayLayer()
layer.handle(PAUSE_DOWN)
self.assertEqual(layer.handle([0x99, 51, 100]), [[0x99, 99, 100]])
self.assertEqual((layer.moving, layer.settle), (99, False))
layer.handle([0x99, 51, 100])
self.assertEqual((layer.moving, layer.settle), (None, True))
if __name__ == "__main__": if __name__ == "__main__":
unittest.main() unittest.main()