Toggle the pad's bank 1 to the movers with Pause, and add a Threshold sound mode.

Pause flips bank 1 between the cans (36-51) and the movers (84-99). Threshold
flashes the cans on bass hits and is exclusive with Sound, and knob 6 is the
sides' peak. The Sound and Threshold pads light while on, and the colour pads
that were on are pressed again when QLC+ reloads the show. --lock-knobs is gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
jimmyandClaude Opus 5.5 committed 2026-10-22 20:03:18 +13:00
1 parent 72c227b153
commit 11da656ee6
6 files changed
+378 -81

No files matched your search

+37
View File
@@ -28,5 +28,42 @@ def set_lamps() -> None:
print(f"Lamps not set: {exc}", flush=True)
# Bank 1 pads 1 and 2 (notes 36 and 37), lit while their sound mode is on.
PUMP_RGB = (0, 255, 0)
THRESHOLD_RGB = (255, 120, 0)
def set_sound_lamps(pump: bool, threshold: bool) -> None:
"""Light the Pump and Threshold pads while their mode is on, without saving.
Writes only the pad's running copy, so the stored preset (bank 1 off) comes
back on a power cycle. Needs the USB Private port; raises when it is missing.
"""
sys.path.insert(0, str(ROOT))
sys.path.insert(0, str(ROOT / "scripts" / "pad"))
import pad_colours
import rtmidi
from padcontroller.device import transact
from padcontroller.preset import scale
from padcontroller.sysex import RAM, write_request
lamps = {0: PUMP_RGB if pump else (0, 0, 0), 1: THRESHOLD_RGB if threshold else (0, 0, 0)}
midiout = rtmidi.MidiOut(rtapi=rtmidi.API_LINUX_ALSA)
midiin = rtmidi.MidiIn(rtapi=rtmidi.API_LINUX_ALSA)
index = midiout.get_ports().index(pad_colours.private_port(midiout.get_ports()))
midiin.open_port(index)
midiin.ignore_types(sysex=False, timing=True, active_sense=True)
midiout.open_port(index)
try:
for base in pad_colours.bank_bases(1):
for pad, rgb in lamps.items():
address = RAM + base + pad * pad_colours.RECORD + pad_colours.RGB_AT
transact(midiout, midiin, write_request(address, bytes(scale(c) for c in rgb)))
finally:
for port in (midiout, midiin):
port.close_port()
port.delete()
if __name__ == "__main__":
set_lamps()