Michael Haren’s Wassupy Blog

Visualize Spotify on your TV with projectM, AirPlay, and a Mac

in technology and code

projectM is an open source reimplementation of the old Winamp Milkdrop visualizer. It’s free on Steam.

The catch: a visualizer needs to hear the music, and macOS won’t let an app tap whatever is playing out of your speakers. Worse, if you’re AirPlaying Spotify to a TV, the audio isn’t even going through your Mac’s normal output. So the trick is to split the audio: send it to the TV and to a virtual loopback device that projectM can listen to.

BlackHole is that loopback device:

brew install blackhole-2ch

Reboot after installing—the installer adds a kernel-level audio driver and it won’t show up until you do.

Wire up the audio

  1. Start AirPlaying to your TV, e.g. Living Room TV
  2. Open Audio MIDI Setup and create a new Multi-Output Device. Check both your AirPlay device (Living Room TV) and BlackHole 2ch
  3. Right click on Multi-Output Device and choose “Use this device for sound output”
a screenshot of the Audio MIDI Setup window with "Multi-Output Device" selected in the sidebar. Its Primary Device is "BlackHole 2ch" and in the device list both "BlackHole 2ch" and "Living Room TV" are checked under the "Use" column

Now every sound your Mac makes goes to the TV and to BlackHole simultaneously.

Point projectM at BlackHole

Install projectM Music Visualizer from Steam and launch it. Press cmd-i to cycle through audio input devices until it lands on BlackHole—you’ll know because the visualization starts reacting to the music instead of sitting there politely.

Enjoy some 90s vibes.

Potential gotchas

When you reconnect to AirPlay in the future, recheck:

  1. your midi output device still has your TV selected
  2. your output device is still the primary output device