Technical Project
OSC Spotify
A zero-touch macOS background daemon that bridges Open Sound Control (OSC port 8000) and raw UDP text strings (port 7000) to Spotify and Apple Music—allowing Q-SYS, lighting consoles, TouchOSC, and hardware triggers to fire playlists and control volume over the network.
The problem
Show-control processors and lighting consoles often need to trigger walk-in or lobby music on a dedicated Mac, but some devices send structured OSC packets while others only emit raw UDP strings. Passing web URLs directly to Spotify via AppleScript also introduces browser redirect lag.
How I approached it
I built a multi-threaded Python daemon that runs a ThreadingOSCUDPServer on port 8000 alongside a raw UDP socket listener on port 7000. Incoming Spotify web URLs are rewritten via regex into native spotify:track/playlist/album URIs for instant AppleScript execution, and the process registers itself as 'OSC Music Bridge' in macOS System Events. One-click Install, Check, and Uninstall .command scripts manage the private virtual environment and macOS LaunchAgent.
Inside the build
- Built dual-protocol listeners for OSC (port 8000) and raw UDP strings (port 7000) to support show-control processors, TouchOSC, and simple hardware triggers.
- Converted open.spotify.com links into native spotify:track/playlist/album URIs via regex before invoking osascript, avoiding browser-redirect delays during live cues.
- Packaged one-click Install.command, Check.command, and Uninstall.command scripts that provision a private Python venv, register a macOS launchd service, and inspect listening ports and logs.
- Implemented play, pause, toggle, direct track/playlist loading, and clamped 0–100 volume control across both Spotify and Apple Music.
The result
Deployed in production booths so operators and Q-SYS room presets can start, pause, and level-match Spotify and Apple Music from any network controller.