Posts Tagged songs
Some like it loud …
Posted by Paul in code, The Echo Nest, web services on October 6, 2010
One of the nifty features that we’ve rolled out in the last 6 months here at the Echo Nest is an extremely flexible song search API. With this API you can search for songs based upon all sorts of criteria from tempo, key mode, duration. You can use this API to do things that would be really hard to do. For example, here’s a bit of python that will show you the loudest songs for an artist:
from pyechonest import song as songAPI from pyechonest import artist as artistAPI def find_loudest_songs(artist_name): artists = artistAPI.search(artist_name, results=1) if artists: songs = songAPI.search(artist_id=artists[0].id, sort='loudness-desc') for song in songs: print song.get_audio_summary().loudness, song.title
Here are the loudest songs for some sample artists:
- The Beatles: Helter Skelter, Sgt Peppers Lonely Hearts Club Band
- Metallica: Cyanide, All Nightmare Long
- The White Stripes: Broken Bricks, Fell in love with a girl
- Led Zeppelin: Rock and Roll, Black Dog
We can easily change the code to help us find the softest songs for an artist, or the fastest, or the shortest. Some more examples:
- Shortest Beatles song: Her Majesty at 23.2 second
- Longest Beatles song: Revolution #9 at 8:35
- Slowest Beatles song: Julia at 57 BPMs
- Softest Beatles song: Julia at -27DB BPMs (Blackbird is at -25DB)
I think it is interesting to find the outliers. For instance, here’s the softest song by Muse (which is usually a very loud artist):
We can combine these attributes too so we can find the fastest loud Beatles song (I feel fine, at -7.5 DB and 180 BPM, or the slowest loud Beatles song (Don’t let me down, at -6.6 DB and 65 BPM).
The search songs api is a good example of the power of the Echo Nest platform. We have data on millions of songs that you can use to answer questions about music that have traditionally been very hard to answer.
The Echo Nest Song API
Posted by Paul in Music, The Echo Nest, web services on April 24, 2010
- Performance – api method calls run faster – on average API methods are running 3X faster than the older version.
- JSON Output – all of our methods now support JSON output in addition to XML. This greatly simplifies writing client libraries for the Echo Nest
- Nimble coding – with the new architecture it will be much easier for us to roll out new features – so expect to see new features added to the Echo Nest platform every month
- No cruft – we are revisiting our APIs to try to eliminate inconsistencies, redundancies and unnecessary features to make them as clean as we can.
The beta version of our next generation APIs are here: http://beta.developer.echonest.com/
The first significant new API we are adding is the Song API – this gives you all sorts of ways to search for and retrieve song level data. With the song API you can do the following:
- search for songs via artist name, song title, and description. You can affect the results with constraints and sorts:
- constrain the results by a number of factors including musical attributes like tempo, loudness, time signature and key, artist hotttnesss, location
- sort – the results by any of the attributes
- Find similar songs – find similar songs to a seed song
- Find profile – get all sorts of info about a song including audio, audio summary info, track data for different catalogs, song hottttnesss, artist_hotttnesss, artist_location, and detailed track analysis
- Identify songs – works in conjunction with the ENMFP
There are lots of things you can do with this API. Here’s just a quick sample of the types of queries you can make:
Find the loudest thrash songs
song/search?sort=loudness-desc&description=thrash
Find indie songs for jogging
song/search?min_tempo=120&description=indie&max_tempo=125
Fetch the tempo of Hey Jude
search?title=hey+jude&bucket=audio_summary&artist=the+beatles
Fetch the track audio and analysis of Bad Romance
search?title=bad+romance&bucket=tracks&bucket=id:paulify&artist=lady+gaga
Find songs similar to Bad Romance
song/similar?id=SOAOBBG127D9789749
- jen-api – a java client
- beta_pyechonest – a new branch of the venerable pyechonest library. Grab it from SVN with
svn checkout http://pyechonest.googlecode.com/svn/branches/ beta-pyechonest-read-only
I’ll be writing more about all of the new APIs real soon. Access the beta Echo Nest APIs here: