163ad4145b
- prometheus-exporter.py: stdlib-only HTTP metrics on :9090/metrics - Exposes: ALSA status, hw_ptr rate, service health, mixer controls - MIDI counters: notes_on, notes_off, errors - test-unit.py: 10-test suite covering full MIDI→Pd→Audio pipeline - test-tone.pd, test-midi-log.pd: minimal debug patches - systemd service for exporter - install.sh/deploy updated to include exporter
28 lines
924 B
Bash
Executable File
28 lines
924 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# test-midi.sh — Send MIDI notes via UDP and verify they reach the viz
|
|
# Usage: ./scripts/test-midi.sh [board_ip] [note] [velocity]
|
|
set -euo pipefail
|
|
|
|
BOARD="${1:-192.168.9.167}"
|
|
NOTE="${2:-60}"
|
|
VELOCITY="${3:-100}"
|
|
VIZ_PORT=8082
|
|
|
|
echo "=== MIDI Input Test ==="
|
|
echo "Board: $BOARD"
|
|
echo "Sending: note=$NOTE vel=$VELOCITY"
|
|
|
|
# Send MIDI note-on via UDP to Pd (port 8081)
|
|
python3 -c "import socket; s=socket.socket(socket.AF_INET,socket.SOCK_DGRAM); s.sendto(b'midi 144 $NOTE $VELOCITY;', ('$BOARD', 8081)); s.close()"
|
|
echo "[OK] Sent note-on to Pd (UDP 8081)"
|
|
|
|
sleep 0.2
|
|
|
|
# Send MIDI note-off
|
|
python3 -c "import socket; s=socket.socket(socket.AF_INET,socket.SOCK_DGRAM); s.sendto(b'midi 128 $NOTE 0;', ('$BOARD', 8081)); s.close()"
|
|
echo "[OK] Sent note-off to Pd (UDP 8081)"
|
|
|
|
echo ""
|
|
echo "=== MIDI Test Complete ==="
|
|
echo "Check LED matrix for visual feedback. If note appeared, MIDI pipeline works."
|