I have consistently been interested in assessing music information in R, for example my - somewhat dormant -charts dashboard
A recent, excellent, blog post by RCharlie featuring the Spotify and Genius APIs to determine a ‘Gloom Index’ for Radiohead tracks piqued my interest. It also incorporates some illuminating code using the purrr package
The Spotify, i.e. musical section of his work returns data swiftly and thus makes a Shiny app feasible allowing the full catalogue of 20 million tracks to be accessed. I extend it to a few different outputs, particularly the ability to link to youtube videos of chosen tracks and lyrics, courtesy of Google Lyrics.
I have created a flexdashboard. Here is an example for Penny Lane by The Beatles
Just running through the process that results in the image
- Enter artist name
- Select one or more from the selection provided
- De-select any albums that do not interest you. Wait a few seconds for output
- Search, sort table and hover over chart for more info on various music metrics
- Select a point on the chart and click to view youtube video (expandable to full screen) and lyric. This can be a bit hit and miss. Penny Lane, unsurprisingly, was a hit
- Tell your friends
The code is viewable on the site (click icon in top-right corner). Much of it is a complete steal from RCharlie and mine could definitely do with some enhancements.
Please note that if you plan to use the code do obtain your own client authorization