Skip to content

Instantly share code, notes, and snippets.

Avatar

Paul Lamere plamere

View GitHub Profile
@plamere
plamere / catalog_sample.py
Created May 25, 2011
Example of creating an Echo Nest Personal Catalog from a directory of MP3s
View catalog_sample.py
#!/usr/bin/env python
# encoding: utf-8
"""
Copyright (c) 2010 The Echo Nest. All rights reserved.
Created by Tyler Williams on 2011-04-08
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
@plamere
plamere / dedup.py
Created Jun 25, 2011
dedup.py - uses echoprint to find duplicates in a music collection
View dedup.py
#!/usr/bin/python
import sys
import os
import pprint
import subprocess
import pickle
import atexit
import simplejson as json
sys.path.insert(0, "../API")
@plamere
plamere / index.html
Created Dec 6, 2011
Demonstration of how to call the Echo Nest API from a Spotify App
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Playlister</title>
<link rel="stylesheet" href="sp://import/css/adam.css">
<link rel="stylesheet" href="styles.css">
<script type="text/javascript" src="js/jquery.min.js"></script>
</head>
@plamere
plamere / TopTwitter.html
Created Jan 11, 2012
Top hotttest Twitter artists
View TopTwitter.html
<!DOCTYPE html>
<html>
<head>
<title>Top Twitter</title>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>
<link type="text/css" href="styles.css" rel="stylesheet" />
</head>
<body>
<h1 id='title'> Top 100 artists with verified Twitter accounts</h1>
<ol id="results"> </ol>
@plamere
plamere / PlaylistWithDistribution.html
Created Jan 12, 2012
Demo of of Echo Nest playlist generation with variety and distribution
View PlaylistWithDistribution.html
!DOCTYPE html>
<html>
<head>
<title>Playlist Distribution Demo</title>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<link type="text/css" href="demo_styles.css" rel="stylesheet" />
</head>
<body>
@plamere
plamere / lyrical_playlist.py
Created Feb 17, 2012
Example of using LyricFind and Echo Nest to generate a playlist with lyrics
View lyrical_playlist.py
import sys
import urllib
import json
from pyechonest import playlist
def show_playlist(seed_artist):
for s in playlist.basic(artist=seed_artist, type='artist-radio', ]
buckets=['id:lyricfind-US'], results=10, limit=True):
print '=================================================================='
@plamere
plamere / FetchTrackAndAnalysisData.js
Created Apr 9, 2012
Syncing Echo Nest analysis to Spotify playback
View FetchTrackAndAnalysisData.js
function fetchSongInfo(track) {
info('Getting song info for ' + track.name + ' by ' + track.artists[0].name);
var url = 'http://developer.echonest.com/api/v4/track/profile?api_key=N6E4NIOVYMTHNDM8J&callback=?';
var track_id = fromSpotify(track.uri);
$.getJSON(url, { id: track_id, format:'jsonp', bucket : 'audio_summary'}, function(data) {
if (checkResponse(data)) {
info("");
showTrackInfo(data.response.track);
fetchAnalysis(data.response.track);
@plamere
plamere / analysis.json
Created Apr 9, 2012
Example of detailed Echo Nest analysis
View analysis.json
{
"bars": [
{
"confidence": 0.451,
"duration": 1.64692,
"start": 0.7151
},
{
"confidence": 0.32,
"duration": 1.64778,
@plamere
plamere / tweetSetup.html
Created Nov 27, 2012
dynamically adapting the tweet button
View tweetSetup.html
<body>
The tweet button:
<span id='tweet-span'>
<a href="https://twitter.com/share" id='tweet'
class="twitter-share-button"
data-lang="en"
data-count='none'>Tweet</a>
<script>!function(d,s,id){varjs,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="https://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
</span>
View combine.py
"""
combine.py
alternate between two audiofiles, beat by beat
By Paul Lamere, 2013-01-25
"""
import echonest.audio as audio
usage = """