groovyでechonestを叩いてみる
http://echonest.com/ではネットと音楽のおもろそうな試みがいくつかされています。
そのうち「似ているアーティスト検索」、「サンプル音源やヴィデオの検索」、音源ファイルのBPM解析などはJavaライブラリが提供されているので、APIキー取得して、お試ししてみた。
//echonest import com.echonest.api.v3.artist.* import com.echonest.api.v3.EchoNestException def API_KEY = "<YOUR_API_KEY>" def artistName = "animal collective" ArtistAPI artistAPI //Artist Similarity try{ artistAPI = new ArtistAPI(API_KEY) def artists = artistAPI.searchArtist(artistName, false) artists.each{a-> println "Artist: "+a.name def similars = artistAPI.getSimilarArtists(a,0,10) println "- similar artists -" similars.each{s-> println s.item.name } println "---" } } catch(EchoNestException e){ println e } //Get Audio Sample artistAPI = new ArtistAPI(API_KEY) def artists = artistAPI.searchArtist(artistName,false) artists.each{a-> def audioList = artistAPI.getAudio(a,0,10) audioList.getDocuments().each{audio-> println "Artist: "+audio.artistName println "Title: "+audio.title println "Date: "+audio.date //java.util.Date println "Release: "+audio.release println "Length: "+audio.length //float println "Link: "+audio.link println "URL: "+audio.url println "---" } }
結果はこんなかんじ。
Artist: Animal Collective - similar artists - Avey Tare and Panda Bear Panda Bear The Olivia Tremor Control Avey Tare, Panda Bear & Geologist Grizzly Bear The Fiery Furnaces Gang Gang Dance Our Brother the Native Songs of Green Pheasant Deerhoof ---
Artist: Animal Collective Title: Leaf House Bad date format 2009-11-11T19:45:00 Date: null Release: 2009-05-18 - Royal Oak Music Theatre, Royal Oak, MI Length: 363.0 Link: http://themusicslut.com URL: http://www.archive.org/download/AnimalCollective2009-05-18.aud.flac16/AnimalCollective2009-05-18t03_vbr.mp3 --- Artist: Animal Collective Title: Purple Bottle Bad date format 2009-11-04T01:53:00 Date: null Release: Tavastia, Helsinki, Finland, 2006-07-03 Length: 665.0 Link: http://themusicslut.com URL: http://www.archive.org/download/acollective2006-07-03.aud.mc012.flac16/acollective2006-07-03t10_vbr.mp3 --- Artist: Animal Collective Title: Lay Lay Off, Faselam Bad date format 2009-10-29T07:44:00 Date: null Release: Campus in Diretto, Paris, France (Oct, 2005) Length: 173.0 Link: http://thefmly.com/ URL: http://thefmly.com/www/wp-content/uploads/2009/10/03-lay-lay-off-faselam.mp3 --- Artist: Animal Collective Title: The Purple Bottle Bad date format 2009-10-20T13:52:00 Date: null Release: Feels Length: 408.0 Link: http://www.aquariumdrunkard.com URL: http://aquariumdrunkard.org/songs/04%20The%20Purple%20Bottle.mp3 --- Artist: Animal Collective Title: Daily Routine (Phaseone Remix) Bad date format 2009-10-19T20:00:00 Date: null Release: White Collar Crime Length: 188.0 Link: http://pastaprima.net URL: http://fakepennycomics.com/blog/ACOLL_DailyRoutinePhaseoneRemix-1.mp3 --- Artist: Animal Collective Title: My Girls Bad date format 2009-10-17T19:51:00 Date: null Release: 2009-05-18 - Royal Oak Music Theatre, Royal Oak, MI Length: 498.0 Link: http://blog.largeheartedboy.com/ URL: http://www.archive.org/download/AnimalCollective2009-05-18.aud.flac16/AnimalCollective2009-05-18t04_vbr.mp3 --- Artist: Animal Collective Title: Bluish Bad date format 2009-10-15T13:54:00 Date: null Release: Merriweather Post Pavilion Length: 315.0 Link: http://thefmly.com/ URL: http://thefmly.com/www/wp-content/uploads/2009/10/06-bluish.mp3 --- Artist: Animal Collective Title: My Girls Bad date format 2009-10-15T13:53:00 Date: null Release: Merriweather Post Pavilion Length: 341.0 Link: http://troubledsoulsunite.blogspot.com URL: http://boxstr.com/files/6161261_pyejc/02%20My%20Girls.mp3 --- Artist: Animal Collective Title: What Would I Want Sky Bad date format 2009-10-14T05:01:00 Date: null Release: Stuart Maconie's Freak Zone, Length: 423.0 Link: http://indymusic.wordpress.com URL: http://indymusic.files.wordpress.com/2009/10/animal_collective-what_would_i_want_sky.mp3 --- Artist: Animal Collective Title: On a Highway Bad date format 2009-10-14T04:48:00 Date: null Release: BBC Session 2007 Length: 284.0 Link: http://gorillavsbear.blogspot.com URL: http://gvsbchris.com/02%20On%20a%20Highway.mp3 ---
おもろい! ひゃっほい!