Posts Tagged web services

Getting Ready for Boston Music Hack Day

hackday.1.1.1.1

Boston Music Hack Day starts in exactly 10 days.  At the Hack day you’ll have about 24 hours of hacking time to build something really cool.   If you are going to the Hack Day you will want to maximize your hacking time, so here are a few tips to help you get ready.

  • Come with an idea or two but be flexible – one of the really neat bits about the Music Hack Day is working with someone that you’ve never met before. So have a few ideas in your back pocket, but keep your ears open on Saturday morning for people who are doing interesting things, introduce yourself and maybe you’ve made a team.  At previous hack days all the best hacks seem to be team efforts.  If you have an idea that you’d like some help on, or if you are just looking for someone to collaborate with, check out and/or post to the Music Hack Day Ideas Wiki.
  • Prep your APIs – there  are a number of  APIs that you might want to use to create your hack. Before you get to the Hack Day you might want to take a look at the APIs, figure out which ones you might want to use- and get ready to use them.  For instance, if you want to build music exploration and discovery tools or apps that remix music, you might be interested in the Echo Nest APIs.   To get a head start for the hack day before you get there you should register for an API Key,  browse the API documentation then check out our resources page for code examples and to find a client library in your favorite language.
  • Decide if you would like to win a prize – Of course the prime motivation is for hacking is the joy of building something really neat – but there will be some prizes awarded to the best hacks.  Some of the prizes are general prizes – but some are category prizes (‘best iPhone /  iPod hacks’) and some are company-specific prizes (best application that uses the Echo Nest APIs).  If you are shooting for a specific prize make sure you know what the conditions for the prize are.  (I have my eye on the Ultra 24 workstation and display, graciously donated by my Alma Mata).

To get the hack day jucies flowing check out this nifty slide deck on Music Hackday created by Henrik Berggren:

 

    , , , , , , , ,

    Leave a comment

    New news feed for developer.echonest.com

    en_logo_250x200_ltIf you are interested in keeping up with the latest news about the Echo Nest APIs you can now subscribe to a developer.echonest.com news feed where we are posting news and articles about the Echo Nest APIs.   Read more and subscribe at developer.echonest.com.

    ,

    Leave a comment

    Flash API for the Echo Nest

    It’s a busy week for client APIs at the Echo Nest.   Developer  Ryan Berdeen has released a Flash API for the Echo Nest.   Ryan’s API supports the track methods of the Echo Nest API,  giving the flash programmer the ability to analyze a track and get detailed info about the track including track metadata, loudness,  mode and key along with detailed information relating to the tracks rhythmic, timbrel, and harmonic content.

    One of the sticky bits in using the Echo Nest from Flash has been the track uploader.  People have had a hard time getting it to work – and since we don’t do very much Flash programming here at the nest it never made it to the top of the list of things to look into.  However, Ryan dug in an wrote a MultipartFormDataEncoder that works with the track upload API method – solving the problem not just for him, but for everyone.

    Ryan’s timing for this release is most excellent. This release comes just in time for Music Hackday – where hundreds of developers (presumably including a number of flash programmers) will be hacking away at the various music APIs including the Echo Nest.  Special thanks goes to Ryan for developing this API and making it available to the world

    , , ,

    Leave a comment

    New Echo Nest Java client released

    We’ve just released version 1.1 of the Echo Nest Java Client.  The Java Client makes it easy to access the Echo Nest APIs from a Java program.  This release fixes some bugs and improves caching support.   Here’s a snippet of Java code that shows how you can use the API to find similar artists for the band ‘Weezer’:

     ArtistAPI artistAPI = new ArtistAPI(MY_ECHO_NEST_API_KEY);
     List<Artist> artists = artistAPI.searchArtist("Weezer, false);
     if (artists.size() > 0) {
         for (Artist artist : artists) {
              List<Scored<Artist>> similars =
                    artistAPI.getSimilarArtists(artist, 0, 10);
              for (Scored<Artist> simArtist : similars) {
                   System.out.println("   " + simArtist.getItem());
              }
          }
      }

    Also included in the release is a command line shell that lets you interact with the Echo Nest API.   You can start it up from the command line like so:

        java  -DDECHO_NEST_API_KEY=YOUR_API_KEY -jar EchoNestAPI.jar

    Here’s an example session:

    Welcome to The Echo Nest API Shell
     type 'help'
    nest% help
    0) alias - adds a pseudonym or shorthand term for a command
    1) chain - execute multiple commands on a single line
    2) delay - pauses for a given number of seconds
    3) echo - display a line of text
    4) enid - gets the ENID for an arist
    5) gc - performs garbage collection
    6) getMaxCacheTime - gets the cache time
    7) get_audio - gets audio for an artist
    8) get_blogs - gets blogs for an artist
    9) get_fam - gets familiarity for an artist
    10) get_hot - gets hotttnesss for an artist
    11) get_news - gets news for an artist
    12) get_reviews - gets Reviews for an artist
    13) get_similar - finds similar artists
    14) get_similars - finds similar artists to a set of artists
    15) get_urls - gets Reviews for an artist
    16) get_video - gets video for an artist
    
    ( .. commands omitted  ..)
    
    53) trackTatums - gets the tatums of a track
    54) trackTempo - gets the overall Tempo of a track
    55) trackTimeSignature - gets the overall time signature of a track
    56) trackUpload - uploads a track
    57) trackUploadDir - uploads a directory of tracks
    58) trackWait - waits for an analysis to be complete
    59) version - displays version information
    nest%
    
    nest% get_similar weezer
    Similarity for Weezer
     1.00 The Smashing Pumpkins
     0.50 Ozma
     0.33 Fountains of Wayne
     0.25 Jimmy Eat World
     0.20 Veruca Salt
     0.17 The Breeders
     0.14 Nerf Herder
     0.13 The Flaming Lips
     0.11 Death Cab for Cutie
     0.10 Rivers Cuomo
     0.09 The Rentals
     0.08 Size 14
     0.08 Nada Surf
     0.07 Third Eye Blind
     0.07 Chopper One
    nest%
    
    nest% get_fam Decemberists
    Familiarity for The Decemberists 0.8834854
    nest%
    nest% trackUpload  "09 When I'm Sixty-Four.MP3"
    ID: baad7cab21b853ea5ead4db0a12b1df8
    nest% trackDuration
    Duration: 157.96104
    nest%
    nest% trackTempo
    140.571 (0.717)
    nest%

    If you are interested in playing around with the Echo Nest API but don’t want to code up your own application, typing in webservice URLs by hand gets pretty old, pretty quickly. The Echo Nest shell gives you a simpler way to try things out.

    , , ,

    1 Comment

    track upload sample code

    One of the biggest pain points users have with the Echo Nest developer API is with the track upload method.  This method lets  you upload a track for analysis (which can be subsequently retrieved by a number of other API method calls such as get_beats, get_key, get_loudness and so on).   The track upload, unlike all of the other of The Echo Nest methods requires you to construct a multipart/form-data post request. Since I get a lot of questions about track upload I decided that I needed to actually code my own to get a full understanding of how to do it – so that (1) I could answer detailed questions about the process and (2) point to my code as an example of how to do it.   I could have used a library (such as the Jakarta http client library) to do the heavy lifting but I wouldn’t have learned a thing nor would I have some code to point people at.  So I wrote some Java code (part of the forthcoming Java Client for the Echo Nest web services) that will do the upload.

    You can take a look at this post method in its google-code repository. The tricky bits about the multipart/form-data post is getting the multip-part form boundaries just right.  There’s a little dance one has to do with the proper carriage returns and linefeeds, and double-dash prefixes and double-dash suffixes and random boundary strings.  Debugging can be a pain in the neck too, because if you get it wrong,  typically the only diagnostic one gets is a ‘500 error’ which means something bad happened.

    Track upload can also be a pain in the neck because you need to wait 10 or 20 seconds for the track upload to finish and for the track analysis to complete.  This time can be quite problematic if you have thousands of tracks to analyze.  20 seconds * one thousand tracks is about 8 hours.  No one wants to wait that long to analyze a music collection.  However, it is possible to short circuit this analysis.  You can skip the upload entirely if we already have performed an analysis on your track of interest.   To see if an analysis of a track is already available you can perform a query such as ‘get_duration’ using the MD5 hash of the audio file.  If you get a result back then we’ve already done the analysis and you can skip the upload and just use the MD5 hash of your track as the ID for all of your queries.   With all of the apps out there using the track analysis API, (for instance, in just a week, donkdj has already analyzed over 30K tracks) our database of pre-cooked analyses is getting quite large – soon I suspect that you won’t need to perform an upload of most tracks (certainly not mainstream tracks). We will already have the data.

    , , , ,

    7 Comments