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:
1 parent
00de2595b6
commit
1e09cb3825
9 files changed
+30
-30
No files matched your search
@@ -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.
|
||||
"""
|
||||
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user