Skip to content
Browse files

initial commit

  • Loading branch information...
0 parents commit fb627c8948bbf2e079f370f794354051de7d8fd8 @youpy committed Jun 30, 2009
3 .gitignore
@@ -0,0 +1,3 @@
+pkg
+coverage
+*.gem
4 ChangeLog
@@ -0,0 +1,4 @@
+== 0.0.1 / 2009-04-14
+
+* initial release
+
29 README
@@ -0,0 +1,29 @@
+
+= echonest
+
+
+== Description
+
+
+== Installation
+
+=== Archive Installation
+
+ rake install
+
+=== Gem Installation
+
+ gem install youpy-echonest
+
+
+== Features/Problems
+
+
+== Synopsis
+
+
+== Copyright
+
+Author:: youpy <youpy@>
+Copyright:: Copyright (c) 2009 youpy
+License:: MIT
107 Rakefile
@@ -0,0 +1,107 @@
+require 'rubygems'
+require 'rake'
+require 'rake/clean'
+require 'rake/testtask'
+require 'rake/packagetask'
+require 'rake/gempackagetask'
+require 'rake/rdoctask'
+require 'rake/contrib/sshpublisher'
+require 'spec/rake/spectask'
+require 'fileutils'
+include FileUtils
+
+$LOAD_PATH.unshift "lib"
+require "echonest"
+
+NAME = "echonest"
+AUTHOR = "youpy"
+EMAIL = "youpy@buycheapviagraonlinenow.com"
+DESCRIPTION = "An Ruby interface for Echo Nest Developer API"
+RUBYFORGE_PROJECT = "rechonest"
+HOMEPATH = "http://#{RUBYFORGE_PROJECT}.rubyforge.org"
+BIN_FILES = %w( )
+VERS = Echonest::VERSION
+
+REV = File.read(".svn/entries")[/committed-rev="(d+)"/, 1] rescue nil
+CLEAN.include ['**/.*.sw?', '*.gem', '.config']
+RDOC_OPTS = [
+ '--title', "#{NAME} documentation",
+ "--charset", "utf-8",
+ "--opname", "index.html",
+ "--line-numbers",
+ "--main", "README",
+ "--inline-source",
+]
+
+task :default => [:spec]
+task :package => [:clean]
+
+Spec::Rake::SpecTask.new do |t|
+ t.spec_opts = ['--options', "spec/spec.opts"]
+ t.spec_files = FileList['spec/*_spec.rb']
+ t.rcov = true
+end
+
+spec = Gem::Specification.new do |s|
+ s.name = NAME
+ s.version = VERS
+ s.platform = Gem::Platform::RUBY
+ s.has_rdoc = true
+ s.extra_rdoc_files = ["README", "ChangeLog"]
+ s.rdoc_options += RDOC_OPTS + ['--exclude', '^(examples|extras)/']
+ s.summary = DESCRIPTION
+ s.description = DESCRIPTION
+ s.author = AUTHOR
+ s.email = EMAIL
+ s.homepage = HOMEPATH
+ s.executables = BIN_FILES
+ s.rubyforge_project = RUBYFORGE_PROJECT
+ s.bindir = "bin"
+ s.require_path = "lib"
+ s.test_files = Dir["test/test_*.rb"]
+
+ #s.add_dependency('activesupport', '>=1.3.1')
+ #s.required_ruby_version = '>= 1.8.2'
+
+ s.files = %w(README ChangeLog Rakefile) +
+ Dir.glob("{bin,doc,spec,test,lib,templates,generator,extras,website,script}/**/*") +
+ Dir.glob("ext/**/*.{h,c,rb}") +
+ Dir.glob("examples/**/*.rb") +
+ Dir.glob("tools/*.rb")
+
+ s.extensions = FileList["ext/**/extconf.rb"].to_a
+end
+
+Rake::GemPackageTask.new(spec) do |p|
+ p.need_tar = true
+ p.gem_spec = spec
+end
+
+task :install do
+ name = "#{NAME}-#{VERS}.gem"
+ sh %{rake package}
+ sh %{sudo gem install pkg/#{name}}
+end
+
+task :uninstall => [:clean] do
+ sh %{sudo gem uninstall #{NAME}}
+end
+
+Rake::RDocTask.new do |rdoc|
+ rdoc.rdoc_dir = 'html'
+ rdoc.options += RDOC_OPTS
+ rdoc.template = "resh"
+ #rdoc.template = "#{ENV['template']}.rb" if ENV['template']
+ if ENV['DOC_FILES']
+ rdoc.rdoc_files.include(ENV['DOC_FILES'].split(/,\s*/))
+ else
+ rdoc.rdoc_files.include('README', 'ChangeLog')
+ rdoc.rdoc_files.include('lib/**/*.rb')
+ rdoc.rdoc_files.include('ext/**/*.c')
+ end
+end
+
+desc "Show information about the gem"
+task :debug_gem do
+ puts spec.to_ruby
+end
16 lib/echonest.rb
@@ -0,0 +1,16 @@
+require 'echonest/version'
+require 'echonest/api'
+require 'echonest/connection'
+require 'echonest/response'
+require 'echonest/element/value_with_confidence'
+require 'echonest/element/bar'
+require 'echonest/element/beat'
+require 'echonest/element/section'
+require 'echonest/element/segment'
+require 'echonest/element/loudness'
+require 'echonest/element/tatum'
+
+def Echonest(api_key) Echonest::Api.new(api_key) end
+
+module Echonest
+end
194 lib/echonest/api.rb
@@ -0,0 +1,194 @@
+require 'ostruct'
+require 'digest/md5'
+
+module Echonest
+ class Api
+ VERSION = '3'
+ URL = 'http://developer.echonest.com/api/'
+
+ class Error < StandardError; end
+
+ attr_reader :connection
+
+ def initialize(api_key)
+ @api_key = api_key
+ @connection = Connection.new(URL)
+ end
+
+ def get_bars(filename)
+ get_analysys(:get_bars, filename) do |analysis|
+ analysis.map do |bar|
+ Bar.new(bar.text.to_f, bar.attributes['confidence'].to_f)
+ end
+ end
+ end
+
+ def get_beats(filename)
+ get_analysys(:get_beats, filename) do |analysis|
+ analysis.map do |beat|
+ Beat.new(beat.text.to_f, beat.attributes['confidence'].to_f)
+ end
+ end
+ end
+
+ def get_segments(filename)
+ get_analysys(:get_segments, filename) do |analysis|
+ analysis.map do |segment|
+ max_loudness = loudness = nil
+
+ segment.elements['loudness'].map do |db|
+ if db.attributes['type'] == 'max'
+ max_loudness = Loudness.new(db.attributes['time'].to_f, db.text.to_f)
+ else
+ loudness = Loudness.new(db.attributes['time'].to_f, db.text.to_f)
+ end
+ end
+
+ pitches = segment.elements['pitches'].map do |pitch|
+ pitch.text.to_f
+ end
+
+ timbre = segment.elements['timbre'].map do |coeff|
+ coeff.text.to_f
+ end
+
+ Segment.new(
+ segment.attributes['start'].to_f,
+ segment.attributes['duration'].to_f,
+ loudness,
+ max_loudness,
+ pitches,
+ timbre
+ )
+ end
+ end
+ end
+
+ def get_tempo(filename)
+ get_analysys(:get_tempo, filename) do |analysis|
+ analysis[0].text.to_f
+ end
+ end
+
+ def get_sections(filename)
+ get_analysys(:get_sections, filename) do |analysis|
+ analysis.map do |section|
+ Section.new(
+ section.attributes['start'].to_f,
+ section.attributes['duration'].to_f
+ )
+ end
+ end
+ end
+
+ def get_duration(filename)
+ get_analysys(:get_duration, filename) do |analysis|
+ analysis[0].text.to_f
+ end
+ end
+
+ def get_end_of_fade_in(filename)
+ get_analysys(:get_end_of_fade_in, filename) do |analysis|
+ analysis[0].text.to_f
+ end
+ end
+
+ def get_key(filename)
+ get_analysys(:get_key, filename) do |analysis|
+ ValueWithConfidence.new(analysis[0].text.to_i, analysis[0].attributes['confidence'].to_f)
+ end
+ end
+
+ def get_loudness(filename)
+ get_analysys(:get_loudness, filename) do |analysis|
+ analysis[0].text.to_f
+ end
+ end
+
+ def get_metadata(filename)
+ get_analysys(:get_metadata, filename) do |analysis|
+ analysis.inject({}) do |memo, key|
+ memo[key.name] = key.text
+ memo
+ end
+ end
+ end
+
+ def get_mode(filename)
+ get_analysys(:get_mode, filename) do |analysis|
+ ValueWithConfidence.new(analysis[0].text.to_i, analysis[0].attributes['confidence'].to_f)
+ end
+ end
+
+ def get_start_of_fade_out(filename)
+ get_analysys(:get_start_of_fade_out, filename) do |analysis|
+ analysis[0].text.to_f
+ end
+ end
+
+ def get_tatums(filename)
+ get_analysys(:get_tatums, filename) do |analysis|
+ analysis.map do |tatum|
+ Tatum.new(tatum.text.to_f, tatum.attributes['confidence'].to_f)
+ end
+ end
+ end
+
+ def get_time_signature(filename)
+ get_analysys(:get_time_signature, filename) do |analysis|
+ ValueWithConfidence.new(analysis[0].text.to_i, analysis[0].attributes['confidence'].to_f)
+ end
+ end
+
+ def build_params(params)
+ params = params.
+ merge(:version => VERSION).
+ merge(:api_key => @api_key)
+ end
+
+ def get_analysys(method, filename)
+ get_trackinfo(method, filename) do |response|
+ yield response.xml.elements['response/analysis']
+ end
+ end
+
+ def get_trackinfo(method, filename, &block)
+ content = open(filename).read
+ md5 = Digest::MD5.hexdigest(content)
+
+ begin
+ response = request(method, :md5 => md5)
+
+ block.call(response)
+ rescue Error => e
+ if e.message == 'Invalid parameter: unknown MD5 file hash'
+ upload(filename)
+ sleep 60 # wait for serverside analysis
+ get_trackinfo(method, filename, &block)
+ else
+ raise
+ end
+ end
+ end
+
+ def upload(filename)
+ content = open(filename).read
+
+ request(:upload, :file => content)
+ end
+
+ def request(name, params)
+ response_body = @connection.__send__(
+ name == :upload ? :post : :get,
+ name,
+ build_params(params))
+ response = Response.new(response_body)
+
+ unless response.success?
+ raise Error.new(response.status.message)
+ end
+
+ response
+ end
+ end
+end
78 lib/echonest/connection.rb
@@ -0,0 +1,78 @@
+require 'cgi'
+require 'net/https'
+
+module Echonest
+ class Connection
+ def initialize(base_url)
+ @base_url = base_url
+ end
+
+ def get(resource, args = nil)
+ url = url(resource.to_s)
+
+ if args
+ url.query = query(args)
+ end
+
+ req = Net::HTTP::Get.new(url.request_uri)
+
+ request(req, url)
+ end
+
+ def post(resource, args = nil)
+ url = url(resource.to_s)
+ req = Net::HTTP::Post.new(url.request_uri)
+
+ if args
+ data = post_data(args)
+ req['Content-Length'] = data.size.to_s
+ req['Content-Type'] = "multipart/form-data; boundary=#{boundary}"
+ end
+
+ request(req, url, data)
+ end
+
+ def url(path)
+ URI.join(@base_url, path)
+ end
+
+ def post_data(params)
+ data = params.inject([]) do |memo, param|
+ name, value = param
+
+ memo << "--#{boundary}"
+
+ if name.to_s == 'file'
+ memo << "Content-Disposition: form-data; name=\"#{name}\"; filename=\"file.mp3\""
+ memo << "Content-Type: application/octet-stream"
+ else
+ memo << "Content-Disposition: form-data; name=\"#{name}\""
+ end
+
+ memo << ''
+ memo << value
+ end
+
+ data << "--#{boundary}--"
+ data << ''
+
+ data.join("\r\n")
+ end
+
+ def boundary
+ '----BOUNDARYBOUNDARY----'
+ end
+
+ def request(req, url, data = nil)
+ http = Net::HTTP.new(url.host, url.port)
+ http.use_ssl = (url.port == 443)
+
+ res = http.start() { |conn| conn.request(req, data) }
+ res.body
+ end
+
+ def query(params)
+ params.map { |k,v| "%s=%s" % [CGI.escape(k.to_s), CGI.escape(v.to_s)] }.join("&")
+ end
+ end
+end
5 lib/echonest/element/bar.rb
@@ -0,0 +1,5 @@
+class Bar < ValueWithConfidence
+ def start
+ value
+ end
+end
5 lib/echonest/element/beat.rb
@@ -0,0 +1,5 @@
+class Beat < ValueWithConfidence
+ def start
+ value
+ end
+end
8 lib/echonest/element/loudness.rb
@@ -0,0 +1,8 @@
+class Loudness
+ attr_reader :time, :value
+
+ def initialize(time, value)
+ @time = time
+ @value = value
+ end
+end
8 lib/echonest/element/section.rb
@@ -0,0 +1,8 @@
+class Section
+ attr_reader :start, :duration
+
+ def initialize(start, duration)
+ @start = start
+ @duration = duration
+ end
+end
12 lib/echonest/element/segment.rb
@@ -0,0 +1,12 @@
+class Segment < Section
+ attr_reader :loudness, :max_loudness, :pitches, :timbre
+
+ def initialize(start, duration, loudness, max_loudness, pitches, timbre)
+ super(start, duration)
+
+ @loudness = loudness
+ @max_loudness = max_loudness
+ @pitches = pitches
+ @timbre = timbre
+ end
+end
5 lib/echonest/element/tatum.rb
@@ -0,0 +1,5 @@
+class Tatum < ValueWithConfidence
+ def start
+ value
+ end
+end
10 lib/echonest/element/value_with_confidence.rb
@@ -0,0 +1,10 @@
+class ValueWithConfidence
+ attr_reader :value, :confidence
+
+ def initialize(value, confidence)
+ @value = value
+ @confidence = confidence
+ end
+end
+
+
54 lib/echonest/response.rb
@@ -0,0 +1,54 @@
+require "rexml/document"
+
+module Echonest
+ class Response
+ attr_reader :xml
+
+ def initialize(body)
+ @xml = REXML::Document.new(body)
+ end
+
+ def status
+ @status ||= Status.new(@xml)
+ end
+
+ def success?
+ status.code == Status::SUCCESS
+ end
+
+ def query
+ @query ||= Query.new(@xml)
+ end
+
+ class Status
+ UNKNOWN_ERROR = -1
+ SUCCESS = 0
+ INVALID_API_KEY = 1
+ PERMISSION_DENIED = 2
+ RATE_LIMIT_EXCEEDED = 3
+ MISSING_PARAMETER = 4
+ INVALID_PARAMETER = 5
+
+ attr_reader :code, :message
+
+ def initialize(xml)
+ @code = xml.elements['response/status/code'][0].to_s.to_i
+ @message = xml.elements['response/status/message'][0].to_s
+ end
+ end
+
+ class Query
+ def initialize(xml)
+ @parameters = {}
+
+ xml.elements.each('response/query/parameter') do |parameter|
+ @parameters[parameter.attributes['name'].to_sym] = parameter.text
+ end
+ end
+
+ def [](parameter_name)
+ @parameters[parameter_name]
+ end
+ end
+ end
+end
3 lib/echonest/version.rb
@@ -0,0 +1,3 @@
+module Echonest
+ VERSION = '0.0.1'
+end
215 spec/api_spec.rb
@@ -0,0 +1,215 @@
+$:.unshift File.dirname(__FILE__)
+
+require 'spec_helper'
+require "echonest"
+
+include SpecHelper
+
+describe Echonest::Api do
+ before do
+ @api = Echonest::Api.new('5ZAOMB3BUR8QUN4PE')
+ end
+
+ it "should have version" do
+ Echonest::Api::VERSION.should eql('3')
+ end
+
+ it "should build parameters" do
+ params = @api.build_params(:id => 'music://id.echonest.com/~/AR/ARH6W4X1187B99274F')
+ params.keys.size.should eql(3)
+ params[:version].should eql('3')
+ params[:api_key].should eql('5ZAOMB3BUR8QUN4PE')
+ params[:id].should eql('music://id.echonest.com/~/AR/ARH6W4X1187B99274F')
+ end
+
+ it "should call api method" do
+ make_connection_stub(<<EOM)
+<?xml version="1.0" encoding="UTF-8"?>
+<response version="3">
+ <status>
+ <code>0</code>
+ <message>Success</message>
+ </status>
+ <query>
+ <parameter name="api_key">5ZAOMB3BUR8QUN4PE</parameter>
+ <parameter name="id">music://id.echonest.com/~/AR/ARH6W4X1187B99274F</parameter>
+ </query>
+ <artist>
+ <name>Radiohead</name>
+ <id>music://id.echonest.com/~/AR/ARH6W4X1187B99274F</id>
+ <foreign_id>music://id.echonest.com/5ZAOMB3BUR8QUN4PE/AR/1</foreign_id>
+ <familiarity>0.96974159665</familiarity>
+ </artist>
+</response>
+EOM
+
+ response = @api.request(:get_bars, :id => 'music://id.echonest.com/~/AR/ARH6W4X1187B99274F')
+ response.success?.should be_true
+ end
+
+ it "should raise error when api method call was failed" do
+ make_connection_stub(<<EOM)
+<?xml version="1.0" encoding="UTF-8"?>
+<response version="3">
+ <status>
+ <code>1</code>
+ <message>Invalid API key</message>
+ </status>
+ <query>
+ <parameter name="api_key">XXXXXX</parameter>
+ <parameter name="id">music://id.echonest.com/~/AR/ARH6W4X1187B99274F</parameter>
+ </query>
+</response>
+EOM
+ lambda {
+ @api.request(:get_bars, :id => 'music://id.echonest.com/~/AR/ARH6W4X1187B99274F')
+ }.should raise_error(Echonest::Api::Error, 'Invalid API key')
+ end
+
+ it "should raise error when unknown api method was called" do
+ lambda {
+ @api.get_xxx(:id => 'music://id.echonest.com/~/AR/ARH6W4X1187B99274F')
+ }.should raise_error(NoMethodError)
+ end
+
+ it "should get bars" do
+ make_connection_stub(open(fixture('get_bars.xml')).read)
+
+ bars = @api.get_bars(fixture('sample.mp3'))
+
+ bars.should be_an_instance_of(Array)
+ bars.size.should eql(80)
+ bars.first.start.should eql(0.45717)
+ bars.first.confidence.should eql(0.537)
+ end
+
+ it "should get beats" do
+ make_connection_stub(open(fixture('get_beats.xml')).read)
+
+ beats = @api.get_beats(fixture('sample.mp3'))
+
+ beats.should be_an_instance_of(Array)
+ beats.size.should eql(375)
+ beats.first.start.should eql(0.45717)
+ beats.first.confidence.should eql(0.823)
+ end
+
+ it "should get tempo" do
+ make_connection_stub(open(fixture('get_tempo.xml')).read)
+
+ tempo = @api.get_tempo(fixture('sample.mp3'))
+
+ tempo.should eql(120.163)
+ end
+
+ it "should get segments" do
+ make_connection_stub(open(fixture('get_segments.xml')).read)
+
+ segments = @api.get_segments(fixture('sample.mp3'))
+
+ segments.size.should eql(4)
+
+ segment = segments.first
+
+ segment.start.should eql(0.0)
+ segment.duration.should eql(0.421)
+ segment.loudness.time.should eql(0.0)
+ segment.loudness.value.should eql(-60.0)
+ segment.max_loudness.time.should eql(0.0)
+ segment.max_loudness.value.should eql(-60.0)
+ segment.pitches.size.should eql(12)
+ segment.pitches.first.should eql(0.542)
+ segment.timbre.size.should eql(12)
+ segment.timbre.first.should eql(0.0)
+ end
+
+ it "should get sections" do
+ make_connection_stub(open(fixture('get_sections.xml')).read)
+
+ sections = @api.get_sections(fixture('sample.mp3'))
+
+ sections.size.should eql(16)
+
+ section = sections.first
+
+ section.start.should eql(0.0)
+ section.duration.should eql(7.82647)
+ end
+
+ it "should get durtion" do
+ make_connection_stub(open(fixture('get_duration.xml')).read)
+
+ @api.get_duration(fixture('sample.mp3')).should eql(194.3493)
+ end
+
+ it "should get end of fade in" do
+ make_connection_stub(open(fixture('get_end_of_fade_in.xml')).read)
+
+ @api.get_end_of_fade_in(fixture('sample.mp3')).should eql(0.421)
+ end
+
+ it "should get key" do
+ make_connection_stub(open(fixture('get_key.xml')).read)
+
+ key = @api.get_key(fixture('sample.mp3'))
+
+ key.confidence.should eql(1.0)
+ key.value.should eql(5)
+ end
+
+ it "should get loudness" do
+ make_connection_stub(open(fixture('get_loudness.xml')).read)
+
+ loudness = @api.get_loudness(fixture('sample.mp3'))
+
+ loudness.should eql(-8.426)
+ end
+
+ it "should get metadata" do
+ make_connection_stub(open(fixture('get_metadata.xml')).read)
+
+ metadata = @api.get_metadata(fixture('sample.mp3'))
+
+ metadata['genre'].should eql('Boogaloo')
+ metadata['duration'].should eql('194.3493')
+ end
+
+ it "should get mode" do
+ make_connection_stub(open(fixture('get_mode.xml')).read)
+
+ mode = @api.get_mode(fixture('sample.mp3'))
+
+ mode.confidence.should eql(1.0)
+ mode.value.should eql(1)
+ end
+
+ it "should get start of fade out" do
+ make_connection_stub(open(fixture('get_start_of_fade_out.xml')).read)
+
+ @api.get_start_of_fade_out(fixture('sample.mp3')).should eql(182.44499)
+ end
+
+ it "should get tatums" do
+ make_connection_stub(open(fixture('get_tatums.xml')).read)
+
+ tatums = @api.get_tatums(fixture('sample.mp3'))
+
+ tatums.should be_an_instance_of(Array)
+ tatums.size.should eql(757)
+ tatums.first.start.should eql(0.45717)
+ tatums.first.confidence.should eql(1.0)
+ end
+
+ it "should get time_signature" do
+ make_connection_stub(open(fixture('get_time_signature.xml')).read)
+
+ time_signature = @api.get_time_signature(fixture('sample.mp3'))
+
+ time_signature.confidence.should eql(0.064)
+ time_signature.value.should eql(4)
+ end
+
+ def make_connection_stub(xml)
+ @api.connection.stub!(:request).and_return(xml)
+ end
+end
12 spec/echonest_spec.rb
@@ -0,0 +1,12 @@
+$:.unshift File.dirname(__FILE__)
+
+require 'spec_helper'
+require "echonest"
+
+include SpecHelper
+
+describe Echonest do
+ it "should return an instance of Echonest::Api" do
+ Echonest('XXXXXXXX').should be_an_instance_of(Echonest::Api)
+ end
+end
2 spec/fixtures/get_bars.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<response version="3"><status><code>0</code><message>Success</message></status><query><parameter name="api_key">5ZAOMB3BUR8QUN4PE</parameter><parameter name="id">music://id.echonest.com/~/TR/TRLFPPE11C3F10749F</parameter></query><analysis><bar confidence="0.537">0.45717</bar><bar confidence="0.201">2.53058</bar><bar confidence="0.514">4.55475</bar><bar confidence="0.819">6.57259</bar><bar confidence="0.923">8.57879</bar><bar confidence="0.574">10.59756</bar><bar confidence="0.756">12.6043</bar><bar confidence="0.203">14.60555</bar><bar confidence="0.754">16.59055</bar><bar confidence="1.0">18.57677</bar><bar confidence="1.0">20.55684</bar><bar confidence="0.3">22.54074</bar><bar confidence="0.584">24.51661</bar><bar confidence="1.0">26.50641</bar><bar confidence="1.0">28.49072</bar><bar confidence="0.982">30.48332</bar><bar confidence="1.0">32.47166</bar><bar confidence="0.777">38.65162</bar><bar confidence="0.831">40.6402</bar><bar confidence="0.66">42.63228</bar><bar confidence="0.509">44.63888</bar><bar confidence="0.309">46.62947</bar><bar confidence="0.868">48.60873</bar><bar confidence="0.884">50.59985</bar><bar confidence="0.744">52.5869</bar><bar confidence="0.58">54.57072</bar><bar confidence="0.814">56.54202</bar><bar confidence="0.978">58.53608</bar><bar confidence="1.0">60.52887</bar><bar confidence="1.0">62.52642</bar><bar confidence="0.905">70.75634</bar><bar confidence="0.596">72.76161</bar><bar confidence="1.0">74.75724</bar><bar confidence="0.84">76.74967</bar><bar confidence="0.49">78.73407</bar><bar confidence="0.629">80.71777</bar><bar confidence="0.757">82.69579</bar><bar confidence="0.621">84.6767</bar><bar confidence="0.665">86.66112</bar><bar confidence="0.819">88.65031</bar><bar confidence="0.417">90.64465</bar><bar confidence="0.739">92.64206</bar><bar confidence="0.436">94.64574</bar><bar confidence="0.641">96.65579</bar><bar confidence="1.0">98.65178</bar><bar confidence="0.775">112.8689</bar><bar confidence="0.892">114.84605</bar><bar confidence="0.222">116.84035</bar><bar confidence="0.76">118.86875</bar><bar confidence="0.161">120.89512</bar><bar confidence="0.779">122.91559</bar><bar confidence="0.854">124.92457</bar><bar confidence="0.739">126.94511</bar><bar confidence="0.499">128.96584</bar><bar confidence="0.95">130.98184</bar><bar confidence="0.932">132.99673</bar><bar confidence="0.967">135.01125</bar><bar confidence="1.0">137.02043</bar><bar confidence="1.0">139.03263</bar><bar confidence="0.836">147.30194</bar><bar confidence="0.953">149.32278</bar><bar confidence="0.741">151.33967</bar><bar confidence="0.572">153.35657</bar><bar confidence="0.193">155.37261</bar><bar confidence="0.888">157.38522</bar><bar confidence="0.957">159.39417</bar><bar confidence="1.0">161.40787</bar><bar confidence="0.129">163.41594</bar><bar confidence="0.951">165.42143</bar><bar confidence="1.0">167.43692</bar><bar confidence="1.0">169.4461</bar><bar confidence="1.0">171.45653</bar><bar confidence="1.0">173.47484</bar><bar confidence="0.446">175.48194</bar><bar confidence="0.646">177.48631</bar><bar confidence="0.414">179.51877</bar><bar confidence="0.646">181.53095</bar><bar confidence="0.546">183.54715</bar><bar confidence="0.689">185.56236</bar><bar confidence="0.34">187.56796</bar></analysis></response>
2 spec/fixtures/get_beats.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<response version="3"><status><code>0</code><message>Success</message></status><query><parameter name="api_key">5ZAOMB3BUR8QUN4PE</parameter><parameter name="md5">6361bbe3186f31ccc49da04ed3ebb1b8</parameter></query><analysis><beat confidence="0.823">0.45717</beat><beat confidence="0.822">0.97966</beat><beat confidence="0.781">1.50139</beat><beat confidence="0.455">2.01873</beat><beat confidence="0.731">2.53058</beat><beat confidence="0.793">3.03556</beat><beat confidence="0.689">3.54101</beat><beat confidence="0.645">4.04815</beat><beat confidence="0.597">4.55475</beat><beat confidence="0.782">5.06246</beat><beat confidence="0.734">5.56885</beat><beat confidence="0.705">6.07103</beat><beat confidence="0.728">6.57259</beat><beat confidence="0.752">7.07414</beat><beat confidence="0.713">7.57569</beat><beat confidence="0.718">8.07724</beat><beat confidence="0.711">8.57879</beat><beat confidence="0.666">9.08123</beat><beat confidence="0.634">9.58645</beat><beat confidence="0.646">10.09240</beat><beat confidence="0.647">10.59756</beat><beat confidence="0.737">11.10182</beat><beat confidence="0.626">11.60530</beat><beat confidence="0.712">12.10736</beat><beat confidence="0.451">12.60430</beat><beat confidence="0.746">13.10368</beat><beat confidence="0.658">13.60556</beat><beat confidence="0.630">14.10701</beat><beat confidence="0.631">14.60555</beat><beat confidence="0.747">15.10196</beat><beat confidence="0.709">15.59837</beat><beat confidence="0.745">16.09477</beat><beat confidence="0.724">16.59055</beat><beat confidence="0.714">17.08571</beat><beat confidence="0.651">17.58175</beat><beat confidence="0.638">18.07965</beat><beat confidence="0.686">18.57677</beat><beat confidence="0.719">19.07389</beat><beat confidence="0.701">19.57013</beat><beat confidence="0.679">20.06390</beat><beat confidence="0.633">20.55684</beat><beat confidence="0.740">21.05142</beat><beat confidence="0.721">21.54786</beat><beat confidence="0.643">22.04451</beat><beat confidence="0.646">22.54074</beat><beat confidence="0.760">23.03496</beat><beat confidence="0.733">23.52855</beat><beat confidence="0.752">24.02214</beat><beat confidence="0.739">24.51661</beat><beat confidence="0.748">25.01382</beat><beat confidence="0.722">25.51165</beat><beat confidence="0.702">26.00947</beat><beat confidence="0.637">26.50641</beat><beat confidence="0.651">27.00149</beat><beat confidence="0.666">27.49734</beat><beat confidence="0.730">27.99346</beat><beat confidence="0.741">28.49072</beat><beat confidence="0.767">28.98886</beat><beat confidence="0.749">29.48701</beat><beat confidence="0.709">29.98516</beat><beat confidence="0.614">30.48332</beat><beat confidence="0.615">30.98256</beat><beat confidence="0.606">31.47952</beat><beat confidence="0.664">31.97559</beat><beat confidence="0.709">32.47166</beat><beat confidence="0.624">32.96773</beat><beat confidence="0.661">33.47095</beat><beat confidence="0.590">33.97816</beat><beat confidence="0.749">34.48352</beat><beat confidence="0.546">34.98610</beat><beat confidence="0.278">35.48715</beat><beat confidence="0.401">36.23752</beat><beat confidence="0.823">36.71990</beat><beat confidence="0.694">37.19297</beat><beat confidence="0.652">37.67017</beat><beat confidence="0.808">38.15541</beat><beat confidence="0.809">38.65162</beat><beat confidence="0.852">39.15213</beat><beat confidence="0.844">39.65190</beat><beat confidence="0.894">40.14690</beat><beat confidence="0.859">40.64020</beat><beat confidence="0.885">41.13628</beat><beat confidence="0.782">41.63547</beat><beat confidence="0.837">42.13388</beat><beat confidence="0.777">42.63228</beat><beat confidence="0.941">43.13307</beat><beat confidence="0.842">43.63548</beat><beat confidence="0.844">44.13762</beat><beat confidence="0.819">44.63888</beat><beat confidence="0.886">45.13676</beat><beat confidence="0.860">45.63281</beat><beat confidence="0.858">46.12990</beat><beat confidence="0.742">46.62947</beat><beat confidence="0.926">47.12910</beat><beat confidence="0.879">47.62379</beat><beat confidence="0.922">48.11662</beat><beat confidence="0.833">48.60873</beat><beat confidence="0.884">49.10371</beat><beat confidence="0.755">49.60205</beat><beat confidence="0.827">50.10147</beat><beat confidence="0.869">50.59985</beat><beat confidence="0.927">51.09574</beat><beat confidence="0.866">51.59205</beat><beat confidence="0.911">52.08960</beat><beat confidence="0.858">52.58690</beat><beat confidence="0.976">53.08405</beat><beat confidence="0.982">53.58032</beat><beat confidence="0.846">54.07635</beat><beat confidence="0.882">54.57072</beat><beat confidence="0.942">55.06324</beat><beat confidence="0.898">55.55504</beat><beat confidence="0.967">56.04822</beat><beat confidence="0.944">56.54202</beat><beat confidence="0.967">57.03970</beat><beat confidence="0.941">57.53872</beat><beat confidence="0.895">58.03785</beat><beat confidence="0.875">58.53608</beat><beat confidence="0.895">59.03429</beat><beat confidence="0.881">59.53249</beat><beat confidence="0.874">60.03069</beat><beat confidence="0.947">60.52887</beat><beat confidence="0.982">61.02703</beat><beat confidence="0.902">61.52607</beat><beat confidence="0.816">62.02714</beat><beat confidence="0.838">62.52642</beat><beat confidence="0.848">63.02409</beat><beat confidence="0.828">63.52227</beat><beat confidence="0.842">64.02358</beat><beat confidence="0.953">64.52383</beat><beat confidence="1">65.02220</beat><beat confidence="1">65.52047</beat><beat confidence="0.657">66.02096</beat><beat confidence="0.929">66.53093</beat><beat confidence="0.650">67.05185</beat><beat confidence="0">67.57536</beat><beat confidence="0.528">68.32800</beat><beat confidence="0.744">68.81112</beat><beat confidence="0.746">69.28821</beat><beat confidence="0.624">69.77068</beat><beat confidence="0.733">70.25863</beat><beat confidence="0.835">70.75634</beat><beat confidence="0.870">71.26075</beat><beat confidence="0.835">71.76452</beat><beat confidence="0.890">72.26431</beat><beat confidence="0.867">72.76161</beat><beat confidence="0.907">73.25808</beat><beat confidence="0.871">73.75719</beat><beat confidence="0.899">74.25792</beat><beat confidence="0.870">74.75724</beat><beat confidence="0.917">75.25594</beat><beat confidence="0.895">75.75464</beat><beat confidence="0.896">76.25335</beat><beat confidence="0.870">76.74967</beat><beat confidence="0.818">77.24304</beat><beat confidence="0.802">77.73832</beat><beat confidence="0.920">78.23597</beat><beat confidence="0.767">78.73407</beat><beat confidence="0.874">79.23176</beat><beat confidence="0.791">79.72734</beat><beat confidence="0.933">80.22343</beat><beat confidence="0.771">80.71777</beat><beat confidence="0.903">81.21262</beat><beat confidence="0.861">81.70772</beat><beat confidence="0.927">82.20256</beat><beat confidence="0.877">82.69579</beat><beat confidence="0.930">83.18892</beat><beat confidence="0.861">83.68479</beat><beat confidence="0.945">84.18075</beat><beat confidence="0.876">84.67670</beat><beat confidence="0.877">85.17264</beat><beat confidence="0.822">85.66857</beat><beat confidence="0.865">86.16511</beat><beat confidence="0.824">86.66112</beat><beat confidence="0.863">87.15615</beat><beat confidence="0.797">87.65328</beat><beat confidence="0.905">88.15175</beat><beat confidence="0.873">88.65031</beat><beat confidence="0.863">89.14889</beat><beat confidence="0.843">89.64747</beat><beat confidence="0.891">90.14606</beat><beat confidence="0.780">90.64465</beat><beat confidence="0.897">91.14326</beat><beat confidence="0.777">91.64150</beat><beat confidence="0.916">92.14115</beat><beat confidence="0.827">92.64206</beat><beat confidence="0.879">93.14297</beat><beat confidence="0.770">93.64389</beat><beat confidence="0.893">94.14481</beat><beat confidence="0.811">94.64574</beat><beat confidence="0.898">95.14667</beat><beat confidence="0.802">95.64760</beat><beat confidence="0.924">96.15141</beat><beat confidence="0.782">96.65579</beat><beat confidence="0.873">97.15598</beat><beat confidence="0.711">97.65383</beat><beat confidence="0.788">98.15260</beat><beat confidence="0.778">98.65178</beat><beat confidence="0.870">99.15361</beat><beat confidence="0.726">99.65707</beat><beat confidence="0.883">100.15949</beat><beat confidence="0.898">100.66164</beat><beat confidence="0.857">101.16376</beat><beat confidence="0.750">101.66818</beat><beat confidence="0.863">102.17512</beat><beat confidence="0.749">102.68814</beat><beat confidence="0.749">103.20682</beat><beat confidence="0.742">103.74641</beat><beat confidence="0.380">104.30121</beat><beat confidence="0.633">104.86049</beat><beat confidence="0.633">105.42074</beat><beat confidence="0.731">105.96022</beat><beat confidence="0.458">106.48434</beat><beat confidence="0.209">107.00433</beat><beat confidence="0.269">107.53317</beat><beat confidence="0.059">108.07019</beat><beat confidence="0.399">108.60890</beat><beat confidence="0.943">109.91041</beat><beat confidence="0.830">110.40041</beat><beat confidence="0.819">110.88303</beat><beat confidence="0.800">111.36835</beat><beat confidence="0.782">111.86652</beat><beat confidence="0.829">112.36914</beat><beat confidence="0.839">112.86890</beat><beat confidence="0.912">113.36425</beat><beat confidence="0.817">113.85763</beat><beat confidence="0.884">114.35141</beat><beat confidence="0.814">114.84605</beat><beat confidence="0.867">115.34095</beat><beat confidence="0.844">115.83871</beat><beat confidence="0.833">116.33922</beat><beat confidence="0.882">116.84035</beat><beat confidence="0.891">117.34513</beat><beat confidence="0.800">117.85343</beat><beat confidence="0.805">118.36166</beat><beat confidence="0.817">118.86875</beat><beat confidence="0.862">119.37586</beat><beat confidence="0.791">119.88208</beat><beat confidence="0.874">120.38657</beat><beat confidence="0.795">120.89512</beat><beat confidence="0.889">121.40196</beat><beat confidence="0.871">121.90675</beat><beat confidence="0.766">122.41156</beat><beat confidence="0.779">122.91559</beat><beat confidence="0.902">123.41747</beat><beat confidence="0.833">123.91825</beat><beat confidence="0.881">124.42008</beat><beat confidence="0.790">124.92457</beat><beat confidence="0.890">125.42969</beat><beat confidence="0.800">125.93482</beat><beat confidence="0.812">126.43996</beat><beat confidence="0.827">126.94511</beat><beat confidence="0.867">127.45028</beat><beat confidence="0.821">127.95545</beat><beat confidence="0.863">128.46064</beat><beat confidence="0.802">128.96584</beat><beat confidence="0.908">129.47105</beat><beat confidence="0.900">129.97627</beat><beat confidence="0.816">130.47906</beat><beat confidence="0.747">130.98184</beat><beat confidence="0.880">131.48424</beat><beat confidence="0.843">131.98805</beat><beat confidence="0.884">132.49284</beat><beat confidence="0.839">132.99673</beat><beat confidence="0.893">133.50303</beat><beat confidence="0.824">134.00779</beat><beat confidence="0.748">134.51039</beat><beat confidence="0.750">135.01125</beat><beat confidence="0.793">135.51316</beat><beat confidence="0.752">136.01532</beat><beat confidence="0.799">136.51744</beat><beat confidence="0.822">137.02043</beat><beat confidence="0.880">137.52503</beat><beat confidence="0.858">138.02793</beat><beat confidence="0.780">138.52921</beat><beat confidence="0.727">139.03263</beat><beat confidence="0.776">139.53552</beat><beat confidence="0.741">140.03760</beat><beat confidence="0.738">140.53880</beat><beat confidence="0.840">141.04052</beat><beat confidence="0.828">141.54300</beat><beat confidence="0.755">142.05020</beat><beat confidence="0.627">142.56801</beat><beat confidence="0.833">143.08838</beat><beat confidence="0.647">143.60578</beat><beat confidence="0.384">144.11862</beat><beat confidence="0.450">144.87134</beat><beat confidence="0.510">145.35555</beat><beat confidence="0.428">145.83217</beat><beat confidence="0.323">146.31291</beat><beat confidence="0.462">146.80069</beat><beat confidence="0.557">147.30194</beat><beat confidence="0.512">147.81248</beat><beat confidence="0.521">148.32106</beat><beat confidence="0.564">148.82309</beat><beat confidence="0.518">149.32278</beat><beat confidence="0.559">149.82430</beat><beat confidence="0.564">150.32938</beat><beat confidence="0.558">150.83556</beat><beat confidence="0.578">151.33967</beat><beat confidence="0.604">151.84376</beat><beat confidence="0.600">152.34847</beat><beat confidence="0.598">152.85253</beat><beat confidence="0.552">153.35657</beat><beat confidence="0.602">153.86061</beat><beat confidence="0.617">154.36462</beat><beat confidence="0.557">154.86863</beat><beat confidence="0.563">155.37261</beat><beat confidence="0.613">155.87659</beat><beat confidence="0.597">156.38028</beat><beat confidence="0.614">156.88307</beat><beat confidence="0.590">157.38522</beat><beat confidence="0.618">157.88734</beat><beat confidence="0.561">158.38943</beat><beat confidence="0.577">158.89150</beat><beat confidence="0.583">159.39417</beat><beat confidence="0.605">159.89746</beat><beat confidence="0.594">160.40076</beat><beat confidence="0.578">160.90405</beat><beat confidence="0.574">161.40787</beat><beat confidence="0.612">161.91168</beat><beat confidence="0.600">162.41307</beat><beat confidence="0.561">162.91446</beat><beat confidence="0.588">163.41594</beat><beat confidence="0.615">163.91742</beat><beat confidence="0.609">164.41888</beat><beat confidence="0.616">164.92035</beat><beat confidence="0.593">165.42143</beat><beat confidence="0.622">165.92419</beat><beat confidence="0.572">166.42964</beat><beat confidence="0.547">166.93493</beat><beat confidence="0.523">167.43692</beat><beat confidence="0.536">167.93781</beat><beat confidence="0.550">168.44076</beat><beat confidence="0.581">168.94355</beat><beat confidence="0.581">169.44610</beat><beat confidence="0.613">169.94868</beat><beat confidence="0.571">170.45127</beat><beat confidence="0.542">170.95389</beat><beat confidence="0.522">171.45653</beat><beat confidence="0.510">171.96133</beat><beat confidence="0.498">172.46760</beat><beat confidence="0.562">172.97280</beat><beat confidence="0.561">173.47484</beat><beat confidence="0.608">173.97694</beat><beat confidence="0.553">174.48046</beat><beat confidence="0.490">174.98355</beat><beat confidence="0.606">175.48194</beat><beat confidence="0.164">175.97907</beat><beat confidence="0.570">176.47824</beat><beat confidence="0.292">176.98068</beat><beat confidence="0.496">177.48631</beat><beat confidence="0.339">177.99215</beat><beat confidence="0.503">178.49920</beat><beat confidence="0.502">179.00878</beat><beat confidence="0.480">179.51877</beat><beat confidence="0.488">180.02574</beat><beat confidence="0.537">180.52786</beat><beat confidence="0.515">181.02888</beat><beat confidence="0.530">181.53095</beat><beat confidence="0.532">182.03444</beat><beat confidence="0.532">182.53846</beat><beat confidence="0.562">183.04248</beat><beat confidence="0.521">183.54715</beat><beat confidence="0.541">184.05184</beat><beat confidence="0.516">184.55656</beat><beat confidence="0.543">185.06040</beat><beat confidence="0.543">185.56236</beat><beat confidence="0.520">186.06357</beat><beat confidence="0.508">186.56504</beat><beat confidence="0.542">187.06650</beat><beat confidence="0.527">187.56796</beat><beat confidence="0.512">188.06940</beat><beat confidence="0.499">188.57247</beat><beat confidence="0.519">189.07637</beat><beat confidence="0.501">189.57759</beat></analysis></response>
2 spec/fixtures/get_duration.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<response version="3"><status><code>0</code><message>Success</message></status><query><parameter name="api_key">5ZAOMB3BUR8QUN4PE</parameter><parameter name="id">music://id.echonest.com/~/TR/TRLFPPE11C3F10749F</parameter></query><analysis><duration>194.3493</duration></analysis></response>
2 spec/fixtures/get_end_of_fade_in.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<response version="3"><status><code>0</code><message>Success</message></status><query><parameter name="api_key">5ZAOMB3BUR8QUN4PE</parameter><parameter name="id">music://id.echonest.com/~/TR/TRLFPPE11C3F10749F</parameter></query><analysis><end_of_fade_in>0.421</end_of_fade_in></analysis></response>
2 spec/fixtures/get_key.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<response version="3"><status><code>0</code><message>Success</message></status><query><parameter name="api_key">5ZAOMB3BUR8QUN4PE</parameter><parameter name="id">music://id.echonest.com/~/TR/TRLFPPE11C3F10749F</parameter></query><analysis><key confidence="1.0">5</key></analysis></response>
2 spec/fixtures/get_loudness.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<response version="3"><status><code>0</code><message>Success</message></status><query><parameter name="api_key">5ZAOMB3BUR8QUN4PE</parameter><parameter name="id">music://id.echonest.com/~/TR/TRLFPPE11C3F10749F</parameter></query><analysis><loudness>-8.426</loudness></analysis></response>
2 spec/fixtures/get_metadata.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<response version="3"><status><code>0</code><message>Success</message></status><query><parameter name="api_key">5ZAOMB3BUR8QUN4PE</parameter><parameter name="id">music://id.echonest.com/~/TR/TRLFPPE11C3F10749F</parameter></query><analysis><status>COMPLETE</status><id>music://id.echonest.com/~/TR/TRLFPPE11C3F10749F</id><md5>cf23d5a124dda204f4f5d505389356fd</md5><artist>Mongo Santamaria</artist><title>Watermelon Man</title><genre>Boogaloo</genre><duration>194.3493</duration><samplerate>44100</samplerate><bitrate>128</bitrate></analysis></response>
2 spec/fixtures/get_mode.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<response version="3"><status><code>0</code><message>Success</message></status><query><parameter name="api_key">5ZAOMB3BUR8QUN4PE</parameter><parameter name="id">music://id.echonest.com/~/TR/TRLFPPE11C3F10749F</parameter></query><analysis><mode confidence="1.0">1</mode></analysis></response>
2 spec/fixtures/get_sections.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<response version="3"><status><code>0</code><message>Success</message></status><query><parameter name="api_key">5ZAOMB3BUR8QUN4PE</parameter><parameter name="id">music://id.echonest.com/~/TR/TRLFPPE11C3F10749F</parameter></query><analysis><section start="0.0" duration="7.82647" /><section start="7.82647" duration="17.43627" /><section start="25.26273" duration="9.72336" /><section start="34.9861" duration="13.13052" /><section start="48.11662" duration="9.17272" /><section start="57.28934" duration="11.28174" /><section start="68.57108" duration="7.43292" /><section start="76.004" duration="32.33554" /><section start="108.33954" duration="7.0014" /><section start="115.34095" duration="18.16208" /><section start="133.50303" duration="9.58536" /><section start="143.08838" duration="5.73471" /><section start="148.82309" duration="17.1011" /><section start="165.92419" duration="12.32135" /><section start="178.24554" duration="9.32241" /><section start="187.56796" duration="6.78134" /></analysis></response>
2 spec/fixtures/get_segments.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<response version="3"><status><code>0</code><message>Success</message></status><query><parameter name="api_key">5ZAOMB3BUR8QUN4PE</parameter><parameter name="id">music://id.echonest.com/~/TR/TRLFPPE11C3F10749F</parameter></query><analysis><segment start="0.0" duration="0.421"><loudness><dB time="0.0">-60.0</dB><dB type="max" time="0.0">-60.0</dB></loudness><pitches><pitch>0.542</pitch><pitch>0.58</pitch><pitch>0.644</pitch><pitch>0.782</pitch><pitch>1.0</pitch><pitch>0.718</pitch><pitch>0.666</pitch><pitch>0.53</pitch><pitch>0.569</pitch><pitch>0.476</pitch><pitch>0.61</pitch><pitch>0.742</pitch></pitches><timbre><coeff>0.0</coeff><coeff>171.13</coeff><coeff>9.469</coeff><coeff>-28.48</coeff><coeff>57.491</coeff><coeff>-50.067</coeff><coeff>14.833</coeff><coeff>5.359</coeff><coeff>-27.228</coeff><coeff>0.973</coeff><coeff>-10.64</coeff><coeff>-7.228</coeff></timbre></segment><segment start="0.421" duration="0.53469"><loudness><dB time="0.0">-60.0</dB><dB type="max" time="0.07546">-24.335</dB></loudness><pitches><pitch>1.0</pitch><pitch>0.093</pitch><pitch>0.057</pitch><pitch>0.119</pitch><pitch>0.109</pitch><pitch>0.715</pitch><pitch>0.076</pitch><pitch>0.031</pitch><pitch>0.035</pitch><pitch>0.093</pitch><pitch>0.027</pitch><pitch>0.051</pitch></pitches><timbre><coeff>25.003</coeff><coeff>-50.111</coeff><coeff>60.119</coeff><coeff>-61.178</coeff><coeff>36.791</coeff><coeff>172.395</coeff><coeff>32.814</coeff><coeff>-15.136</coeff><coeff>-30.754</coeff><coeff>78.289</coeff><coeff>22.658</coeff><coeff>29.984</coeff></timbre></segment><segment start="0.95569" duration="0.51574"><loudness><dB time="0.0">-33.89</dB><dB type="max" time="0.04644">-19.79</dB></loudness><pitches><pitch>0.343</pitch><pitch>0.032</pitch><pitch>0.026</pitch><pitch>0.088</pitch><pitch>0.06</pitch><pitch>1.0</pitch><pitch>0.11</pitch><pitch>0.037</pitch><pitch>0.019</pitch><pitch>0.039</pitch><pitch>0.023</pitch><pitch>0.153</pitch></pitches><timbre><coeff>33.569</coeff><coeff>-81.594</coeff><coeff>32.167</coeff><coeff>33.641</coeff><coeff>3.736</coeff><coeff>71.353</coeff><coeff>-24.661</coeff><coeff>-30.883</coeff><coeff>-2.779</coeff><coeff>-16.379</coeff><coeff>7.974</coeff><coeff>28.023</coeff></timbre></segment><segment start="1.47143" duration="0.27311"><loudness><dB time="0.0">-32.598</dB><dB type="max" time="0.05805">-20.795</dB></loudness><pitches><pitch>0.206</pitch><pitch>0.04</pitch><pitch>0.395</pitch><pitch>0.062</pitch><pitch>0.045</pitch><pitch>1.0</pitch><pitch>0.105</pitch><pitch>0.021</pitch><pitch>0.027</pitch><pitch>0.075</pitch><pitch>0.262</pitch><pitch>0.038</pitch></pitches><timbre><coeff>33.631</coeff><coeff>-83.835</coeff><coeff>25.815</coeff><coeff>44.913</coeff><coeff>37.23</coeff><coeff>37.191</coeff><coeff>-31.029</coeff><coeff>-19.415</coeff><coeff>6.836</coeff><coeff>-23.078</coeff><coeff>10.078</coeff><coeff>32.021</coeff></timbre></segment></analysis></response>
2 spec/fixtures/get_start_of_fade_out.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<response version="3"><status><code>0</code><message>Success</message></status><query><parameter name="api_key">5ZAOMB3BUR8QUN4PE</parameter><parameter name="id">music://id.echonest.com/~/TR/TRLFPPE11C3F10749F</parameter></query><analysis><start_of_fade_out>182.44499</start_of_fade_out></analysis></response>
2 spec/fixtures/get_tatums.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<response version="3"><status><code>0</code><message>Success</message></status><query><parameter name="api_key">5ZAOMB3BUR8QUN4PE</parameter><parameter name="id">music://id.echonest.com/~/TR/TRLFPPE11C3F10749F</parameter></query><analysis><tatum confidence="1.0">0.45717</tatum><tatum confidence="0.816">0.71823</tatum><tatum confidence="0.983">0.97966</tatum><tatum confidence="0.709">1.24094</tatum><tatum confidence="1.0">1.50139</tatum><tatum confidence="0.99">1.76065</tatum><tatum confidence="0.769">2.01873</tatum><tatum confidence="0.899">2.27497</tatum><tatum confidence="0.984">2.53058</tatum><tatum confidence="0.868">2.78299</tatum><tatum confidence="1.0">3.03556</tatum><tatum confidence="0.821">3.28802</tatum><tatum confidence="0.974">3.54101</tatum><tatum confidence="0.905">3.79426</tatum><tatum confidence="0.904">4.04815</tatum><tatum confidence="0.81">4.30113</tatum><tatum confidence="0.907">4.55475</tatum><tatum confidence="0.95">4.80874</tatum><tatum confidence="0.979">5.06246</tatum><tatum confidence="0.796">5.31592</tatum><tatum confidence="1.0">5.56885</tatum><tatum confidence="1.0">5.82026</tatum><tatum confidence="0.946">6.07103</tatum><tatum confidence="1.0">6.32181</tatum><tatum confidence="1.0">6.57259</tatum><tatum confidence="1.0">6.82336</tatum><tatum confidence="1.0">7.07414</tatum><tatum confidence="1.0">7.32491</tatum><tatum confidence="1.0">7.57569</tatum><tatum confidence="1.0">7.82647</tatum><tatum confidence="1.0">8.07724</tatum><tatum confidence="1.0">8.32802</tatum><tatum confidence="1.0">8.57879</tatum><tatum confidence="0.799">8.82957</tatum><tatum confidence="0.934">9.08123</tatum><tatum confidence="0.896">9.33353</tatum><tatum confidence="0.903">9.58645</tatum><tatum confidence="0.904">9.83911</tatum><tatum confidence="0.895">10.0924</tatum><tatum confidence="0.849">10.34543</tatum><tatum confidence="0.909">10.59756</tatum><tatum confidence="0.925">10.84969</tatum><tatum confidence="1.0">11.10182</tatum><tatum confidence="0.881">11.35369</tatum><tatum confidence="0.89">11.6053</tatum><tatum confidence="0.866">11.85664</tatum><tatum confidence="0.951">12.10736</tatum><tatum confidence="0.885">12.35619</tatum><tatum confidence="0.784">12.6043</tatum><tatum confidence="0.882">12.85355</tatum><tatum confidence="1.0">13.10368</tatum><tatum confidence="0.856">13.35444</tatum><tatum confidence="0.949">13.60556</tatum><tatum confidence="0.841">13.85642</tatum><tatum confidence="0.847">14.10701</tatum><tatum confidence="0.92">14.35673</tatum><tatum confidence="0.888">14.60555</tatum><tatum confidence="0.929">14.85376</tatum><tatum confidence="1.0">15.10196</tatum><tatum confidence="0.94">15.35016</tatum><tatum confidence="1.0">15.59837</tatum><tatum confidence="0.974">15.84657</tatum><tatum confidence="1.0">16.09477</tatum><tatum confidence="0.97">16.34297</tatum><tatum confidence="1.0">16.59055</tatum><tatum confidence="0.895">16.83813</tatum><tatum confidence="0.953">17.08571</tatum><tatum confidence="0.868">17.3333</tatum><tatum confidence="0.906">17.58175</tatum><tatum confidence="0.882">17.83083</tatum><tatum confidence="0.871">18.07965</tatum><tatum confidence="0.92">18.32821</tatum><tatum confidence="0.925">18.57677</tatum><tatum confidence="0.94">18.82533</tatum><tatum confidence="1.0">19.07389</tatum><tatum confidence="0.911">19.32245</tatum><tatum confidence="0.956">19.57013</tatum><tatum confidence="0.818">19.8172</tatum><tatum confidence="0.897">20.0639</tatum><tatum confidence="0.932">20.31024</tatum><tatum confidence="0.882">20.55684</tatum><tatum confidence="0.898">20.80369</tatum><tatum confidence="1.0">21.05142</tatum><tatum confidence="0.884">21.29977</tatum><tatum confidence="0.992">21.54786</tatum><tatum confidence="0.863">21.79632</tatum><tatum confidence="0.884">22.04451</tatum><tatum confidence="0.984">22.29244</tatum><tatum confidence="0.895">22.54074</tatum><tatum confidence="0.954">22.78816</tatum><tatum confidence="1.0">23.03496</tatum><tatum confidence="0.965">23.28175</tatum><tatum confidence="1.0">23.52855</tatum><tatum confidence="0.99">23.77535</tatum><tatum confidence="1.0">24.02214</tatum><tatum confidence="0.943">24.26894</tatum><tatum confidence="1.0">24.51661</tatum><tatum confidence="0.915">24.76491</tatum><tatum confidence="1.0">25.01382</tatum><tatum confidence="1.0">25.26273</tatum><tatum confidence="1.0">25.51165</tatum><tatum confidence="0.928">25.76056</tatum><tatum confidence="0.948">26.00947</tatum><tatum confidence="0.901">26.25838</tatum><tatum confidence="0.915">26.50641</tatum><tatum confidence="0.862">26.75382</tatum><tatum confidence="0.873">27.00149</tatum><tatum confidence="0.942">27.24942</tatum><tatum confidence="0.929">27.49734</tatum><tatum confidence="0.888">27.74527</tatum><tatum confidence="0.969">27.99346</tatum><tatum confidence="0.926">28.24165</tatum><tatum confidence="1.0">28.49072</tatum><tatum confidence="0.907">28.73979</tatum><tatum confidence="1.0">28.98886</tatum><tatum confidence="1.0">29.23794</tatum><tatum confidence="1.0">29.48701</tatum><tatum confidence="0.916">29.73609</tatum><tatum confidence="0.955">29.98516</tatum><tatum confidence="0.85">30.23424</tatum><tatum confidence="0.863">30.48332</tatum><tatum confidence="0.764">30.73276</tatum><tatum confidence="0.834">30.98256</tatum><tatum confidence="0.821">31.23148</tatum><tatum confidence="0.847">31.47952</tatum><tatum confidence="0.84">31.72756</tatum><tatum confidence="0.888">31.97559</tatum><tatum confidence="0.901">32.22363</tatum><tatum confidence="0.992">32.47166</tatum><tatum confidence="0.837">32.7197</tatum><tatum confidence="0.852">32.96773</tatum><tatum confidence="0.997">33.21841</tatum><tatum confidence="0.903">33.47095</tatum><tatum confidence="0.74">33.7245</tatum><tatum confidence="0.794">33.97816</tatum><tatum confidence="0.785">34.23129</tatum><tatum confidence="0.959">34.48352</tatum><tatum confidence="0.718">34.73512</tatum><tatum confidence="0.69">34.9861</tatum><tatum confidence="0.319">35.23707</tatum><tatum confidence="0.043">35.48715</tatum><tatum confidence="0.579">35.73812</tatum><tatum confidence="0.228">35.98971</tatum><tatum confidence="0.421">36.23752</tatum><tatum confidence="0.974">36.48018</tatum><tatum confidence="0.768">36.7199</tatum><tatum confidence="0.617">36.95713</tatum><tatum confidence="0.662">37.19297</tatum><tatum confidence="0.581">37.43053</tatum><tatum confidence="0.667">37.67017</tatum><tatum confidence="0.715">37.91155</tatum><tatum confidence="0.817">38.15541</tatum><tatum confidence="0.847">38.40246</tatum><tatum confidence="0.877">38.65162</tatum><tatum confidence="0.816">38.90151</tatum><tatum confidence="0.871">39.15213</tatum><tatum confidence="0.804">39.40259</tatum><tatum confidence="0.915">39.6519</tatum><tatum confidence="0.928">39.89971</tatum><tatum confidence="0.937">40.1469</tatum><tatum confidence="0.905">40.39373</tatum><tatum confidence="0.926">40.6402</tatum><tatum confidence="0.779">40.8878</tatum><tatum confidence="0.911">41.13628</tatum><tatum confidence="0.814">41.38601</tatum><tatum confidence="0.844">41.63547</tatum><tatum confidence="0.881">41.88467</tatum><tatum confidence="0.886">42.13388</tatum><tatum confidence="0.851">42.38308</tatum><tatum confidence="0.832">42.63228</tatum><tatum confidence="0.874">42.88237</tatum><tatum confidence="1.0">43.13307</tatum><tatum confidence="0.838">43.38441</tatum><tatum confidence="0.917">43.63548</tatum><tatum confidence="0.801">43.88655</tatum><tatum confidence="0.877">44.13762</tatum><tatum confidence="0.914">44.3887</tatum><tatum confidence="0.873">44.63888</tatum><tatum confidence="0.878">44.88844</tatum><tatum confidence="0.944">45.13676</tatum><tatum confidence="0.814">45.38497</tatum><tatum confidence="0.926">45.63281</tatum><tatum confidence="0.827">45.88092</tatum><tatum confidence="0.903">46.1299</tatum><tatum confidence="0.9">46.3795</tatum><tatum confidence="0.816">46.62947</tatum><tatum confidence="0.83">46.87954</tatum><tatum confidence="0.959">47.1291</tatum><tatum confidence="0.846">47.37688</tatum><tatum confidence="0.964">47.62379</tatum><tatum confidence="0.897">47.87008</tatum><tatum confidence="0.958">48.11662</tatum><tatum confidence="0.86">48.36255</tatum><tatum confidence="0.935">48.60873</tatum><tatum confidence="0.793">48.85578</tatum><tatum confidence="0.909">49.10371</tatum><tatum confidence="0.853">49.35226</tatum><tatum confidence="0.813">49.60205</tatum><tatum confidence="0.826">49.85158</tatum><tatum confidence="0.879">50.10147</tatum><tatum confidence="0.893">50.3511</tatum><tatum confidence="0.933">50.59985</tatum><tatum confidence="0.907">50.84797</tatum><tatum confidence="1.0">51.09574</tatum><tatum confidence="0.933">51.34376</tatum><tatum confidence="0.962">51.59205</tatum><tatum confidence="0.836">51.84095</tatum><tatum confidence="0.953">52.0896</tatum><tatum confidence="1.0">52.33825</tatum><tatum confidence="0.899">52.5869</tatum><tatum confidence="0.869">52.83591</tatum><tatum confidence="1.0">53.08405</tatum><tatum confidence="0.935">53.33219</tatum><tatum confidence="1.0">53.58032</tatum><tatum confidence="0.896">53.82846</tatum><tatum confidence="0.902">54.07635</tatum><tatum confidence="0.982">54.32398</tatum><tatum confidence="0.97">54.57072</tatum><tatum confidence="0.914">54.81685</tatum><tatum confidence="1.0">55.06324</tatum><tatum confidence="0.908">55.30901</tatum><tatum confidence="0.976">55.55504</tatum><tatum confidence="0.974">55.80132</tatum><tatum confidence="1.0">56.04822</tatum><tatum confidence="0.963">56.29512</tatum><tatum confidence="1.0">56.54202</tatum><tatum confidence="0.887">56.79042</tatum><tatum confidence="1.0">57.0397</tatum><tatum confidence="1.0">57.28934</tatum><tatum confidence="1.0">57.53872</tatum><tatum confidence="0.878">57.78873</tatum><tatum confidence="0.95">58.03785</tatum><tatum confidence="0.928">58.28696</tatum><tatum confidence="0.958">58.53608</tatum><tatum confidence="0.899">58.78519</tatum><tatum confidence="0.952">59.03429</tatum><tatum confidence="0.933">59.28339</tatum><tatum confidence="0.946">59.53249</tatum><tatum confidence="0.933">59.78159</tatum><tatum confidence="0.908">60.03069</tatum><tatum confidence="0.938">60.27978</tatum><tatum confidence="1.0">60.52887</tatum><tatum confidence="0.858">60.77795</tatum><tatum confidence="1.0">61.02703</tatum><tatum confidence="0.994">61.27611</tatum><tatum confidence="0.943">61.52607</tatum><tatum confidence="0.879">61.77629</tatum><tatum confidence="0.866">62.02714</tatum><tatum confidence="0.9">62.27709</tatum><tatum confidence="0.92">62.52642</tatum><tatum confidence="0.802">62.77512</tatum><tatum confidence="0.903">63.02409</tatum><tatum confidence="0.843">63.27305</tatum><tatum confidence="0.884">63.52227</tatum><tatum confidence="0.83">63.77274</tatum><tatum confidence="0.892">64.02358</tatum><tatum confidence="0.909">64.27415</tatum><tatum confidence="1.0">64.52383</tatum><tatum confidence="0.822">64.77289</tatum><tatum confidence="1.0">65.0222</tatum><tatum confidence="0.98">65.27152</tatum><tatum confidence="0.798">65.52047</tatum><tatum confidence="0.658">65.77295</tatum><tatum confidence="0.631">66.02096</tatum><tatum confidence="0.822">66.27422</tatum><tatum confidence="0.801">66.53093</tatum><tatum confidence="0.414">66.79031</tatum><tatum confidence="0.362">67.05185</tatum><tatum confidence="0.0">67.31503</tatum><tatum confidence="0.0">67.57536</tatum><tatum confidence="0.472">67.82972</tatum><tatum confidence="0.42">68.08053</tatum><tatum confidence="0.584">68.328</tatum><tatum confidence="1.0">68.57108</tatum><tatum confidence="0.753">68.81112</tatum><tatum confidence="0.586">69.05012</tatum><tatum confidence="0.773">69.28821</tatum><tatum confidence="0.638">69.52839</tatum><tatum confidence="0.687">69.77068</tatum><tatum confidence="0.685">70.01377</tatum><tatum confidence="0.811">70.25863</tatum><tatum confidence="0.877">70.50599</tatum><tatum confidence="0.982">70.75634</tatum><tatum confidence="0.85">71.00831</tatum><tatum confidence="0.955">71.26075</tatum><tatum confidence="0.803">71.51303</tatum><tatum confidence="0.958">71.76452</tatum><tatum confidence="0.92">72.01485</tatum><tatum confidence="1.0">72.26431</tatum><tatum confidence="0.926">72.51314</tatum><tatum confidence="0.992">72.76161</tatum><tatum confidence="0.936">73.00971</tatum><tatum confidence="1.0">73.25808</tatum><tatum confidence="0.953">73.50732</tatum><tatum confidence="1.0">73.75719</tatum><tatum confidence="0.965">74.00769</tatum><tatum confidence="0.994">74.25792</tatum><tatum confidence="0.961">74.5079</tatum><tatum confidence="1.0">74.75724</tatum><tatum confidence="0.957">75.00659</tatum><tatum confidence="1.0">75.25594</tatum><tatum confidence="0.992">75.50529</tatum><tatum confidence="1.0">75.75464</tatum><tatum confidence="1.0">76.004</tatum><tatum confidence="1.0">76.25335</tatum><tatum confidence="0.931">76.50182</tatum><tatum confidence="0.98">76.74967</tatum><tatum confidence="0.789">76.99654</tatum><tatum confidence="0.925">77.24304</tatum><tatum confidence="0.907">77.49068</tatum><tatum confidence="0.932">77.73832</tatum><tatum confidence="0.931">77.98683</tatum><tatum confidence="1.0">78.23597</tatum><tatum confidence="0.967">78.48484</tatum><tatum confidence="0.87">78.73407</tatum><tatum confidence="0.917">78.98305</tatum><tatum confidence="1.0">79.23176</tatum><tatum confidence="0.906">79.47986</tatum><tatum confidence="0.944">79.72734</tatum><tatum confidence="0.989">79.97508</tatum><tatum confidence="1.0">80.22343</tatum><tatum confidence="1.0">80.47091</tatum><tatum confidence="0.879">80.71777</tatum><tatum confidence="0.939">80.9655</tatum><tatum confidence="1.0">81.21262</tatum><tatum confidence="0.863">81.45973</tatum><tatum confidence="0.983">81.70772</tatum><tatum confidence="1.0">81.95545</tatum><tatum confidence="1.0">82.20256</tatum><tatum confidence="0.91">82.44905</tatum><tatum confidence="1.0">82.69579</tatum><tatum confidence="0.865">82.94192</tatum><tatum confidence="1.0">83.18892</tatum><tatum confidence="0.892">83.43654</tatum><tatum confidence="0.965">83.68479</tatum><tatum confidence="1.0">83.93277</tatum><tatum confidence="1.0">84.18075</tatum><tatum confidence="1.0">84.42872</tatum><tatum confidence="0.965">84.6767</tatum><tatum confidence="0.919">84.92467</tatum><tatum confidence="1.0">85.17264</tatum><tatum confidence="0.931">85.42061</tatum><tatum confidence="0.97">85.66857</tatum><tatum confidence="0.984">85.91653</tatum><tatum confidence="0.986">86.16511</tatum><tatum confidence="1.0">86.41342</tatum><tatum confidence="0.95">86.66112</tatum><tatum confidence="0.954">86.90819</tatum><tatum confidence="1.0">87.15615</tatum><tatum confidence="0.905">87.40471</tatum><tatum confidence="0.93">87.65328</tatum><tatum confidence="0.982">87.9022</tatum><tatum confidence="1.0">88.15175</tatum><tatum confidence="1.0">88.40103</tatum><tatum confidence="0.953">88.65031</tatum><tatum confidence="0.931">88.8996</tatum><tatum confidence="1.0">89.14889</tatum><tatum confidence="0.914">89.39818</tatum><tatum confidence="1.0">89.64747</tatum><tatum confidence="1.0">89.89676</tatum><tatum confidence="1.0">90.14606</tatum><tatum confidence="0.885">90.39535</tatum><tatum confidence="0.893">90.64465</tatum><tatum confidence="0.918">90.89395</tatum><tatum confidence="1.0">91.14326</tatum><tatum confidence="0.839">91.39256</tatum><tatum confidence="0.918">91.6415</tatum><tatum confidence="1.0">91.89133</tatum><tatum confidence="1.0">92.14115</tatum><tatum confidence="1.0">92.39161</tatum><tatum confidence="0.939">92.64206</tatum><tatum confidence="0.896">92.89252</tatum><tatum confidence="1.0">93.14297</tatum><tatum confidence="0.891">93.39343</tatum><tatum confidence="0.922">93.64389</tatum><tatum confidence="0.955">93.89435</tatum><tatum confidence="0.986">94.14481</tatum><tatum confidence="0.89">94.39527</tatum><tatum confidence="0.923">94.64574</tatum><tatum confidence="0.94">94.8962</tatum><tatum confidence="1.0">95.14667</tatum><tatum confidence="0.884">95.39714</tatum><tatum confidence="0.93">95.6476</tatum><tatum confidence="0.977">95.89932</tatum><tatum confidence="1.0">96.15141</tatum><tatum confidence="0.905">96.40386</tatum><tatum confidence="0.873">96.65579</tatum><tatum confidence="0.89">96.9062</tatum><tatum confidence="1.0">97.15598</tatum><tatum confidence="0.859">97.4054</tatum><tatum confidence="0.824">97.65383</tatum><tatum confidence="0.896">97.90339</tatum><tatum confidence="0.91">98.1526</tatum><tatum confidence="0.866">98.40206</tatum><tatum confidence="0.898">98.65178</tatum><tatum confidence="0.845">98.90239</tatum><tatum confidence="1.0">99.15361</tatum><tatum confidence="0.854">99.40548</tatum><tatum confidence="0.862">99.65707</tatum><tatum confidence="1.0">99.90841</tatum><tatum confidence="1.0">100.15949</tatum><tatum confidence="0.914">100.41057</tatum><tatum confidence="1.0">100.66164</tatum><tatum confidence="0.836">100.9127</tatum><tatum confidence="0.961">101.16376</tatum><tatum confidence="0.789">101.41507</tatum><tatum confidence="0.856">101.66818</tatum><tatum confidence="0.912">101.92101</tatum><tatum confidence="0.968">102.17512</tatum><tatum confidence="0.762">102.43112</tatum><tatum confidence="0.708">102.68814</tatum><tatum confidence="0.259">102.94618</tatum><tatum confidence="0.0">103.20682</tatum><tatum confidence="0.0">103.47397</tatum><tatum confidence="0.383">103.74641</tatum><tatum confidence="0.364">104.02266</tatum><tatum confidence="0.261">104.30121</tatum><tatum confidence="0.382">104.58036</tatum><tatum confidence="0.396">104.86049</tatum><tatum confidence="0.3">105.14131</tatum><tatum confidence="0.516">105.42074</tatum><tatum confidence="0.566">105.69318</tatum><tatum confidence="0.892">105.96022</tatum><tatum confidence="0.792">106.22338</tatum><tatum confidence="0.497">106.48434</tatum><tatum confidence="0.353">106.74339</tatum><tatum confidence="0.265">107.00433</tatum><tatum confidence="0.279">107.26755</tatum><tatum confidence="0.301">107.53317</tatum><tatum confidence="0.335">107.80068</tatum><tatum confidence="0.153">108.07019</tatum><tatum confidence="0.035">108.33954</tatum><tatum confidence="0.363">108.6089</tatum><tatum confidence="0.438">108.87828</tatum><tatum confidence="0.361">109.14564</tatum><tatum confidence="0.568">109.40632</tatum><tatum confidence="0.617">109.66075</tatum><tatum confidence="0.929">109.91041</tatum><tatum confidence="0.948">110.15669</tatum><tatum confidence="0.822">110.40041</tatum><tatum confidence="0.671">110.64235</tatum><tatum confidence="0.684">110.88303</tatum><tatum confidence="0.699">111.1245</tatum><tatum confidence="0.888">111.36835</tatum><tatum confidence="0.927">111.6165</tatum><tatum confidence="0.94">111.86652</tatum><tatum confidence="0.878">112.11791</tatum><tatum confidence="0.914">112.36914</tatum><tatum confidence="0.901">112.61959</tatum><tatum confidence="0.989">112.8689</tatum><tatum confidence="0.904">113.11732</tatum><tatum confidence="1.0">113.36425</tatum><tatum confidence="0.887">113.61081</tatum><tatum confidence="0.961">113.85763</tatum><tatum confidence="0.95">114.10409</tatum><tatum confidence="1.0">114.35141</tatum><tatum confidence="1.0">114.59873</tatum><tatum confidence="0.987">114.84605</tatum><tatum confidence="0.984">115.09337</tatum><tatum confidence="1.0">115.34095</tatum><tatum confidence="1.0">115.58939</tatum><tatum confidence="1.0">115.83871</tatum><tatum confidence="1.0">116.08865</tatum><tatum confidence="1.0">116.33922</tatum><tatum confidence="1.0">116.58978</tatum><tatum confidence="1.0">116.84035</tatum><tatum confidence="0.868">117.09242</tatum><tatum confidence="0.979">117.34513</tatum><tatum confidence="0.868">117.59909</tatum><tatum confidence="0.918">117.85343</tatum><tatum confidence="0.848">118.10813</tatum><tatum confidence="0.921">118.36166</tatum><tatum confidence="0.936">118.6152</tatum><tatum confidence="0.945">118.86875</tatum><tatum confidence="0.925">119.1223</tatum><tatum confidence="1.0">119.37586</tatum><tatum confidence="0.915">119.62942</tatum><tatum confidence="0.891">119.88208</tatum><tatum confidence="0.782">120.13375</tatum><tatum confidence="0.959">120.38657</tatum><tatum confidence="0.964">120.64066</tatum><tatum confidence="0.899">120.89512</tatum><tatum confidence="0.873">121.14867</tatum><tatum confidence="1.0">121.40196</tatum><tatum confidence="0.896">121.65435</tatum><tatum confidence="1.0">121.90675</tatum><tatum confidence="0.929">122.15915</tatum><tatum confidence="0.88">122.41156</tatum><tatum confidence="0.99">122.66371</tatum><tatum confidence="0.93">122.91559</tatum><tatum confidence="0.951">123.16684</tatum><tatum confidence="1.0">123.41747</tatum><tatum confidence="0.917">123.66773</tatum><tatum confidence="0.982">123.91825</tatum><tatum confidence="0.981">124.16904</tatum><tatum confidence="0.989">124.42008</tatum><tatum confidence="0.943">124.67201</tatum><tatum confidence="1.0">124.92457</tatum><tatum confidence="0.885">125.17713</tatum><tatum confidence="0.99">125.42969</tatum><tatum confidence="0.925">125.68225</tatum><tatum confidence="0.942">125.93482</tatum><tatum confidence="0.935">126.18739</tatum><tatum confidence="0.941">126.43996</tatum><tatum confidence="0.917">126.69254</tatum><tatum confidence="0.952">126.94511</tatum><tatum confidence="0.949">127.19769</tatum><tatum confidence="1.0">127.45028</tatum><tatum confidence="0.96">127.70286</tatum><tatum confidence="0.929">127.95545</tatum><tatum confidence="0.838">128.20804</tatum><tatum confidence="0.945">128.46064</tatum><tatum confidence="0.966">128.71324</tatum><tatum confidence="0.903">128.96584</tatum><tatum confidence="0.94">129.21844</tatum><tatum confidence="1.0">129.47105</tatum><tatum confidence="0.895">129.72366</tatum><tatum confidence="1.0">129.97627</tatum><tatum confidence="0.91">130.22736</tatum><tatum confidence="0.884">130.47906</tatum><tatum confidence="0.973">130.73014</tatum><tatum confidence="0.888">130.98184</tatum><tatum confidence="0.886">131.23291</tatum><tatum confidence="1.0">131.48424</tatum><tatum confidence="0.898">131.73583</tatum><tatum confidence="0.98">131.98805</tatum><tatum confidence="0.91">132.24089</tatum><tatum confidence="0.999">132.49284</tatum><tatum confidence="0.926">132.74478</tatum><tatum confidence="0.965">132.99673</tatum><tatum confidence="0.882">133.24956</tatum><tatum confidence="1.0">133.50303</tatum><tatum confidence="0.973">133.75496</tatum><tatum confidence="0.939">134.00779</tatum><tatum confidence="0.878">134.25972</tatum><tatum confidence="0.856">134.51039</tatum><tatum confidence="0.821">134.76069</tatum><tatum confidence="0.879">135.01125</tatum><tatum confidence="0.812">135.26208</tatum><tatum confidence="0.909">135.51316</tatum><tatum confidence="0.871">135.76424</tatum><tatum confidence="0.89">136.01532</tatum><tatum confidence="0.881">136.26638</tatum><tatum confidence="0.915">136.51744</tatum><tatum confidence="0.876">136.76849</tatum><tatum confidence="0.951">137.02043</tatum><tatum confidence="0.857">137.2721</tatum><tatum confidence="0.968">137.52503</tatum><tatum confidence="0.994">137.77679</tatum><tatum confidence="0.964">138.02793</tatum><tatum confidence="0.848">138.27844</tatum><tatum confidence="0.886">138.52921</tatum><tatum confidence="0.881">138.78061</tatum><tatum confidence="0.859">139.03263</tatum><tatum confidence="0.845">139.28377</tatum><tatum confidence="0.868">139.53552</tatum><tatum confidence="0.835">139.78701</tatum><tatum confidence="0.873">140.0376</tatum><tatum confidence="0.849">140.2882</tatum><tatum confidence="0.844">140.5388</tatum><tatum confidence="0.903">140.78966</tatum><tatum confidence="0.984">141.04052</tatum><tatum confidence="0.804">141.29163</tatum><tatum confidence="0.958">141.543</tatum><tatum confidence="0.907">141.79527</tatum><tatum confidence="0.882">142.0502</tatum><tatum confidence="0.789">142.30796</tatum><tatum confidence="0.685">142.56801</tatum><tatum confidence="0.689">142.82828</tatum><tatum confidence="0.836">143.08838</tatum><tatum confidence="0.59">143.34768</tatum><tatum confidence="0.629">143.60578</tatum><tatum confidence="0.262">143.86298</tatum><tatum confidence="0.0">144.11862</tatum><tatum confidence="0.375">144.37361</tatum><tatum confidence="0.302">144.62477</tatum><tatum confidence="0.622">144.87134</tatum><tatum confidence="1.0">145.11466</tatum><tatum confidence="0.694">145.35555</tatum><tatum confidence="0.491">145.59419</tatum><tatum confidence="0.64">145.83217</tatum><tatum confidence="0.53">146.07095</tatum><tatum confidence="0.509">146.31291</tatum><tatum confidence="0.514">146.55524</tatum><tatum confidence="0.725">146.80069</tatum><tatum confidence="0.811">147.04951</tatum><tatum confidence="0.938">147.30194</tatum><tatum confidence="0.762">147.55665</tatum><tatum confidence="0.809">147.81248</tatum><tatum confidence="0.714">148.06762</tatum><tatum confidence="0.887">148.32106</tatum><tatum confidence="0.964">148.5727</tatum><tatum confidence="0.917">148.82309</tatum><tatum confidence="0.884">149.07311</tatum><tatum confidence="0.891">149.32278</tatum><tatum confidence="0.765">149.57296</tatum><tatum confidence="0.888">149.8243</tatum><tatum confidence="0.929">150.07653</tatum><tatum confidence="0.928">150.32938</tatum><tatum confidence="0.916">150.58261</tatum><tatum confidence="0.928">150.83556</tatum><tatum confidence="0.923">151.08762</tatum><tatum confidence="0.955">151.33967</tatum><tatum confidence="0.945">151.59172</tatum><tatum confidence="1.0">151.84376</tatum><tatum confidence="0.933">152.09643</tatum><tatum confidence="1.0">152.34847</tatum><tatum confidence="0.872">152.6005</tatum><tatum confidence="0.961">152.85253</tatum><tatum confidence="1.0">153.10455</tatum><tatum confidence="0.937">153.35657</tatum><tatum confidence="0.951">153.60859</tatum><tatum confidence="1.0">153.86061</tatum><tatum confidence="0.952">154.11262</tatum><tatum confidence="1.0">154.36462</tatum><tatum confidence="0.925">154.61663</tatum><tatum confidence="0.94">154.86863</tatum><tatum confidence="1.0">155.12062</tatum><tatum confidence="0.957">155.37261</tatum><tatum confidence="0.983">155.6246</tatum><tatum confidence="1.0">155.87659</tatum><tatum confidence="0.917">156.12857</tatum><tatum confidence="1.0">156.38028</tatum><tatum confidence="1.0">156.63199</tatum><tatum confidence="1.0">156.88307</tatum><tatum confidence="0.994">157.13415</tatum><tatum confidence="1.0">157.38522</tatum><tatum confidence="0.917">157.63628</tatum><tatum confidence="0.993">157.88734</tatum><tatum confidence="0.933">158.13839</tatum><tatum confidence="0.942">158.38943</tatum><tatum confidence="0.953">158.64047</tatum><tatum confidence="0.952">158.8915</tatum><tatum confidence="0.923">159.14252</tatum><tatum confidence="0.963">159.39417</tatum><tatum confidence="0.998">159.64581</tatum><tatum confidence="1.0">159.89746</tatum><tatum confidence="0.996">160.14911</tatum><tatum confidence="0.999">160.40076</tatum><tatum confidence="0.89">160.6524</tatum><tatum confidence="0.918">160.90405</tatum><tatum confidence="1.0">161.15596</tatum><tatum confidence="0.957">161.40787</tatum><tatum confidence="0.969">161.65977</tatum><tatum confidence="1.0">161.91168</tatum><tatum confidence="0.939">162.16269</tatum><tatum confidence="1.0">162.41307</tatum><tatum confidence="0.961">162.66345</tatum><tatum confidence="0.918">162.91446</tatum><tatum confidence="1.0">163.1652</tatum><tatum confidence="0.975">163.41594</tatum><tatum confidence="0.975">163.66668</tatum><tatum confidence="1.0">163.91742</tatum><tatum confidence="0.944">164.16815</tatum><tatum confidence="1.0">164.41888</tatum><tatum confidence="0.999">164.66962</tatum><tatum confidence="1.0">164.92035</tatum><tatum confidence="0.943">165.17107</tatum><tatum confidence="1.0">165.42143</tatum><tatum confidence="0.901">165.67268</tatum><tatum confidence="1.0">165.92419</tatum><tatum confidence="1.0">166.1766</tatum><tatum confidence="0.972">166.42964</tatum><tatum confidence="0.884">166.68242</tatum><tatum confidence="0.914">166.93493</tatum><tatum confidence="0.939">167.18655</tatum><tatum confidence="0.884">167.43692</tatum><tatum confidence="0.874">167.68755</tatum><tatum confidence="0.899">167.93781</tatum><tatum confidence="0.967">168.18897</tatum><tatum confidence="0.919">168.44076</tatum><tatum confidence="0.885">168.69228</tatum><tatum confidence="0.957">168.94355</tatum><tatum confidence="0.988">169.19482</tatum><tatum confidence="1.0">169.4461</tatum><tatum confidence="0.93">169.69739</tatum><tatum confidence="1.0">169.94868</tatum><tatum confidence="1.0">170.19997</tatum><tatum confidence="0.948">170.45127</tatum><tatum confidence="0.877">170.70258</tatum><tatum confidence="0.9">170.95389</tatum><tatum confidence="0.872">171.20521</tatum><tatum confidence="0.872">171.45653</tatum><tatum confidence="0.806">171.70875</tatum><tatum confidence="0.846">171.96133</tatum><tatum confidence="0.857">172.21428</tatum><tatum confidence="0.841">172.4676</tatum><tatum confidence="0.823">172.72065</tatum><tatum confidence="0.929">172.9728</tatum><tatum confidence="0.872">173.22369</tatum><tatum confidence="0.949">173.47484</tatum><tatum confidence="0.796">173.72563</tatum><tatum confidence="1.0">173.97694</tatum><tatum confidence="1.0">174.22851</tatum><tatum confidence="0.918">174.48046</tatum><tatum confidence="0.833">174.73213</tatum><tatum confidence="0.809">174.98355</tatum><tatum confidence="0.835">175.23319</tatum><tatum confidence="0.919">175.48194</tatum><tatum confidence="0.563">175.73007</tatum><tatum confidence="0.545">175.97907</tatum><tatum confidence="0.399">176.22835</tatum><tatum confidence="0.747">176.47824</tatum><tatum confidence="0.491">176.72902</tatum><tatum confidence="0.435">176.98068</tatum><tatum confidence="0.913">177.23387</tatum><tatum confidence="0.781">177.48631</tatum><tatum confidence="0.832">177.73928</tatum><tatum confidence="0.73">177.99215</tatum><tatum confidence="0.967">178.24554</tatum><tatum confidence="0.874">178.4992</tatum><tatum confidence="0.934">178.75349</tatum><tatum confidence="0.885">179.00878</tatum><tatum confidence="0.846">179.26417</tatum><tatum confidence="0.831">179.51877</tatum><tatum confidence="0.914">179.77283</tatum><tatum confidence="0.861">180.02574</tatum><tatum confidence="1.0">180.27711</tatum><tatum confidence="0.905">180.52786</tatum><tatum confidence="0.978">180.77824</tatum><tatum confidence="0.931">181.02888</tatum><tatum confidence="1.0">181.27979</tatum><tatum confidence="0.91">181.53095</tatum><tatum confidence="1.0">181.78301</tatum><tatum confidence="0.928">182.03444</tatum><tatum confidence="1.0">182.28676</tatum><tatum confidence="0.928">182.53846</tatum><tatum confidence="1.0">182.79015</tatum><tatum confidence="0.999">183.04248</tatum><tatum confidence="1.0">183.29481</tatum><tatum confidence="0.931">183.54715</tatum><tatum confidence="1.0">183.79949</tatum><tatum confidence="0.969">184.05184</tatum><tatum confidence="1.0">184.3042</tatum><tatum confidence="0.919">184.55656</tatum><tatum confidence="1.0">184.80893</tatum><tatum confidence="0.987">185.0604</tatum><tatum confidence="1.0">185.31125</tatum><tatum confidence="0.962">185.56236</tatum><tatum confidence="1.0">185.81283</tatum><tatum confidence="0.947">186.06357</tatum><tatum confidence="1.0">186.31431</tatum><tatum confidence="0.923">186.56504</tatum><tatum confidence="1.0">186.81577</tatum><tatum confidence="1.0">187.0665</tatum><tatum confidence="1.0">187.31723</tatum><tatum confidence="0.968">187.56796</tatum><tatum confidence="1.0">187.81868</tatum><tatum confidence="0.953">188.0694</tatum><tatum confidence="1.0">188.32075</tatum><tatum confidence="0.914">188.57247</tatum><tatum confidence="0.99">188.82455</tatum><tatum confidence="0.968">189.07637</tatum><tatum confidence="1.0">189.32729</tatum><tatum confidence="0.977">189.57759</tatum><tatum confidence="0.99">189.82726</tatum><tatum confidence="0.859">190.07719</tatum></analysis></response>
2 spec/fixtures/get_tempo.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<response version="3"><status><code>0</code><message>Success</message></status><query><parameter name="api_key">ACUHDSIWZSTDVWVHP</parameter><parameter name="id">music://id.echonest.com/~/TR/TRLFPPE11C3F10749F</parameter></query><analysis><tempo confidence="0.723">120.163</tempo></analysis></response>
2 spec/fixtures/get_time_signature.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<response version="3"><status><code>0</code><message>Success</message></status><query><parameter name="api_key">5ZAOMB3BUR8QUN4PE</parameter><parameter name="id">music://id.echonest.com/~/TR/TRLFPPE11C3F10749F</parameter></query><analysis><time_signature confidence="0.064">4</time_signature></analysis></response>
BIN spec/fixtures/sample.mp3
Binary file not shown.
60 spec/response_spec.rb
@@ -0,0 +1,60 @@
+$:.unshift File.dirname(__FILE__)
+
+require 'spec_helper'
+require "echonest"
+
+include SpecHelper
+
+describe Echonest::Response do
+ before do
+ @success = Echonest::Response.new(<<EOM)
+<?xml version="1.0" encoding="UTF-8"?>
+<response version="3">
+ <status>
+ <code>0</code>
+ <message>Success</message>
+ </status>
+ <query>
+ <parameter name="api_key">5ZAOMB3BUR8QUN4PE</parameter>
+ <parameter name="id">music://id.echonest.com/~/AR/ARH6W4X1187B99274F</parameter>
+ </query>
+ <artist>
+ <name>Radiohead</name>
+ <id>music://id.echonest.com/~/AR/ARH6W4X1187B99274F</id>
+ <foreign_id>music://id.echonest.com/5ZAOMB3BUR8QUN4PE/AR/1</foreign_id>
+ <familiarity>0.96974159665</familiarity>
+ </artist>
+</response>
+EOM
+
+ @failure = Echonest::Response.new(<<EOM)
+<?xml version="1.0" encoding="UTF-8"?>
+<response version="3">
+ <status>
+ <code>1</code>
+ <message>Invalid API key</message>
+ </status>
+ <query>
+ <parameter name="api_key">XXXXXX</parameter>
+ <parameter name="id">music://id.echonest.com/~/AR/ARH6W4X1187B99274F</parameter>
+ </query>
+</response>
+EOM
+ end
+
+ it "should return status" do
+ @success.status.code.should eql(0)
+ @success.status.message.should eql('Success')
+ @success.success?.should be_true
+ @success.xml.elements['response/artist/name'][0].to_s.should eql('Radiohead')
+
+ @failure.status.code.should eql(1)
+ @failure.status.message.should eql('Invalid API key')
+ @failure.success?.should be_false
+ end
+
+ it "should return query" do
+ @success.query[:id].should eql('music://id.echonest.com/~/AR/ARH6W4X1187B99274F')
+ @success.query[:api_key].should eql('5ZAOMB3BUR8QUN4PE')
+ end
+end
2 spec/spec.opts
@@ -0,0 +1,2 @@
+-c
+-fs
11 spec/spec_helper.rb
@@ -0,0 +1,11 @@
+$:.unshift File.dirname(__FILE__) + '/../lib/'
+
+require 'echonest'
+
+module SpecHelper
+ def fixture(filename)
+ File.dirname(__FILE__) + '/fixtures/' + filename
+ end
+end
+
+

0 comments on commit fb627c8

Please sign in to comment.
Something went wrong with that request. Please try again.