Skip to content

Instantly share code, notes, and snippets.

crimp:build bwhitman$ sudo brew -v install liblastfm
Password:
Homebrew 0.7.1
==> Build Environment
CC: /usr/bin/cc => /usr/bin/gcc-4.2
CXX: /usr/bin/c++ => /usr/bin/c++-4.2
LD: /usr/bin/cc => /usr/bin/gcc-4.2
CFLAGS: -O3 -march=core2 -msse4.1 -w -pipe
CXXFLAGS: -O3 -march=core2 -msse4.1 -w -pipe
MAKEFLAGS: -j2
@bwhitman
bwhitman / gist:966551
Created May 11, 2011 14:31
Music beta by google instant mix response
POST data
{"title":"Accidents Will Happen Mix","type":"song","seeds":["5d2a0f8d-a005-33e7-b789-52c0cb800e8f"]}
Response
{
"id":"75e62b7b-c4c4-40de-819d-0c08efedd4fb",
"title":"Accidents Will Happen Mix",
"entries":[
{
"genre":"General Rock",
@bwhitman
bwhitman / gist:1041616
Created June 23, 2011 00:18
Echoprint accuracy numbers from Bigeval
NOTE: duplicates in our bigeval DB are the main cause of fp failures.
-c 1000 -d 30 -e wav -p
PR 0.0109 CAR 0.9907 FAR 0.1176 FRR 0.0093 {'err-api': 0, 'fp-a': 2, 'fp-b': 2, 'err-data': 3, 'tp': 960, 'tn': 15, 'err-codegen': 0, 'total': 1000, 'fn': 7, 'err-munge': 11}
-d 60 -e wav
PR 0.0030 CAR 0.9969 FAR 0.0000 FRR 0.0031 {'err-api': 0, 'fp-a': 2, 'fp-b': 0, 'err-data': 3, 'tp': 976, 'tn': 9, 'err-codegen': 0, 'total': 1000, 'fn': 1, 'err-munge': 9}
-d 60 -e mp3
PR 0.0136 CAR 0.9877 FAR 0.1000 FRR 0.0123 {'err-api': 0, 'fp-a': 3, 'fp-b': 1, 'err-data': 1, 'tp': 962, 'tn': 9, 'err-codegen': 0, 'total': 1000, 'fn': 9, 'err-munge': 15}
@bwhitman
bwhitman / gist:1041662
Created June 23, 2011 00:56
Echoprint song/identify query example
http://developer.echonest.com/api/v4/song/identify?api_key=N6E4NIOVYMTHNDM8J&code=eJy1mVuSZCkORLcEkgCxHF7a_xLmEPMxNmUWxEdZ9cMts4i4FySXu9OdUtKWHjDlBfsFOc0XmLzA0wv2E2I9QO5nvsMYL-D7D4j2AO3rAZb8Bfk8gBe8ILcX_FX39wN-dF_0BWO-4JQHSI4X6HlBkRfM9YJdH6Ac-wG3nF_B8nyB2gP-JTfyC1Z7wQ_m-AtqfsHsLzj2ANH9gjc3ur1g9AeoP6HPF6z6AEtPaPGAf8icH93vL9D6giov8P2Ct6rYeMG7-1ejv4KaPuBHB0u8wMcL-nnAr-6PF_yNbuz1gF_dfyqDnxf8O92o_QX_jDlvZdCQB1j2B1zTesA1pe_wN9w47QG5jRe8u_-e_Xus72D9BT98YT1AU31BXS_44QvtASmVF7w7eDf-HU59QL4b_w4_JnQ_QKq_4N2j-_iv8CPXvWdwzxdEfsCvDtoLfnRwvOBvOvjDf58dfE_Zu7_P3K63JN_hL9LX33TQrpF-gRkHQzvqq7fky_PYYy7lD4g508_Ke_H3iRRr2ZDWUxt1lSPcrFtva1ibSYTPe_Ex3QtOlWuT1CUV3-5mbdU81snbd6-lnai5yJZ8fIY3DR3ZoseM3UvfJrP2Heiwmo1Wp2WVJVaWsjubY-fI5Yy1Wi82Vs7Dy5giM00eZOxBHVdrkZcdSs8rXEvMms7yZn62n-ll0jKfyfcSlXN2EQxpxGyn8-3tKw7XaRULj1mGpS0zeqFK0c7Y1WduU8M6G0spmle-FUUXNVBV9-rK3nlo99xzC9rcVCoXsdLZWo_NptOxMndZ-ahx4s97_1hl5yO-rnqI5Cn8ARVtrffTOF_10HWblmN1duS7YeQnNT-lm68jlHzVuAXOW6XQEs6YecbsvR4_1jTL3qdNWRyljaalr7lXj7QnP9kOhQNSqD4H6oXP0J1GimVrIWW3rHoqXBla7fDcnj
@bwhitman
bwhitman / gist:1041667
Created June 23, 2011 00:59
Song/identify response
{
response: {
status: {
version: "4.2",
code: 0,
message: "Success"
},
songs: [
{
score: 48,
@bwhitman
bwhitman / gist:1042425
Created June 23, 2011 12:07
codegen example
clump:~ bwhitman$ git clone git://github.com/echonest/echoprint-codegen.git
Initialized empty Git repository in /Users/bwhitman/echoprint-codegen/.git/
remote: Counting objects: 442, done.
remote: Compressing objects: 100% (253/253), done.
remote: Total 442 (delta 272), reused 354 (delta 185)
Receiving objects: 100% (442/442), 1.37 MiB | 295 KiB/s, done.
Resolving deltas: 100% (272/272), done.
clump:~ bwhitman$ cd echoprint-codegen/
clump:echoprint-codegen bwhitman$ cd src/
clump:src bwhitman$ make
@bwhitman
bwhitman / gist:1042467
Created June 23, 2011 12:41
echoprint-server README

Server components for Echoprint.

Echoprint is an open source music fingerprint and resolving framework powered by the The Echo Nest. The code generator (library to convert PCM samples from a microphone or file into Echoprint codes) is MIT licensed and free for any use. The server component that stores and resolves queries is Apache licensed and free for any use. The data for resolving to millions of songs is free for any use provided any changes or additions are merged back to the community.

What is included

The Echoprint server is a custom component for Apache Solr to index Echoprint codes and hash times. In order to keep the index fast, the Echoprint codes are stored in a Tokyo Tyrant key/value store. We also include the python API layer code necessary to match tracks based on th

@bwhitman
bwhitman / gist:1043931
Created June 23, 2011 23:58
xtc best of mix
XTC – Crowded Room
XTC – I Am The Audience
XTC – Are You Receiving Me?
XTC – Making Plans For Nigel
XTC – Helicopter
XTC – When You're Near Me I Have Difficulty
XTC – Scissor Man
XTC – Life Begins At The Hop
XTC – Respectable Street
XTC – Generals And Majors
@bwhitman
bwhitman / gist:1127477
Created August 5, 2011 12:55
Create a 7digital authenticated track/stream URL in javascript
// requires http://oauth.googlecode.com/svn/code/javascript/
// by Ralph Cowling ralph@gl-ob.com
// get the trackID from song/search playlist/static with &bucket=id:7digital-UK at http://developer.echonest.com/
function sevDig(trackID)
{
var base = "http://media.geo.7digital.com/media/track/stream",
accessor = { consumerSecret: 'your_consumer_secret' },
params = [
['oauth_nonce',OAuth.nonce(11)],
['oauth_timestamp',OAuth.timestamp()],
@bwhitman
bwhitman / gist:1150608
Created August 17, 2011 01:33
Lion printf insanity
// DVLib.c gets very noisy when you do startWithSize here.. with "hack" printf that will get in the way of our cgi JPG binary output
// so we have to "mute" stdout temporarily via dup and freopen. first we save off stdout
int fd;
fpos_t pos;
fflush(stdout);
fgetpos(stdout, &pos);
fd = dup(fileno(stdout));
// now we redirect stdout to /dev/null
freopen("/dev/null", "w", stdout);