An HTML5 Spotify visualizer, built with spotify-viz and Vue.
Try it out at www.kaleidosync.com!
The Echo Nest prides itself on the comprehensive algorithmic analysis of music. Having been acquired by Spotify, their analysis resources are available publically via the Spotify API. Each song within Spotify's library have been fully analyzed: broken up into individual beats, segments, tatums, bars, and sections. There are variables assigned to describe mood, active volume, pitch, timbre, and more – even how "danceable" a track is.
This project is my take on using their data to produce visual experiences. If you're interested in doing the same, I created spotify-viz as a reasonable starting point.
- Create a new Spotify app in your Spotify Developer Dashboard.
- Add
http://localhost:8001/callback
to your app's Redirect URIs. Make note to save yourClient ID
andClient Secret
. - Create a file named
.env
and place it in the project's root directory. Populate it with the following values:
CLIENT_ID=YOUR_CLIENT_ID_HERE
CLIENT_SECRET=YOUR_CLIENT_SECRET_HERE
REDIRECT_URI=http://localhost:8001/callback
PROJECT_ROOT=http://localhost:8001
NODE_ENV=development
STATE_KEY=KALEIDOSYNC_STATE_KEY
ACCESS_TOKEN=KALEIDOSYNC_ACCESS_TOKEN
REFRESH_TOKEN=KALEIDOSYNC_REFRESH_TOKEN
REFRESH_CODE=KALEIDOSYNC_REFRESH_CODE
Note:
STATE_KEY
,ACCESS_TOKEN
,REFRESH_TOKEN
, andREFRESH_CODE
can all be set to any unique strings. If you use www.kaleidosync.com regularly it might be worth choosing your own values to avoid state conflict.
- In the project's root directory, install dependencies using NPM:
npm i
- Then build and serve the project via @vue/cli:
npm run serve
- Once running, visit http://localhost:8080 and log in with your Spotify account.
- Play a song in your Spotify client of choice. The visualizer will take a moment to sync before initializing.
- Cleanup / bug fixes.
- There are now 8 visualizers to choose from.
- Reduces the complexity of adding new visualizers.
- Reverts back to the traditional polling when running the dev server.
- Surfaces a control interface for WebGL scenes.
- There are now 7 visualizers to choose from.
- Refactor / rate limit debugging.
- There are now 6 visualizers to choose from.
- Major refactor.
- There are now 5 visualizers to choose from.
- Includes an interface for rendering fragment shaders.
- Project backbone has been abstracted away into its own library, spotify-viz.
- Adoped @vue/cli for the UI layer.
- There are now 4 visualizers to choose from.
- User settings now persist when revisiting the site.
- More graceful error handling and authentication flow.
- This project now fully represents what's hosted on www.kaleidosync.com, instead of the bare-bones implementation that it was before.
- Complete refactor with no front end dependencies.
- Transitioned to webpack from gulp.
- Reactive data store using ES6 Proxies, semi-inspired by Vuex.
- (Hopefully) less spaghetti and more comments.
- Re-implemented with
requestAnimationFrame()
- Now mobile-friendly, even on older devices.
- Improved tweening.
- Adjusts itself on window resize.
- More accurate syncing with Spotify, including automatic self-correction.
- Holy shit, it's working... kind of.