Posts Tagged rdio
Given that it is a holiday today, I only had a short amount of coding time this morning. Still, I built something that is pretty fun to play with. It is a little tool that lets you explore gender and music. With the tool, you can search for Rdio playlists via keywords and the app will give you the gender breakdown of the matching playlist creators. For example, if you type in ‘exercise’ the tool finds the top 200 playlists with exercise in the title and gives you the gender breakdown like so:
You can use the tool to explore gender biases in music. Some examples:
- 90% of Bieber playlists are by female listeners
- 81% of heavy metal playlists are by male listeners
- 61% of love playlists are by female listeners
- 70% of driving playlists are by male listeners
- 70% of cleaning playlists are by female listeners
- 95% of coding playlists are by male (!) listeners
- 100% of Mamma Mia playlists are by female listeners
- 88% of frat playlists are by male listeners
The tool was built using the superduper Rdio API. Try the tool out here: Gender Bias in Music
You know the old story – if you put a frog in a pot of cold water and gradually heat the pot up, the frog won’t notice and will happily sit in the pot until the water boils and the frog is turned into frog soup. This story is at the core of my winter break programming project called Boil the Frog. Boil the Frog will take you from one music style to another gradually enough so that you may not notice the changes in music style. Just like the proverbial frog sitting in a pot of boiling water, with a Boil the Frog playlist, the Justin Bieber fan may find themselves listening to some extreme brutal death metal such as Cannibal Corpse or Deicide (the musical equivalent to sitting in a pot of boiling water).
To use Boil the Frog, you type in the names of any two artists you’ll be given a playlist that connects the two artists. Click on the first artist to start listening to the playlist. If you don’t like the route taken to connect two artists, you can make a new route by bypassing an offending artist. The app uses Rdio to play the music. If you are an Rdio subscriber, you’ll hear full tracks, if not you’ll hear a 30 second sample of the music.
You can create some fun playlists with this app such as:
- Miley Cyrus to Miles Davis
- Justin Bieber to Jimi Hendrix
- Mickey Mouse to deadmau5
- Patti Smith to the Smiths
- Elvis to Elvis
- The Carter Family to Rammstein
- Kanye West to Taylor Swift
- Cage the Elephant to John Cage
- Ryan Adams to Bryan Adams
- Righteous Brothers to Steven Wright
How does it work? To create this app, I use The Echo Nest artist similarity info to build an artist similarity graph of about 100,000 of the most popular artists. Each artist in the graph is connected to it’s most similar neighbors according to the Echo Nest artist similarity algorithm.
To create a new playlist between two artists, the graph is used to find the path that connects the two artists. The path isn’t necessarily the shortest path through the graph. Instead, priority is given to paths that travel through artists of similar popularity. If you start and end with popular artists, you are more likely to find a path that takes you though other popular artists, and if you start with a long-tail artist you will likely find a path through other long-tail artists. Without this popularity bias many routes between popular artists would venture into back alleys that no music fan should dare to tread.
Once the path of artists is found, we need to select the best songs for the playlist. To do this, we pick a well-known song for each artist that minimizes the difference in energy between this song, the previous song and the next song. Once we have selected the best songs, we build a playlist using Rdio’s nifty web api.
This is the second version of this app. I built the first version during a Spotify hack weekend. This was a Spotify app that would only run inside Spotify. I never released the app (the Spotify app approval process was a bit too daunting for my weekend effort), so I though I’d make a new version that runs on the web that anyone can use.
I enjoy using Boil the Frog to connect up artists that I like. I usually end up finding a few new artists that I like. For example, this Boil The Frog playlist connecting Deadmau5 and Explosions in the Sky is in excellent coding playlist.
A bit more coding this weekend on ‘Hear Here’ my iPhone app that plays music by nearby artists. It is now feature complete. The list of features is rather small – it really is a ‘do one thing well’, kind of app. It plays music by the nearest artists that match your filter. You can filter currently by the popularity of the artist. If you are adventurous, you can listen to music by all nearby artists, but if you are not so brave you can just listen to music by mainstream or popular artists. The app shows you how far away the ‘now playing’ artist is and shows you how many artists are within a 25 mile radius. All music is streamed from Rdio and of course you’ll need an Rdio subscription to hear full streams. I made my own icon – it is pretty ugly – if you have design skills and want to contribute a logo I’d be very pleased to use it. Here’s a video of the app in action for a user who happens to be in Cupertino:
Next steps for the app are lots of testing, especially with poor network connectivity. After that, I’ll make sure I’m following all the rules for Rdio and Apple – and once I’m conforming to all the TOS’s and UI guidelines I’ll submit it to the App Store (as a free app).
My weekend programming project was to build a bare-bones version of Roadtrip Mixtape that runs on an iPhone. This is an MVP (a term I learned from my Product Management buddies at work) – with only 5 basic features:
- You can press ‘next’ and the app plays a song by the nearest band to where you are right now.
- You can press ‘pause’ to pause/resume the playing
- You can login to Rdio so you can listen to full streams
- You can look at the album art
- You can simulate moving to another location (I was getting sick of listening to just Nashua music).
This is the first significant bit of iOS programming that I’ve done. It is a lot of fun. Xcode has tons of features that make working with all the idiosyncrasies of the platform manageable. There’s a huge amount of documentation including many tutorials, examples and recorded WWDC talks, plus tons more info on Stack Overflow. To stream music I’m using the Rdio iOS SDK. It is very easy to use, very well documented, with lots of good examples. I thought that getting music to play was going to be the hard bit of this project, but it was actually really easy. Well done Rdio programmers!
Tomorrow I’ll take V0.1 on its maiden test drive on my commute to work to see how well it works on the road. I suspect that the playlists will not be the most listenable since they are often filled with very long tail artists. On the list for V.2 will be the ability to add popularity and style filters to make it more likely that music that I actually like appears in the playlist.
Oh and I came up with a new working title for the app = ‘Hear Here’. Not sure if I’m 100% on board with the name though. No one likes puns anymore.
Over the last few years I’ve made a number of 1,000+ mile road trips as I shuttle kids to colleges in far away places. Listening to music has always been a big part of these trips. I thought it’d be nice to be able to listen to music by local artists when driving through a particular region, so I spent a few weekends creating an app called Roadtrip Mixtape that populates a roadtrip playlist with artists that are from the region you are driving through.
To create a playlist, type your starting and ending cities for your roadtrip. The app will use Google’s directions to plan the best route between the two cities. The route will then be broken into 15 minute playlist legs. Each playlist leg is populated by 15 minutes worth of music by nearby artists.
The beginning of each leg is represented by a green ball. You can click on the ball to see what artists will be played during that leg. The app plays music via Rdio using their nifty Web Player API. If you are an Rdio subscriber you can listen to full streams, and if not you get to hear 30 second samples. One bit of interesting info that I show for a route is the ‘Avg distance’. This shows the average distance to each artist on the roadtrip. If this number is low, you are traveling through a musically dense part of the world, and if it is high, you are traveling in a sparse musical region. For instance, for a roadtrip from Boston to New York the average artist distance is 3 miles (about as low as it goes). However, if you are traveling from Omaha to Denver, the average artist distance is 81 miles.
You can also click anywhere on the map to see and listen to nearby artists. For example, if you click on Shreveport you’ll see something like this:
When you click the ‘Hear here’ button, you’ll get a playlist of the hotttest artists from Shreveport.
Listening to nearby artists is quite fun. There’s potential from some extreme sonic whiplash as you drive near a brutal death metal band and then a pop vocalist from the 1950s
The Technical Bits
To build the app I used the new artist location data from The Echo Nest. This (still in beta) feature, allows you to retrieve the location of any artist. Here’s an example API call that retrieves the artist location for Radiohead:
For this app, I collected the locations for the top 100,000 or so most popular artists in the Rdio catalog. These artists were from about 15,000 different cities. I used geopy along with the Yahoo Placefinder geocoder to find the latitude and longitude for each of these cities. For the mapping and route finding, I used version 3.9 of the Google maps API. For music playback I used the Rdio Web Playback API. With the tight integration between the Echo Nest and Rdio ID spaces it was easy to go from a geolocated Echo Nest artist to a list of Rdio track IDs for songs by that artist.
The Bad Bits
As a web app that relies on the flash-based Rdio web player, Roadtrip Mixtape is not really a mobile app. It won’t play music on an iPhone or iPad, so the best way to actually use this app on the road is probably to bring along your tethered laptop. Not the best user experience. Thus, my next weekend project will be to learn a little bit of iOS programming a make a version of this app that runs on an iPhone and an iPad. Stay tuned for the next version.