Add sound-reactive cans, a strobe pad and side chases to the test show.

The Sound pad (bank 1 note 36) toggles a QLC+ Audio Triggers widget whose
volume bar drives a Sound submaster beside the can dimmers, so the cans'
brightness follows the music while the movers stay steady. padcontroller sends
CC 100 at full on every press and release of that pad, bypassing its CC
smoothing, so switching sound off always leaves the cans at full.

test.qxw also gains Chase forward/reverse, a double and an opposing zigzag
down the side cans (RGB matrices whose colour follows the Colour 2 pads), a
Strobe flash pad with the cans' strobe channel forced HTP, and the Dimmers
frame, forced-LTP side colours and dimmer-free colour scenes from parallel
sessions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
jimmyandClaude Opus 5.5 committed 2026-10-22 17:03:27 +13:00
1 parent 6bbb3d5a29
commit d522b1a2cf
4 files changed
+1234 -353

No files matched your search

+10
View File
@@ -9,6 +9,11 @@ With lock_knobs, knobs 1–5 (CC 30–34) drive colour 1's sliders and knobs 6
with Play held) has been pressed. Pressing any other bank 2 pad locks them
again, and its sliders are sent back to zero so their scenes stop.
Locked knob turns are dropped.
The Sound pad (note 36) toggles QLC+'s audio triggers, which pump the cans'
Sound submaster in the Dimmers frame. Every press and release also sends CC 100
at full, so switching sound off leaves the cans at full rather than wherever
the music left them.
"""
from __future__ import annotations
@@ -20,6 +25,8 @@ SHIFT = 16
CUSTOM_NOTE = 67
KNOB_FIRST_CC = 30
KNOBS_PER_LAYER = 5
SOUND_NOTE = 36
SUBMASTER_CC = 100
class PlayLayer:
@@ -56,6 +63,9 @@ class PlayLayer:
self.unlocked.discard(layer)
first = KNOB_FIRST_CC + layer * KNOBS_PER_LAYER
extra = [[0xB0, first + n, 0] for n in range(KNOBS_PER_LAYER)]
if note == SOUND_NOTE:
# Again on release, after any spectrum frame QLC+ still had queued
extra = [[0xB0, SUBMASTER_CC, 127]]
if is_on:
out = note + SHIFT if self.held and FIRST_NOTE <= note <= LAST_NOTE else note
self.sent[key] = out
+3 -3
View File
@@ -38,7 +38,7 @@ for p in glob.glob(str(ROOT / ".venv" / "lib" / "python*" / "site-packages")):
sys.path.insert(0, p)
import rtmidi
from padcontroller.layer import PlayLayer # noqa: E402
from padcontroller.layer import SUBMASTER_CC, PlayLayer # noqa: E402
# The lamp colours come from the show scripts, which are not part of this package.
sys.path.insert(0, str(ROOT / "scripts" / "pad"))
@@ -205,7 +205,7 @@ def main() -> None:
continue
for out in layer.handle(list(data)):
cmd = out[0] & 0xF0
if cmd == 0xB0 and len(out) >= 3:
if cmd == 0xB0 and len(out) >= 3 and out[1] != SUBMASTER_CC:
# Control Change → smooth
key = (out[0] & 0x0F, out[1])
target[key] = float(out[2])
@@ -213,7 +213,7 @@ def main() -> None:
current[key] = float(out[2])
last_sent[key] = -1
else:
# Notes, aftertouch, PC, etc. → immediate
# Notes, aftertouch, PC, the Sound reset (always resent), etc. → immediate
midiout.send_message(out)
# Ease CC toward targets and emit when quantized value moves
+1215 -350
View File
File diff suppressed because it is too large. Load diff
+6
View File
@@ -44,6 +44,12 @@ class PlayLayerTest(unittest.TestCase):
layer.handle(PLAY_DOWN)
self.assertEqual(layer.handle([0x99, 55, 0]), [[0x99, 55, 0]])
def test_sound_pad_puts_the_submaster_back_to_full(self):
layer = PlayLayer()
self.assertEqual(layer.handle([0x99, 36, 100]), [[0x99, 36, 100], [0xB0, 100, 127]])
self.assertEqual(layer.handle([0x89, 36, 0]), [[0x89, 36, 0], [0xB0, 100, 127]])
self.assertEqual(layer.handle([0x99, 37, 100]), [[0x99, 37, 100]])
if __name__ == "__main__":
unittest.main()