Spotify
Included with Macro DeckControl Spotify playback, like songs, manage playlists and show what is playing on your deck.
Two Music Player widgets playing a track, one in the Full cover style and one in the Small cover style, both with the Spotify name and logo in the header
- Play, pause, skip, seek, shuffle, repeat and volume
- Play a track or playlist, or pick one when you press the button
- Like songs and add the current track to a playlist
- Move playback to another Spotify device
- Music Player widget and variables for track, artist and progress
The Spotify integration connects Macro Deck to your Spotify account through the Spotify Web API. It controls playback wherever Spotify plays for that account: the desktop app, your phone, a speaker or any other Spotify Connect device. Spotify does not have to run on the computer that runs Macro Deck.
To connect, you create a small app of your own in the Spotify Developer Dashboard and enter its Client ID and Client Secret in Macro Deck. Macro Deck then opens the Spotify login, and you allow access once. Controlling playback through the Web API needs Spotify Premium; this is a rule of Spotify, not of Macro Deck.
What you can do
- Play, pause, skip, seek, turn shuffle on or off, set the repeat mode and change the volume.
- Start a specific track or playlist. Leave the choice empty, and Macro Deck asks you to pick one when you press the button.
- Start playback on a specific device, or move playback to another device and keep it playing or paused.
- Add the current track to your Liked Songs or remove it, and add it to or remove it from a playlist.
- Show what is playing in the Music Player widget, with the cover, progress and play and skip buttons.
- Use variables such as
spotify_current_track_namein button labels, and bind a slider tospotify_volumeorspotify_current_position.
Some example setups:
- A Toggle Play/Pause button that shows whether music is playing or paused.
- A heart button with Toggle Liked Song that shows whether the current song is in your Liked Songs.
- A button that moves playback from your computer to the living room speaker with Transfer Playback.
- A slider bound to
spotify_volumethat follows the volume and changes it while you drag.
How it behaves
Macro Deck asks Spotify for the playback state about every 3 seconds while music plays, every 5 seconds while it is paused, and every 10 seconds while nothing plays. Changes you make in the Spotify app show up within that time. Access tokens are renewed in the background, so you only sign in again when Spotify revokes access. When Spotify limits the number of requests or does not answer, Macro Deck pauses, keeps the last known state and shows an issue on the Spotify page under Integrations until it can continue. You can connect one Spotify account.
What you need
- A Spotify Premium account. Spotify only lets Premium accounts control playback through its Web API.
- An app of your own in the Spotify Developer Dashboard, for its Client ID and Client Secret.
- A web browser on the computer that runs Macro Deck, for the Spotify login.
- Spotify open on at least one device, so there is something to control.
Set it up
Step 1: Create an app in the Spotify Developer Dashboard
Open the Spotify Developer Dashboard at developer.spotify.com/dashboard, sign in and create a new app. Any name and description work.
Step 2: Start the setup in Macro Deck
In Macro Deck, click Integrations in the sidebar and click Spotify. On the Overview tab, click Set up in the Configuration section. Turning on the switch at the top right opens the same dialog, and the integration is turned on once the setup is done. The Connect Spotify dialog shows a Redirect URI with a copy button.
Step 3: Add the Redirect URI to your Spotify app
In your Spotify app's settings, add the Redirect URI that Macro Deck shows, exactly as shown, and save.
Step 4: Enter the Client ID and Client Secret
Copy the Client ID and Client Secret from your Spotify app and paste them into the fields of the same names in Macro Deck. Then press Continue.
Step 5: Allow access in your browser
Macro Deck opens the Spotify login in your browser and the dialog shows Waiting for authorization…. Sign in with your Premium account and allow access, then come back to Macro Deck. The setup continues on its own and names the configuration after your Spotify account, for example Spotify (Alex). When the dialog shows Setup complete., click Done.
Step 6: Add an action to a button
On the Deck page, click the button you want to use. The deck must be unlocked: when the button at the top right reads Lock, it is unlocked. The editor opens with Short Press selected. Click + Add action, select Spotify on the left of the Add action dialog and pick an action such as Toggle Play/Pause. Then click Save.
Step 7: Press the button
Start playing something in Spotify on any device, then press the button on your deck. Playback pauses or resumes.
Actions18
Put these on a button or run them from a flow.
- Play
- Resumes playback.
- Pause
- Pauses playback.
- Toggle Play/Pause
- Switches between play and pause, and shows the playback state on the button.
- Next Track
- Skips to the next track.
- Previous Track
- Skips to the previous track.
- Refresh State
- Asks Spotify for the current playback state right away.
- Set Volume
- Sets the volume of the device that plays, from 0 to 100%.
- Volume Up
- Raises the volume by 10%.
- Volume Down
- Lowers the volume by 10%.
- Seek
- Jumps to a position in the current track, in seconds.
- Toggle Shuffle
- Turns shuffle on, off, or switches it, and shows whether it is on.
- Set Repeat Mode
- Sets repeat to Off, Repeat Track or Repeat Album/Playlist.
- Play Track
- Plays a track you search for or pick from your Liked Songs, or asks you to pick one when the action runs.
- Play Playlist
- Plays one of your playlists or one you search for, or asks you to pick one when the action runs.
- Play on Device
- Starts playback on a specific Spotify device, or asks you to pick one when the action runs.
- Transfer Playback
- Moves playback to another device and keeps it playing or paused.
- Toggle Liked Song
- Adds the current track or episode to your Liked Songs or removes it, and shows whether it is liked.
- Add or Remove in Playlist
- Adds the current track or episode to a playlist or removes it, and shows whether it is in that playlist.
Triggers8
A button or flow can react to these events.
- Track Changed
- A different track started playing, with its title, artist and album (under Music Player).
- Playback Started
- Playback started or resumed (under Music Player).
- Playback Paused
- Playback was paused (under Music Player).
- Playback Stopped
- Playback stopped (under Music Player).
- Playback Device Changed
- Playback moved to another device (under Music Player).
- Volume Changed
- The volume changed, with the new and the previous value (under Music Player).
- Player Connected
- Spotify became reachable (under Music Player).
- Player Disconnected
- Spotify is no longer reachable (under Music Player).
Variables19
Show these values on buttons and widgets, or use them in conditions.
spotify_current_track_name- The title of the track that plays.
spotify_current_artist- The artists of the current track, separated by commas.
spotify_current_album- The album of the current track.
spotify_playback_state- The playback state:
playing,pausedorstopped. spotify_is_playing- Whether music plays right now.
spotify_volume- The volume in percent. You can also set it, for example with a slider.
spotify_track_duration- The length of the current track in seconds.
spotify_current_position- How far the track has played in seconds. You can also set it to seek.
spotify_progress_percentage- How far the track has played in percent.
spotify_album_art_url- The address of the current cover in Macro Deck.
spotify_device_name- The name of the device that plays.
spotify_device_type- The type of the device that plays, for example a computer or a speaker.
spotify_shuffle_enabled- Whether shuffle is on.
spotify_repeat_mode- The repeat mode:
off,trackorcontext. spotify_is_connected- Whether Macro Deck reaches Spotify and there is a usable session.
spotify_current_track_url- The Spotify link of the current track.
spotify_current_track_is_liked- Whether the current track is in your Liked Songs.
spotify_top_track,spotify_top_artist- Your most played track and artist.
spotify_top_tracks,spotify_top_artists- Your most played tracks and artists as a list.
Widgets1
Add these to your deck from the widget picker.
- Music Player
- Shows the track, artists and cover that Spotify plays, with progress and play, pause and skip buttons.
Frequently asked questions
Why do I need Spotify Premium?
Spotify only lets Premium accounts control playback through its Web API. With a free account, Spotify refuses the commands, and Macro Deck shows the issue Spotify Premium required on the Spotify page under Integrations. This is a limit of Spotify, not of Macro Deck.
Why do I have to create my own Spotify app?
Macro Deck talks to Spotify with the Client ID and Client Secret of an app you own. Spotify counts requests per app, so your deck does not share its limit with other users. Creating the app is free and takes a minute in the Spotify Developer Dashboard.
Does Spotify have to run on the same computer as Macro Deck?
No. Macro Deck controls your account through the internet, so it controls Spotify on any device that plays for that account, such as your phone or a Spotify Connect speaker. With Play on Device and Transfer Playback you choose the device.
Can I connect more than one Spotify account?
No. The integration supports one configuration. Choosing Reconfigure replaces it with another account, and your buttons and widgets keep working.
Macro Deck says Spotify is rate limiting it. What can I do?
Spotify stops answering when too many requests are made with your app's credentials. Macro Deck pauses its requests and tells you when it continues. The limit counts every application that uses the same Client ID, so closing other apps that use it usually helps.
Where are my Spotify credentials stored?
The Client Secret and the tokens Spotify hands out are stored encrypted on the computer that runs Macro Deck. They are only sent to Spotify. Your Spotify password is never entered in Macro Deck; you sign in on the Spotify website.
More in Music and audio
YouTube Music Desktop App
Included with Macro DeckControl YouTube Music Desktop App from your deck: playback, volume, ratings and what is playing.
WebNowPlaying
Included with Macro DeckControl music and videos playing in your browser and show what is playing, through the WebNowPlaying extension.
Jellyfin
Included with Macro DeckControl Jellyfin apps and TVs from your deck, show what plays and react when playback starts or stops.
SoundPad
Included with Macro DeckPlay sounds from your SoundPad list, control recordings and show the playing sound on your deck.
Voicemeeter
Included with Macro DeckControl the gain, mute, routing and macro buttons of Voicemeeter, Banana or Potato from your deck.