Archive for category The Echo Nest
The Led Zeppelin Graph
Posted by Paul in fun, Music, The Echo Nest on February 26, 2009
I’ve been pretty busy figuring out the lay of the land at the new job, so I haven’t had too much time for recreational programming. However, last night, while my lovely wife was watching Dr. House demonstrate his excellent interpersonal skills, I got a chance to write a little bit of code to generate an artist graph using the Echo Nest Developer API.
The idea is to generate a graph that shows the artist similarity space in a fashion that can encourage exploration of the artist space. To do this, I simply use the Echo Nest get_similar call to walk the artist graph. Instead of getting bogged down in some graphics library to create the visualization, I just output ‘.DOT’ commands and render the whole thing using graphviz. Graphviz does all the hard work figuring out how to layout the graph. Here’s a tiny example of some graphviz output:
One of the problems with making these sort of graphs is that they can get extremely complicated, very quickly. Even after just a few steps away from the seed artist in the crawl of the artist graph there can be 100s of artists and 1000s of connections. Without some care, the graph quickly turns into an unreadable tangle. However, since we want to use these graphs for exploration of the artist space we can make a simplification that eliminates much of the complexity. For exploration, people tend to start from a known artist, and then proceed to lesser known artists. If we make our graph work in the same way, we will eliminate a large number of extraneous connections. Instead of connecting all artists that we encounter in our crawl of the artist graph, we only connect new artists to more popular artists that are already in the graph. This gives us an easy to manage directed, acyclic graph that flows from very familiar artists to unknown artists.
The pseudocode to do this is very simple:
add a seed artist to the work queue
while the work queue is not empty
curArtist <= the next artist from the queue
for each artist similar to curArtist
if similar artist less familiar than curArtist
plot link to similar artist
add similar artist to workqueue
The real java code is not much more complicated:
while (workQueue.size() > 0) {
Artist artist = workQueue.remove(0);
List<Scored<Artist>> simArtists = echoNest.getSimilarArtists(artist, 0, 6);
float familiarity = echoNest.getFamiliarity(artist);
for (Scored<Artist> scoredArtist : simArtists) {
Artist similarArtist = scoredArtist.getItem();
float simFamiliarity = echoNest.getFamiliarity(similarArtist);
if (simFamiliarity < familiarity) {
out.printf("\"%s\" -> \"%s\";\n", artist.getId(), similarArtist.getId());
if (!plottedSet.contains(similarArtist)) {
workQueue.add(similarArtist);
plottedSet.add(similarArtist);
out.printf("\"%s\" [label=\"%s\"]\n", similarArtist.getId(), similarArtist.getName());
}
}
}
}
This yields some fun graphs. Here’s a detail from a graph created using Led Zeppelin as the see artist:
And the full graph in all its glory is here:
I can think of all sorts of things to add to this artist graph. We could size the nodes based upon the familiarity of the artist. We could color the artists based upon how ‘hot‘ the artist is. We could replace the graphviz with a real graphing library like prefuse and make the whole graph interactive – so you could actively explore the artist space, click on a node, read reviews about the artist, listen to their music, watch their videos.
Astute readers may have noticed that I’m making calls using an EchoNest library. That’s one of the things I’ve been working on in the last week – building a Java client library for the EchoNest developer API. I’ll be releasing this soon, once I figure out the best way to release an open source client library here at The Echo Nest. I should hopefully get something released by the end of this week. If you are interested in a sneak preview of the Java client library, let me know.
Day #2 at the startup
Posted by Paul in Music, startup, The Echo Nest, web services on February 20, 2009
I just finished day #2 at my new job. Sorry to be so cagey about where I was going, but they wanted to keep it quiet until they could do a press release about it. I see the press release is public now, so I’m free to talk about my new job.
As many of the commenters have guessed, I’ve joined, as the director of the developer community, The Echo Nest – a company that is devoted to providing music intelligence for the next generation of online music application. In this role, I will work with the rest of the Echo Nest team to help grow an active, vibrant music application developer community around The Echo Nest developer API.
I’m really excited to be here at The Echo Nest. The Echo Nest has already established a reputation as a company that provides a new breed of hardcore music intelligence. The Echo Nest goes far beyond the “wisdom of the crowds” model of music discovery (“People who listened to the Beatles also listened to the Rolling Stones”). Instead of just data mining user behavior, The Echo Nest crawls the web to learn everything it can about music by analyzing what the world is saying about music. The Echo Nest also directly analyzes the audio content of music – extracting musical traits such as key, tempo, structure, timbre from the audio.
From this analysis of the social context, the user behavior and the actual audio, the Echo Nest gets a deep understanding of the entire world music. It knows which artists are getting the most buzz, which artists are getting stale, how and why artists are related, what words are being used to describe the music. This data goes far beyond the “if you like Britney, you might like Christina” level. The Echo Nest understands enough about music to be able to answer queries such as “make me a playlist of songs with a tempo of 90 beats per minute by an unknown emo artist that sounds something like Dashboard Confessional, and has violins”. The really neat thing is that the Echo Nest is exposing a lot of this functionality in their developer API. This lets anyone who is building a music application to tap into this large resource of music intelligence.
One of my main duties is to be the voice of the developer in the Echo Nest. I’ve written my fair share of music apps, so I have a good idea of some of the many pain points and difficulties that a music application developer has to face, but I’d like to hear more, so if you are developing a music application and you need a particular problem solved let me know – or better yet, post to The Echo Nest developer forums.
I’ll be writing a lot about The Echo Nest in upcoming posts – in particular about using the developer APIs, but I shall still continue to post about all of the interesting things going on the music space – so this blog won’t be too much different from Duke Listens!


