Rename the MIDI intercept to padcontroller, as a module and as a service.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
jimmyandClaude Opus 5.5 committed 2026-10-22 12:33:43 +13:00
1 parent 00de2595b6
commit 1e09cb3825
9 files changed
+30 -30

No files matched your search

+1 -1
View File
@@ -3,7 +3,7 @@
.venv/bin/python scripts/pad/pad_lamps.py
Needs the USB Private port. padeditor.intercept does this on start; run this
Needs the USB Private port. padeditor.padcontroller does this on start; run this
when the pad is read by Chataigne instead.
"""
+1 -1
View File
@@ -75,7 +75,7 @@ PAD_COLORS = [
def detect_midi_uid() -> str:
"""Prefer smoothed virtual port when the intercept (padeditor.intercept) is running."""
"""Prefer smoothed virtual port when the pad controller (padeditor.padcontroller) is running."""
try:
out = subprocess.check_output(["aconnect", "-l"], text=True)
except (FileNotFoundError, subprocess.CalledProcessError):
+7 -7
View File
@@ -3,7 +3,7 @@
#
# Order matters:
# 1) pad present (Bluetooth or USB)
# 2) intercept (creates "SMC-PAD Smooth")
# 2) pad controller (creates "SMC-PAD Smooth")
# 3) patch workspace to that port
# 4) open QLC+ last
set -euo pipefail
@@ -30,10 +30,10 @@ if ! pad_present; then
exit 1
fi
# Restart the intercept so it re-opens the pad port cleanly. Use the systemd
# Restart the pad controller so it re-opens the pad port cleanly. Use the systemd
# user service when it is installed (padeditor/systemd/install.sh).
SERVICE=smc-pad-intercept.service
LOG=/tmp/smc_pad_intercept.log
SERVICE=padcontroller.service
LOG=/tmp/padcontroller.log
if systemctl --user is-enabled --quiet "$SERVICE" 2>/dev/null; then
systemctl --user restart "$SERVICE"
LOG=
@@ -41,9 +41,9 @@ else
# avoid pkill -f; it matches this script
while read -r pid; do
[[ -n "$pid" ]] && kill "$pid" 2>/dev/null || true
done < <(ps -eo pid,args | awk '/python.* -m padeditor[.]intercept/ {print $1}')
done < <(ps -eo pid,args | awk '/python.* -m padeditor[.]padcontroller/ {print $1}')
sleep 0.4
nohup "$PYTHON" -m padeditor.intercept --tau 0.055 >>"$LOG" 2>&1 &
nohup "$PYTHON" -m padeditor.padcontroller --tau 0.055 >>"$LOG" 2>&1 &
fi
for _ in $(seq 1 20); do
if aconnect -l 2>/dev/null | grep -q 'SMC-PAD Smooth'; then
@@ -52,7 +52,7 @@ for _ in $(seq 1 20); do
sleep 0.25
done
if ! aconnect -l 2>/dev/null | grep -q 'SMC-PAD Smooth'; then
echo "The intercept failed to create SMC-PAD Smooth." >&2
echo "The pad controller failed to create SMC-PAD Smooth." >&2
if [[ -n "$LOG" ]]; then
tail -20 "$LOG" >&2 || true
else
+3 -3
View File
@@ -4,13 +4,13 @@
Colour 1 paints all 15 cans and colour 2 the four movers, so one colour
for each can be on at once. Each set is a solo frame and every scene
fades in and out over FADE_MS. Bank 2 (notes 52–67) picks colour 1.
Holding Play picks set B: the intercept turns those notes into 68–83 while
Holding Play picks set B: the pad controller turns those notes into 68–83 while
Play is down. Bank 1 is kept for animations.
python3 scripts/shows/colour_sets.py && python3 -m showfile write shows/test.show.json -o shows/test.qxw
The sliders are Playback sliders over five scenes per set (Dim, R, G, B, W),
so they never override a channel. Knobs 1–5 move colour 1's sliders and knobs
6–10 colour 2's. Run the intercept with --lock-knobs to make them work only
6–10 colour 2's. Run the pad controller with --lock-knobs to make them work only
after the Custom pad is pressed; any other pad sends them back to zero (see
padeditor/layer.py).
"""
@@ -31,7 +31,7 @@ PROFILE = "M-VAVE SMC-PAD"
OMNI = 16 # QLC+ MIDI plugin channel that accepts every MIDI channel
PAD_MIDI_CH = 9 # the pads send notes on channel 10
KNOB_FIRST_CC = 30 # pad knob 1; colour 2's sliders follow colour 1's
PAD_PORT = "SMC-PAD Smooth" # padeditor/intercept.py; it applies the Play layer
PAD_PORT = "SMC-PAD Smooth" # padeditor/padcontroller.py; it applies the Play layer
# name, r, g, b, w. Bottom row first, four to a row. The cans have a white emitter, so the whites use it.
COLOURS = (