Skip to content

Instantly share code, notes, and snippets.

@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);
@bwhitman
bwhitman / OAMutableURLRequest.m
Created November 29, 2011 14:03
OAMutableURLRequest.m
//
// OAMutableURLRequest.m
// OAuthConsumer
//
// Created by Jon Crosby on 10/19/07.
// Copyright 2007 Kaboomerang LLC. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
@bwhitman
bwhitman / gist:1563427
Created January 5, 2012 02:37
Example codegen output for multiple files
[
{"error":"could not decode", "tag":13530, "metadata":{"filename":"/Users/bwhitman/Music/iTunes/iTunes Media/Music//Zeta Reticula/Balance 005 (CD1)/04 - Tool 1.mp3"}},
{"metadata":{"filename":"/Users/bwhitman/Music/iTunes/iTunes Media/Music//Zongamin/Unknown Album/02 Third Uncle.mp3", "samples_decoded":661816, "given_duration":30, "start_offset":10, "version":4.12, "patch":"d", "codegen_time":0.549810, "decode_time":1.124349}, "code_count":1116, "code":"eJxdlguSJCkMQ6-SRwDb-HP_i-0TWbXbtTERM-0mAVmSxeTO8DnVz0zH0-67tvt59toRT_msvXcUtXtS92z-BHXMv_VSneen3mv1s3uvyiyj9lycbxW5K6lrm9Z3tq9FPUv3tVeEsW72Pa-P9lvsn_Ot8ud8G-vPfiHdbtF_93vw95_9XvNTx96_9bH-qf_X31F_f2uji781v4CV4zG3tX3U8ET1XKg7l9tjwFjeB4C5X0Bh076pWwSPR4T02WVbtFmuFLPlsDiRXQduqA9dj4GrJE8Vdxw_sw3Oqbv76e07hw0Qt3o9wf7yWKy3xeL79HViI3_HuvCPD9Jow0mpdDDMXS_sYtnBCUtCctGTcZDZdf8lgfuQScLRWwbrK-ycYv-E6IzANjVDnR950dm5aAD45ICWfrU-khu3pIDZ2kLTy_PwBbXRXu3j2LK0Hi20tOH3c3Y9-OqsGdAZ_4DWT-c1s9HX1SaaL1S7zClPIM4jUr_NHsCaUDxD4zGGV03kXLJaN3Kf8KnbTJOZjV8093Nq1OZA87zmgW4-eOR1wbVVq7ScdHMnr
@bwhitman
bwhitman / gist:1563459
Created January 5, 2012 02:42
pyechonest example for FP querying
#!/usr/bin/env python
import json
import pyechonest.song as song
if __name__ == '__main__':
# Open that big code file that codegen created
allofit = json.load(open('all_codes'))
for query in allofit:
if query.has_key("code"):
find ~/Music/iTunes/iTunes\ Media/ \( -name "*.mp3" -o -name "*.m4a" \) > all_files
./codegen.Darwin -s 10 30 < all_files > all_codes
@bwhitman
bwhitman / gist:1989702
Created March 6, 2012 23:18
Axolotl by Julio Cortazar

There was a time when I thought a great deal about the axolotls. I went to see them in the aquarium at the Jardin des Plantes and stayed for hours watching them, observing their immobility, their faint movements. Now I am an axolotl.

I got to them by chance one spring morning when Paris was spreading its peacock tail after a wintry Lent. I was heading down tbe boulevard Port-Royal, then I took Saint-Marcel and L'Hôpital and saw green among all that grey and remembered the lions. I was friend of the lions and panthers, but had never gone into the dark, humid building that was the aquarium. I left my bike against tbe gratings and went to look at the tulips. The lions were sad and ugly and my panther was asleep. I decided on the aquarium, looked obliquely at banal fish until, unexpectedly, I hit it off with the axolotls. I stayed watching them for an hour and left, unable to think of anything else.

In the library at Sainte-Geneviève, I consulted a dictionary and learned that axolotls are the larval st