Point the back movers at the back wall at pan knob 0 in the test show.
M3 and M4 are mounted 90° round from M1 and M2, so at pan 0 they face the middle. Knob 9 now drives a Pan slider for M1 and M2 over 0–212 and a Pan back slider for M3 and M4 over 43–255 (scripts/shows/mover_pan_back.py). The same span keeps the pairs 90° of pan apart all the way round: at knob 0 the front pair face the audience and the back pair the back wall, and the left and right pairs point at the centre and the side walls together. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
00c8c2d35d
commit
8caf341d30
2 files changed
+92
-5
No files matched your search
@@ -0,0 +1,70 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Split the movers' Pan slider in shows/test.qxw so the back pair face the back wall at knob 0.
|
||||
|
||||
M3 and M4 are mounted 90° round from M1 and M2: at pan 0 the front pair face
|
||||
the audience and the back pair face the middle. Knob 9 (CC 38) now drives two
|
||||
sliders over the same span of 212 steps, so the pairs keep that 90° of pan
|
||||
(about 43 steps of 540°) between them all the way round:
|
||||
|
||||
Pan M1, M2 0–212
|
||||
Pan back M3, M4 43–255
|
||||
|
||||
At knob 0 the front pair face the audience and the back pair the back wall.
|
||||
Turning it, the left pair (M1, M3) and the right pair (M2, M4) point at the
|
||||
centre together and at the side walls together.
|
||||
|
||||
python3 scripts/shows/mover_pan_back.py
|
||||
|
||||
Run it once on a show without it; it stops if it 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, NO_FUNCTION, ROOT
|
||||
|
||||
SHOW = ROOT / "shows" / "test.qxw"
|
||||
|
||||
BACK_OFFSET = 43 # 90° of pan, of 540° over 256 steps
|
||||
ORDER = ("Brightness", "Pan", "Pan back", "Tilt", "Focus", "Rotate")
|
||||
|
||||
|
||||
def main() -> None:
|
||||
xml = SHOW.read_text()
|
||||
if 'Caption="Pan back"' in xml:
|
||||
raise SystemExit(f"{SHOW.relative_to(ROOT)} already has the back movers' pan")
|
||||
wid = max(int(i) for i in re.findall(r' ID="(\d+)"', xml.split("<VirtualConsole>")[1])
|
||||
if int(i) != NO_FUNCTION) + 1
|
||||
start = xml.index('<Frame Caption="Movers position"')
|
||||
end = xml.index("</Frame>", start)
|
||||
frame = xml[start:end]
|
||||
|
||||
pan = re.search(r' <Slider Caption="Pan" ID="\d+".*? </Slider>\n', frame, re.S).group(0)
|
||||
level = re.search(r'<Level LowLimit="0" HighLimit="255" Value="\d+">', pan).group(0)
|
||||
|
||||
def rows(*fixtures: int) -> str:
|
||||
return "".join(f' <Channel Fixture="{f}">0</Channel>\n' for f in fixtures)
|
||||
|
||||
channels = rows(M1, M2, M3, M4)
|
||||
assert channels in pan
|
||||
front = (pan.replace(level, f'<Level LowLimit="0" HighLimit="{255 - BACK_OFFSET}" Value="0">')
|
||||
.replace(channels, rows(M1, M2)))
|
||||
back = (re.sub(r'Caption="Pan" ID="\d+"', f'Caption="Pan back" ID="{wid}"', pan)
|
||||
.replace(level, f'<Level LowLimit="{BACK_OFFSET}" HighLimit="255" Value="{BACK_OFFSET}">')
|
||||
.replace(channels, rows(M3, M4)))
|
||||
frame = frame.replace(pan, front + back)
|
||||
|
||||
# Six sliders 58 apart fit the frame as it is.
|
||||
for i, caption in enumerate(ORDER):
|
||||
frame, n = re.subn(rf'(<Slider Caption="{caption}" ID="\d+"[^>]*>\n\s*<WindowState Visible="True" X=")\d+"',
|
||||
rf'\g<1>{5 + 58 * i}"', frame)
|
||||
assert n == 1, caption
|
||||
|
||||
SHOW.write_text(xml[:start] + frame + xml[end:])
|
||||
print(f"Split the movers' Pan in {SHOW.relative_to(ROOT)} (Pan back is widget {wid})")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
+22
-5
@@ -3171,7 +3171,7 @@
|
||||
</Playback>
|
||||
</Slider>
|
||||
<Slider Caption="Pan" ID="107" WidgetStyle="Slider" InvertedAppearance="false">
|
||||
<WindowState Visible="True" X="65" Y="35" Width="52" Height="200"/>
|
||||
<WindowState Visible="True" X="63" Y="35" Width="52" Height="200"/>
|
||||
<Appearance>
|
||||
<FrameStyle>Sunken</FrameStyle>
|
||||
<ForegroundColor>Default</ForegroundColor>
|
||||
@@ -3181,9 +3181,26 @@
|
||||
</Appearance>
|
||||
<Input Universe="1" Channel="38"/>
|
||||
<SliderMode ValueDisplayStyle="Exact" ClickAndGoType="None" Monitor="false">Level</SliderMode>
|
||||
<Level LowLimit="0" HighLimit="255" Value="92">
|
||||
<Level LowLimit="0" HighLimit="212" Value="0">
|
||||
<Channel Fixture="8">0</Channel>
|
||||
<Channel Fixture="9">0</Channel>
|
||||
</Level>
|
||||
<Playback>
|
||||
<Function>4294967295</Function>
|
||||
</Playback>
|
||||
</Slider>
|
||||
<Slider Caption="Pan back" ID="113" WidgetStyle="Slider" InvertedAppearance="false">
|
||||
<WindowState Visible="True" X="121" Y="35" Width="52" Height="200"/>
|
||||
<Appearance>
|
||||
<FrameStyle>Sunken</FrameStyle>
|
||||
<ForegroundColor>Default</ForegroundColor>
|
||||
<BackgroundColor>Default</BackgroundColor>
|
||||
<BackgroundImage>None</BackgroundImage>
|
||||
<Font>Default</Font>
|
||||
</Appearance>
|
||||
<Input Universe="1" Channel="38"/>
|
||||
<SliderMode ValueDisplayStyle="Exact" ClickAndGoType="None" Monitor="false">Level</SliderMode>
|
||||
<Level LowLimit="43" HighLimit="255" Value="43">
|
||||
<Channel Fixture="17">0</Channel>
|
||||
<Channel Fixture="18">0</Channel>
|
||||
</Level>
|
||||
@@ -3192,7 +3209,7 @@
|
||||
</Playback>
|
||||
</Slider>
|
||||
<Slider Caption="Tilt" ID="108" WidgetStyle="Slider" InvertedAppearance="false">
|
||||
<WindowState Visible="True" X="120" Y="35" Width="52" Height="200"/>
|
||||
<WindowState Visible="True" X="179" Y="35" Width="52" Height="200"/>
|
||||
<Appearance>
|
||||
<FrameStyle>Sunken</FrameStyle>
|
||||
<ForegroundColor>Default</ForegroundColor>
|
||||
@@ -3213,7 +3230,7 @@
|
||||
</Playback>
|
||||
</Slider>
|
||||
<Slider Caption="Focus" ID="109" WidgetStyle="Slider" InvertedAppearance="false">
|
||||
<WindowState Visible="True" X="180" Y="35" Width="52" Height="200"/>
|
||||
<WindowState Visible="True" X="237" Y="35" Width="52" Height="200"/>
|
||||
<Appearance>
|
||||
<FrameStyle>Sunken</FrameStyle>
|
||||
<ForegroundColor>Default</ForegroundColor>
|
||||
@@ -3234,7 +3251,7 @@
|
||||
</Playback>
|
||||
</Slider>
|
||||
<Slider Caption="Rotate" ID="110" WidgetStyle="Slider" InvertedAppearance="false">
|
||||
<WindowState Visible="True" X="235" Y="35" Width="52" Height="200"/>
|
||||
<WindowState Visible="True" X="295" Y="35" Width="52" Height="200"/>
|
||||
<Appearance>
|
||||
<FrameStyle>Sunken</FrameStyle>
|
||||
<ForegroundColor>Default</ForegroundColor>
|
||||
|
||||
Reference in new issue
Block a user