Play Spotify music with a Launchpad and a Raspberry Pi.
I want a way for my children to pick their own music, while still playing it from a Spotify playlist that I can update as their favourite songs change.
- Raspberry Pi (or any computer)
- Novation Launchpad S (haven't tried with any others)
- Aux cord
- Speakers
Connect the Launchpad and speakers to the Raspberry Pi. The Raspberry Pi acts as the Spotify client (this makes it available as a device which can play music) and also calles the
- Go to the Spotify developer dashboard and create a new app.
- If your host computer (Raspberry Pi in my case), doesn't have a Spotify client. Download and run Spotifyd
- Install
portmidi
on the host computer to allow communication with the launchpad. - Clone this repository
- Build with
go build src/app.go
- Run the app with
./app \
-spotifyId={Client ID from Developer Dashboard} \
-spotifySecret={Client Secret from Developer Dashboard} \
-playlist={Playlist ID of your selected playlist} \
-device={Device name that will be playing the music}
- The app will then print a URL that you can use to authenticate
- If you authenticate on a different computer to your host one, copy the
redirected url and execute
curl {redirected-url}
on the host computer. - Done!
This app is very simple and has very few abstractions (there's only one file). It may be easier to just clone and edit to better suit your needs.