the echo nest workshop for boston music hack day

53
API Workshop November 21, 2010 Paul Lamere [email protected] Friday, November 20, 2009

Upload: paul-lamere

Post on 15-Jan-2015

2.555 views

Category:

Technology


0 download

DESCRIPTION

This is a slide deck for the Echo Nest API workshop presented at the Boston Music Hack Day on November 21, 2010. Note that the live presentation has music and video that is not present in this deck

TRANSCRIPT

Page 1: The Echo Nest workshop for Boston Music Hack Day

API WorkshopNovember 21, 2010Paul [email protected]

Friday, November 20, 2009

Page 2: The Echo Nest workshop for Boston Music Hack Day

World of Music Audio World of Music Text

listening reading

learning

Solutions

WHAT THE ECHO NEST DOES

Friday, November 20, 2009

Page 3: The Echo Nest workshop for Boston Music Hack Day

Artist• Tag Cloud

• Similar Artists

• Familiarity

• Hotttnesss

• News

• Audio

• Images

• Video

• Reviews

• Biography

READING

Friday, November 20, 2009

Page 4: The Echo Nest workshop for Boston Music Hack Day

0 2 4 6 8 10 12 14 16CDE

GAB

0 2 6 10 14 16! -2

! -1

0

1

2x 104

0 2 6 10 14 160

0.2

0.4

0.6

0.8

1

0 2 6 10 14 1615

10

15

20

25

0 2 4 6 8 10 12 14 16CDE

GAB

4

4

8 12

8 12

4 8 12

wave

form

loud

ness

a

udito

rysp

ectro

gram

chro

mag

ram

Dm7 G7 CM7 C#O Dm7 G7 CM7 C#O Dm7 G7 CM7 C#O Dm7 G7 CM7 C#O

segm

ent-s

ynch

rono

us

c

hrom

agra

m

2 4 6 8 10 12 14 16 segments

20

15

10

5

1

25

20

15

10

5

1

25

0 0.5 1 1.5 2 sec.

0 0.5 1 1.5 2 sec.0

0.2

0.4

0.6

0.8

1

C

D

E

F#G

B

C#

D#

F

G#AA#

0 0.5 1 1.5 2 sec.

segm

enta

tion

audi

tory

spe

ctro

gram

pitc

h fe

atur

estim

bre

feat

ures

20 40 60 80 100 120 140 160 180 200 220

20

40

60

80

100

120

140

160

180

200

220

Track•Tempo• Key• Time Signature• Mode• Sections• Pitch• Timbre• Tatums• Beats• Bars• Duration• Loudness• Metadata• Segments• Fade in• Fade out

LISTENING

Friday, November 20, 2009

Page 5: The Echo Nest workshop for Boston Music Hack Day

developer.echonest.comFriday, November 20, 2009

Page 6: The Echo Nest workshop for Boston Music Hack Day

developer.echonest.comFriday, November 20, 2009

Page 8: The Echo Nest workshop for Boston Music Hack Day

CLIENT LIBRARIES

Echo Nest Web Services

Pyechonest

Echo Nest Remix Java

CocoaFlash Ruby

3RD PARTY

Processing

http://developer.echonest.com/pages/resourcesFriday, November 20, 2009

Page 9: The Echo Nest workshop for Boston Music Hack Day

The Echo Nest Artist API

Friday, November 20, 2009

Page 10: The Echo Nest workshop for Boston Music Hack Day

Friday, November 20, 2009

Page 11: The Echo Nest workshop for Boston Music Hack Day

Friday, November 20, 2009

Page 12: The Echo Nest workshop for Boston Music Hack Day

Friday, November 20, 2009

Page 13: The Echo Nest workshop for Boston Music Hack Day

>> from pyechonest import artist>>>> gaga = artist.search_artists(‘Lady Gaga’)[0]>> gaga<Artist ‘Lady Gaga’>

>> gaga.hotttnesss()0.86328906000000005

>> gaga.similar(2)[<Artist 'Ashley Tisdale'>, <Artist 'Britney Spears'>]

Get your gaga on ... from python

Friday, November 20, 2009

Page 14: The Echo Nest workshop for Boston Music Hack Day

def wander(band, max=10): """ generate a playlist by wandering a seed artist neighborhood """ played = [] while max: if band.audio(): audio = random.choice(band.audio()) if audio['url'] not in played: play(audio) played.append(audio['url']) max -= 1 band = random.choice(band.similar())

ARTIST RADIO IN TEN LINES OF CODE

Friday, November 20, 2009

Page 15: The Echo Nest workshop for Boston Music Hack Day

ArtistAPI artistAPI = new ArtistAPI(MY_ECHO_NEST_API_KEY); List<Artist> artists = artistAPI.searchArtist("Weezer”, false); if (artists.size() > 0) { for (Artist artist : artists) { List<Scored<Artist>> similars = artistAPI.getSimilarArtists(artist, 0, 10); for (Scored<Artist> simArtist : similars) { System.out.println("   " + simArtist.getItem()); } } }

Find Weezer’s neighbors in Java

Friday, November 20, 2009

Page 16: The Echo Nest workshop for Boston Music Hack Day

Things you can build withThe Echo Nest

Artist API

Friday, November 20, 2009

Page 17: The Echo Nest workshop for Boston Music Hack Day

Friday, November 20, 2009

Page 18: The Echo Nest workshop for Boston Music Hack Day

Friday, November 20, 2009

Page 19: The Echo Nest workshop for Boston Music Hack Day

PLAYLISTING

Friday, November 20, 2009

Page 20: The Echo Nest workshop for Boston Music Hack Day

PLAYLISTING

Friday, November 20, 2009

Page 21: The Echo Nest workshop for Boston Music Hack Day

Friday, November 20, 2009

Page 22: The Echo Nest workshop for Boston Music Hack Day

The Music Exploration SpaceMore engaging music discovery

Friday, November 20, 2009

Page 23: The Echo Nest workshop for Boston Music Hack Day

The Echo Nest Track API

Friday, November 20, 2009

Page 24: The Echo Nest workshop for Boston Music Hack Day

segments

2 4 6 8 10 12 14 16 segments

20

15

10

5

1

25

20

15

10

5

1

25

0 0.5 1 1.5 2 sec.

0 0.5 1 1.5 2 sec.0

0.2

0.4

0.6

0.8

1

C

D

E

F#G

B

C#

D#

F

G#AA#

0 0.5 1 1.5 2 sec.

segm

enta

tion

audi

tory

spe

ctro

gram

pitc

h fe

atur

estim

bre

feat

ures

auditory spectrogram

pitch features

timbre features

JEHAN STYLEFriday, November 20, 2009

Page 25: The Echo Nest workshop for Boston Music Hack Day

beat markers

tempogram

tempo spectrum

0 5 10 15 20 25! -2

! -1

0

1

2x 104

0 5 10 15 20 25

72 96 143 190 2400

0.2

0.4

0.6

0.8

1

60

6072

96114

143

240

114

190

JEHAN STYLEFriday, November 20, 2009

Page 26: The Echo Nest workshop for Boston Music Hack Day

Friday, November 20, 2009

Page 27: The Echo Nest workshop for Boston Music Hack Day

chop sound into:

Sections

Bars

Beats

Segments

ALL SONG ELEMENTS ARE ITEMS IN A LIST

ECHO NEST REMIX API

Friday, November 20, 2009

Page 28: The Echo Nest workshop for Boston Music Hack Day

>> from pyechonest import track>>>> t=track.upload("BillieJean.mp3")>> t.tempo{'confidence': 0.966, 'value': 116.944}

>> len(t.bars)142

>> len(t.segments)1259>> t.segments[10]

{'duration': 0.252, 'loudness_begin': -46.009, 'loudness_end': -44.121, 'loudness_max': -30.931, 'pitches': [0.342, 0.873, 0.843, 1.0, 0.511, 0.432, 0.841, 0.432, 0.691, 0.687, 0.329, 0.672], 'start': 2.50204, 'timbre': [19.50, 130.611, -114.94, 112.246, 28.369, -60.277, -23.689, -10.537, 4.514, 12.957, -25.44, 2.88], 'time_loudness_max': 0.0171}

Delving into ‘Billie Jean’

Friday, November 20, 2009

Page 29: The Echo Nest workshop for Boston Music Hack Day

Things you can build withThe Echo Nest

Track API

Friday, November 20, 2009

Page 30: The Echo Nest workshop for Boston Music Hack Day

The Click Track Detector

Nirvana

Britney SpearsFriday, November 20, 2009

Page 31: The Echo Nest workshop for Boston Music Hack Day

The Loudness warThe loss of dynamic range in modern recordings

Friday, November 20, 2009

Page 32: The Echo Nest workshop for Boston Music Hack Day

MUSIC VISUALIZATION

Friday, November 20, 2009

Page 33: The Echo Nest workshop for Boston Music Hack Day

Friday, November 20, 2009

Page 34: The Echo Nest workshop for Boston Music Hack Day

Song visualizations by using Echo Nest AnalysisVisualizing Kid-A

Visualizations by Chris MuellerFriday, November 20, 2009

Page 35: The Echo Nest workshop for Boston Music Hack Day

The shape of the songVisualizing Song self similarity

Visualization by Chris Mueller

Reich, Steve – Music for 18 Musicians: Pulses

Madonna, Like A Prayer

Friday, November 20, 2009

Page 36: The Echo Nest workshop for Boston Music Hack Day

SYNCHSTEP

MATCH MUSIC TO YOUR PACE

Friday, November 20, 2009

Page 37: The Echo Nest workshop for Boston Music Hack Day

Cocoa framework for the Echo NestSong visualization on the iPhone

Friday, November 20, 2009

Page 38: The Echo Nest workshop for Boston Music Hack Day

Synchronizing visualizations with musicBeethoven Hero

By Anita LillieFriday, November 20, 2009

Page 39: The Echo Nest workshop for Boston Music Hack Day

Friday, November 20, 2009

Page 40: The Echo Nest workshop for Boston Music Hack Day

THE ECHO NEST REMIX API

Friday, November 20, 2009

Page 41: The Echo Nest workshop for Boston Music Hack Day

CLIENT LIBRARIES

Echo Nest Web Services

Pyechonest

Echo Nest Remix Java

CocoaFlash Ruby

3RD PARTY

Processing

http://developer.echonest.com/pages/resourcesFriday, November 20, 2009

Page 42: The Echo Nest workshop for Boston Music Hack Day

Friday, November 20, 2009

Page 43: The Echo Nest workshop for Boston Music Hack Day

>> song.segments[segment, segment, segment...]>> song.segments[10].start34.502>> song.segments[10].timbre[-30.2, -10.4, 4.5, 3.2...]>> song.segments[10].pitch[0.5, 0.13, 1.0, .... ]

>> song.beats.reverse()

>> for i in segments: i.stretch(2) i = i + othersong.segment[12]

ALL SONG ELEMENTS ARE ITEMS IN A LIST

>> You can mix elements, time stretch them, detect & change pitch, move themaround, repeat them on downbeats, find a closest match in another song, detect and modify volume envelopes, read/write mp3, aiff, wav

Friday, November 20, 2009

Page 44: The Echo Nest workshop for Boston Music Hack Day

WHAT THE ECHO NEST REMIX API

DOES

Friday, November 20, 2009

Page 45: The Echo Nest workshop for Boston Music Hack Day

def one(input_filename, output_filename): audiofile = audio.LocalAudioFile(input_filename) bars = audiofile.analysis.bars collect = audio.AudioQuantumList() for bar in bars: collect.append(bar.children()[0]) out = audio.getpieces(audiofile, collect) out.encode(output_filename)

Friday, November 20, 2009

Page 46: The Echo Nest workshop for Boston Music Hack Day

MAKE WEB SITESFriday, November 20, 2009

Page 47: The Echo Nest workshop for Boston Music Hack Day

MAKE WEB SITESFriday, November 20, 2009

Page 48: The Echo Nest workshop for Boston Music Hack Day

st = modify.Modify() afile = audio.LocalAudioFile(in_filename) beats = afile.analysis.beats total = float(len(beats)) out_shape = (2*len(afile.data),)

for i, beat in enumerate(beats): delta =  i / total new_ad = st.shiftTempo(afile[beat], 1 + delta / 2) out_data.append(new_ad) out_data.encode(out_filename)

Hyperingo

Friday, November 20, 2009

Page 49: The Echo Nest workshop for Boston Music Hack Day

st = modify.Modify() afile = audio.LocalAudioFile(in_filename) beats = afile.analysis.beats total = float(len(beats)) out_shape = (2*len(afile.data),)

for i, beat in enumerate(beats): delta =  i / total new_ad = st.shiftTempo(afile[beat], 1 + delta / 2) out_data.append(new_ad) out_data.encode(out_filename)

Hyperingo

Friday, November 20, 2009

Page 50: The Echo Nest workshop for Boston Music Hack Day

I’ve always wanted to hear Michael Jackson trying to sing

Amerie’s “One Thing”

MAKE MUSIC

-B.L.

Friday, November 20, 2009

Page 51: The Echo Nest workshop for Boston Music Hack Day

MAKE MUSIC

Make a James Brown Machine

Friday, November 20, 2009

Page 52: The Echo Nest workshop for Boston Music Hack Day

Let’s hear The Black Eyes Peas in 5/4.

-P.L.

MAKE MOVIESFriday, November 20, 2009

Page 53: The Echo Nest workshop for Boston Music Hack Day

API WorkshopNovember 21, 2010Paul [email protected]

Friday, November 20, 2009