Using Spotify With a Stream Deck
My table plays the vast majority of our sessions remotely over Discord. While this has many advantages, things can quickly become overwhelming. One of my major pain points was trying to manage all of the windows, especially when it came to triggering music to help set the scene.
To solve this, I ran out and bought a Stream Deck thinking that I could simplify my workflow at a push of a button. No more cycling through my embedded folders on Spotify to find the right playlist! Or so I thought.
The Problem
It turns out that Spotify doesn't play well with third parties trying to trigger and manage songs and playlists. The Stream Deck does have a Spotify Integration but its capability is limited to the following:
- Play/Pause
- Toggle Shuffle
- Next Track
- Previous Track
- Volume
To further complicate things, I am on a Mac and so solutions like the Barraider approach weren't an option.
The Solution
Enter Apple Shortcuts! At its core, Apple Shortcuts is a way to automate tasks and workflows on your Mac.
Getting the Playlist ID
The first thing you need to do is get the unique ID associated with your playlist.
- In the Spotify Mac App, navigate to the playlist you want to trigger.
- Hit the three dots next to the download icon.
- Go to
Share > Copy link to playlist
- This will get you something that looks like this:
https://open.spotify.com/playlist/0Q6hJZYIEu3LwbyBBHjjHo?si=ead4f61287d54fc6
- The part you care about is between the
playlist/
and?si=
in the URL. - In this case, I am grabbing the
0Q6hJZYIEu3LwbyBBHjjHo
portion. This is the playlist ID.
Creating the Script
Go ahead and launch Apple Shortcuts. A screen like below (though likely empty) will pop up.
- Click the '+' at the top of the screen to create a new shortcut.
- A new window will open.
- On the right side of the window, search for
Run AppleScript
and select the first option.
- It will load a default script. Delete that.
- In the text area, insert the following code. Replace the Spotify Playlist ID with your desired playlist that we got in the previous step.
tell application "Spotify"
play track "spotify:playlist:<Your Playlist ID>"
end tell
- Change the name (by clicking on it to edit) to be more descriptive.
- Change the Icon (by clicking on it) if you wish.
- With Spotify open, hit the play arrow at the top of the screen to test that it worked. It should trigger the playlist to start playing.
Setting up the Stream Deck
- Install the Apple Shortcuts Plugin for the Stream Deck.
- Open the Stream Deck interface from the top menu bar on your desktop.
- Drop in the new
Launch Shortcut
action.
- Select the folder where you organized your playlists.
- Select the shortcut relating to the playlist you want to trigger.
- Add a picture or icon.
- Test the integration by pressing the icon on the Stream Deck.
Wrapping Up
That's it. You will have to rinse and repeat for each playlist you want to set up, but fortunately, Apple Shortcuts allows you to duplicate actions.
Using the same method, I have also triggered specific songs to add the needed punch to some of the more meaningful scenes.
This process does take a bit of up-front work but it has made things much smoother during my sessions.
Below you can see how my setup works.
Extra Credit
If you play on Discord I highly recommend using this in conjunction with KenkuFM. This is an awesome tool made by the same folks behind Owlbear Rodeo.
In order to make this work there is one additional step.
Because Kenku FM uses the Spotify player, you need to:
- Open the Spotify app on your Mac.
- Within the Spotify window in the KenkuFM app, you need to change the device that the music is playing on to This Web Browser.
Looking Forward
There are some obvious deficiencies to this approach. The primary one being that it only works on a Mac. In the future, if I outgrow my current use case (or if someone out there is so inclined), there is an API offered directly by Spotify.
I'm not sure how it would fit in with the workflow, but at least there is another option.
Member discussion