Posts Tagged playlists
Artist radio in 10 lines of code
Posted by Paul in code, fun, Music, playlist, The Echo Nest, web services on July 16, 2009
Last week we released Pyechonest, a Python library for the Echo Nest API. Pyechonest gives the Python programmer access to the entire Echo Nest API including artist and track level methods. Now after 9 years working at Sun Microsystems, I am a diehard Java programmer, but I must say that I really enjoy the nimbleness and expressiveness of Python. It’s fun to write little Python programs that do the exact same thing as big Java programs. For example, I wrote an artist radio program in Python that, given a seed artist, generates a playlist of tracks by wandering around the artists in the neighborhood of the seed artists and gathering audio tracks. With Pyechonest, the core logic is 10 lines of code:
def wander(band, max=10): played =  while max: if band.audio(): audio = random.choice(band.audio()) if audio['url'] not in played: play(audio) played.append(audio['url']) max -= 1 band = random.choice(band.similar()) (You can see/grab the full code with all the boiler plate in the SVN repository)
This method takes a seed artist (band) and selects a random track from set of audio that The Echo Nest has found on the web for that artist, and if we haven’t already played it, then do so. Then we select a near neighbor to the seed artist and do it all again until we’ve played the desired number of songs.
For such a simple bit of code, the playlists generated are surprisingly good..Here are a few examples:
Seed Artist: Led Zeppelin:
- You Shook Me by Led Zeppelin via licorice-pizza
- Suicide by Thin Lizzy via dmg541
- I Ain’t The One by Lynyrd Skynrd via artdecade
- Fortunate Son by Creedence Clearwater Revival via onesweetsong
- Susie-Q by Dale Hawkins via boogiewoogieflu
(I think the Dale Hawkins version of Susie-Q after CCR’s Fortunate Son is just brilliant)
Seed Artist: The Decemberists:
- The Wanting Comes In Waves/Repaid by The Decemberists via londononburgeoningmetropolis
- Amazing Grace by Sufjan Stevens via itallstarted
- Baby’s Romance by Chris Garneau via slowcoustic
- Saint Simon by The Shins via pastaprima
- Made Up Love Song #43 by Guillemots via merryswankster
(Note that audio for these examples is audio found on the web – and just like anything on the web the audio could go away at any time)
I think these artist-radio style playlists rival just about anything you can find on current Internet radio sites – which ain’t to0 bad for 10 lines of code.
The Beat that follows your feet
Posted by Paul in Music, The Echo Nest on June 4, 2009
There’s a new application in the Echo Nest developer showcase called SynchStep. SynchStep is an iPhone/iTouch application (currently only for jailbroken devices) that automatically synchronizes the music to your walking or running pace. SynchStep uses the Echo Nest Analyze API to extract the tempo for each song in your collection and when you are out for a walk or a run it will pick a song that matches your tempo.
I’ve seen a few academic systems that do this sort of thing. For instance, at last year’s ISMIR there was a paper called Development of an automatic music selection system based on runner’s step frequency that described a similar system. But SynchStep is the first system I’ve seen that is available to the general public on a popular platform like the iPhone.
SynchStep is a great example of a context-sensitive playlister. Instead of a list of songs selected via a random number generator, or via a DJ sitting in some dark, smoke-filled sound booth you get a playlist that matches what you are doing. I think we are going to see more attention paid to context-sensitive playlists: ‘Music for the root canal’, ‘Music that synchronizes with my windshield wipers’, ‘music for that first date with that girl who you think may be kind of emo’, and so on. To make these kind of playlists, the playlist generators will have to know what you are doing, and they’ll have to know what the music sounds like. Platforms like the iPhone already provides lots of context – the iPhone knows where you are, what time it is, it can hear you, it can see you, it can feel you move, it knows that the emo girl just sent you a ‘dear john’ IM, it can even hear your heartbeat. Signal processing and music analysis provides the other piece of the puzzle – knowing what the music sounds like. Just like SynchStep picks a track with a tempo that matches your pace, these next generation, context-aware playlisters will select music that fits the context. So when that kind-of-emo girl dumps you, your iPhone will know about it and will try to cheer you up with a little Katrina & The Waves. This song has super powers, it can even make the emo boys happy.