Archive for category java


This looks like it’d be fun to play with:

Sync/Lost is a multi-user installation for immersion in the history of electronic music.  It’s like a multi-user version of Ishkur’s guide to EDM.  The installation can be used by three users simultaneously, with wiimote and headphones/soundspeakers. Each one interacts by choosing a style on the interface.  Made with Processing by 3bits.  I’d really  like to see this work with Echo Nest data.


Leave a comment

Goodnight Netbeans, Hello Eclipse

I’ve been a user of Netbeans, Sun’s Java IDE for about 5 years now. In general I’ve been pretty happy with it – it was the first IDE that made me want to give up using  VIM and a command line to develop Java.  However there have been some nagging issues in the last few releases.  Sometimes the Netbeans syntax highlighter will insist that there are syntax errors in the source when there are none.  No matter what I do, I can’t convince Netbeans that the code is good.  The code compiles and runs just fine, but Netbeans keeps telling me that there’s a problem with the code:

The ‘artist’ object indeed has a getHotness() method but Netbeans just doesn’t know about it.  There have been a few other problems – I’ve had to resort to the commandline for SVN – netbeans seems to get confused about my repository, and performance has always been a bit slow, (startup time in particular).

This week I saw that there’s a new release candidate for Netbeans 6.8. I downloaded and installed it, hoping that it would fix some of the problems I was having.  However, after using it for a few days I’m ready to toss it off my hard drive.

The performance of Netbeans on my system is abysmal.  The editor frequently freezes for 5 seconds or more,  likewise, I can’t scroll through a source file without seeing the beachball.  Even simple cursor movement can take a second for the editor to respond.  At first I assumed that there was something wrong with my install, so I uninstalled and re-installed, telling Netbeans to not import any of my old Netbeans data, but that didn’t help.  Looking at my CPU, I see that Netbeans wants to use nearly 100% of my CPU even when it is idling.

Compare the Netbeans CPU load to Eclipse as they both sit idle (this is after Netbeans has been running for 30 minutes at least, so it should be done with all of its scanning).   Now to be fair, I checked with SteveG – he said he hasn’t had any of these problems, so it seems that my performance issues with the new Netbeans are atypical, but that doesn’t really help me get my work done.

This week Google released GWT 2.0 – I’ve always been a big fan of GWT so I thought I’d give the new version a whirl.  GWT has really good Eclipse integration, so I used this as an excuse to give Eclipse a try.  So far, I like what I see.  The GWT and App engine integration is really well done.   I was able to create and deploy a GWT application to the Google app engine in about 30 minutes, while watching a rerun of the office (the episode where Dwight sets the office on fire and gives Stanley a heart attack).

And so, after using Netbeans for 5 years,  I’m ready to give Eclipse a try.  The next app from scratch I write I’ll use Eclipse.


The Spotified Billboard Charts – now with real playlists

Last month I Spotified the Billboard charts by using the Billboard and Spotify APIs.  However, I wasn’t actually able to create real Spotify playlists since the Spotify web API doesn’t allow creating or manipulating playlists.  But now I’m a premium Spotify user and as a premium user I can use the libspotify / despotify API to do just about anything that the official Spotify client can do.  With my new found Spotify superpower, I revamped my Billboard charts creator to create real Spotify playlists:

The Spotified Billboard Singles Charts

Instead of having to click on every song to listen to it, just click on the chart – this will open the Spotify playlist – hit play and you’ll be in Billboard chart heaven (or hell, depending on your music taste).

To interact with Spotify I used Jotify – a Java client library (based on despotify)  for Spotify.  Jotify is  well written, full featured library written by Felix Bruns (who has been extremely helpful in answering my questions).   I highly recommend Jotify.

, ,

1 Comment

The Echo Nest gets ready for Boston Music Hack Day

We’ve been extremely busy this week at the Echo Nest getting ready for the Boston Music Hack Day.  Not only have we been figuring out menus, panel room assignments, and dealing with a waitlist, we’ve also been releasing a set of new API features.  Here’s a quick rundown of what we’ve done:

  • get_images – a frequent request from developers – we now have an API method that will let you get images for an artist.   Note that we are releasing this method as a sneak preview for the hack day – we have images for over 60 thousand artists, but we will be aggressively adding more images  over the next few weeks (60 thousand artists is a lot of artists, but we’d like to have lots more).  We’ll also be expanding our sources of images to include many more sources. The results of the get_images are already good. 95% of the time you’ll get images. Over the next few weeks, the results will get even better.
  • get_biographies – another frequent request from developers – we now have a get_biographies API method that will return a set of artist biographies for any artist.  We currently have biographies for about a quarter million artists – and just as with get_images – we are working hard to expand the breadth and depth of this coverage.  Nevertheless, with coverage for a quarter million artists, 99.99% of the time when you ask for a biography we’ll have it.
  • get_similar – we’ve expanded the number of similar artists you can get back from get_similar from 15 to 100.  This gives you lots more info for building playlisting and music discovery apps.
  • buckets – one issue that our developers have had was that to fill out info on an artist often took a number of calls to the Echo Nest – one to get similars, one to get audio, one for video, familiarity, hotttnesss etc.  To fill out an artist page it could take half a dozen calls.  To reduce the number of calls needed to get artist information we’ve added a ‘bucket’ parameter to the search_artist, the get_similar and the get_profile calls.  The bucket parameter allows you to specify which additional artist info should be returned in the call.  You can specify ‘audio,’ ‘biographies,’ ‘blogs,’ ‘familiarity,’ ‘hotttnesss,’ ‘news,’ ‘reviews,’ ‘urls,’, ‘images’  or ‘video’ and whenever you get artist data back you’ll get the specified info included.    For example with the call:

    will return an artist block that looks like this:


There’s another new feature that we are starting to roll out. It’s called Echo Source – it allows the developer to get content (such as images, audio, video etc.) based upon license info.  Echo Source is a big deal and deserves a whole post – but that’s going to have to wait until after Music Hack Day. Suffice it to say that with Echo Source you’ll have a new level of control over what content the Echo Nest API returns.

We’ve updated our Java and Python libraries to support the new calls.  So grab yourself an API key and start writing some music apps.

, , ,


My Fame goes to 11

fameSten has released a new version of the ultra-cool,  award-winning Music Explorer FX.  It has a new feature: The Fame Knob.  While you are exploring for music you can set the Fame Knob up or down to control how well known or obscure the artists shown are.   If you are looking for mainstream artists set the Fame Knob to high. Looking for new, undiscovered artists? Set the Fame Knob to low.

Sten has also included a number of performance enhancements so everything runs super snappy.   Read more about the update on Sten’s blog and give it a whirl.


The Music Explorer FX. Click to launch the app.

, ,

Leave a comment

Music Explorer FX – Mobile Edition


Caption contest: what is the guy in the back thinking?

Sten has created a mobile music discovery application that runs on a mobile device.  The application shows similar artists using Echo Nest data.   You can read about the  app and give it a try (it runs on a desktop too), on Sten’s Blog:   Music Explorer FX Mobile Edition

, , ,


Updated Java client for the Echo Nest API

We’ve pushed out a new version of the open source Java client for the Echo Nest API.    The new version provides support for the different versions of the Echo Nest analyzer.  You can use the traditional,  but somewhat temperamental version 1 of the analyzer, or the spiffy new, ultra-stable version 3 of the analyzer.  By default, the Java client uses the new analyzer version, but if you need your application to work the exactly the same way that it did six months ago you can always use the older version.

Here’s a bit of Java code that will print out the tempo of all the songs in a directory:

void showBPMS(File dir) throws EchoNestException {
     TrackAPI trackAPI = new TrackAPI();
     File[] files = dir.listFiles();
     for (File f : files) {
         if (f.getAbsolutePath().toLowerCase().endsWith(".mp3")) {
             String id = trackAPI.uploadTrack(f, true);
             System.out.printf("Tempo 6%.3f %s\n",
                 trackAPI.getTempo(id).getValue(), f.getAbsoluteFile());

Running this code on a folder containing the new Breaking Benjamin album yields this output:

Tempo  85.57 /Users/plamere/Music/Amazon MP3/Breaking Benjamin/Dear Agony/01 - Fade Away.mp3
Tempo 108.01 /Users/plamere/Music/Amazon MP3/Breaking Benjamin/Dear Agony/02 - I Will Not Bow.mp3
Tempo 168.81 /Users/plamere/Music/Amazon MP3/Breaking Benjamin/Dear Agony/03 - Crawl.mp3
Tempo 156.75 /Users/plamere/Music/Amazon MP3/Breaking Benjamin/Dear Agony/04 - Give Me A Sign.mp3
Tempo  85.51 /Users/plamere/Music/Amazon MP3/Breaking Benjamin/Dear Agony/05 - Hopeless.mp3
Tempo  68.34 /Users/plamere/Music/Amazon MP3/Breaking Benjamin/Dear Agony/06 - What Lies Beneath.mp3
Tempo 116.94 /Users/plamere/Music/Amazon MP3/Breaking Benjamin/Dear Agony/07 - Anthem Of The Angels.mp3
Tempo  85.50 /Users/plamere/Music/Amazon MP3/Breaking Benjamin/Dear Agony/08 - Lights Out.mp3
Tempo 125.77 /Users/plamere/Music/Amazon MP3/Breaking Benjamin/Dear Agony/09 - Dear Agony.mp3
Tempo  94.99 /Users/plamere/Music/Amazon MP3/Breaking Benjamin/Dear Agony/10 - Into The Nothing.mp3
Tempo 160.38 /Users/plamere/Music/Amazon MP3/Breaking Benjamin/Dear Agony/11 - Without You.mp3

You can download the new Java client from the echo-nest-java-api code repository.  The new version is:

, , , , ,

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% 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% get_fam Decemberists
Familiarity for The Decemberists 0.8834854
nest% trackUpload  "09 When I'm Sixty-Four.MP3"
ID: baad7cab21b853ea5ead4db0a12b1df8
nest% trackDuration
Duration: 157.96104
nest% trackTempo
140.571 (0.717)

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

Music Explorer FX

Sten has posted a link to his super nifty Music  Explorer FX.  Music Explorer FX is  a Java Fx application for exploring and discovering music.  In some ways, the application is like a much slicker version of  Music Plasma or Musicovery.  You can explore a particular neighborhood in the music world – looking at artist photos and videos, listening to music, reading reviews and blog posts, and following paths to similar artists.    It’s a very engaging application that makes it easy to learn about new bands.    I especially like the image gallery mode – when I find a band that I think might be interesting, I hit the play button to listen to their music, and then enter the image gallery to get a slide show of the band playing.  Here’s an example of ‘Pull Tiger Tail’ – a band that I just learned about today while exploring with MEFX.


Sten uses a number of APIs to make MEFX happen. He uses the Echo Nest for artist search and to get all sorts of info including artist familiarity, hotness, artist similarity, blogs, news, reviews and audio. He gets artist images from Flickr and – and just to make sure he’s relevant in this Twitter-centric world, he uses the Twitter API to let you tweet about any interesting paths you’ve taken through the music space.

We are living in a remarkable world now – there’s such an incredible amount of music available. There are millions of artists creating music in all styles.  The challenge for today’s music listener is to find a way to navigate through this music space to find music that they will like.  Traditional music recommenders can help, but I really think that applications like the MEFX that enable exploration of the music space are going to be important tools for the adventurous music listener

, , , , ,


A glimpse of the Music Explorer

I noticed that Sten posted a photo from the JavaOne pavillion that happens to show the Music Explorer FX in the background.

Sten at JavaOne

Sten at JavaOne

Using my photo-forensic skills, I’ve extracted a detail that shows the Music Explorer FX:


Here you can see Franz Ferdinand, surrounded by a set of similar artists, as well as a audio player,  along with graphics that show familiarity and hotness (all derived from the Echo Nest).   The Music Explorer FX is pretty neat. I hope Sten releases it soon.

, ,