New Music Excess

The Method 2.0

Posted in Post-rock by newmusicexcess on December 29, 2016

A good few years ago I posted about something called ‘the method’. It basically involved using the LastFM website to manually create a list of bands that were musically close to another band of ones choice. The list was then used in conjunction with All Music to create a list of top albums for each of those bands. To help with the first step I eventually wrote a program in Java that used the LastFM API and helped save time creating the initial list of bands. Of course, I still had to manually do the album look up on All Music.

As a result of teaching myself Python and looking for a small programming project to undertake, I decided to take a look at the original Java code and convert it to do a similar thing in Python 2.7. The difference this time was that I used LastFM ‘scrobbled’ data for the whole procedure and was therefore able to do everything via the API including top album lookups. Sure, the code could be more ‘Pythonic’, but, it does the job for now, until a refine my coding skills in this language.

Here is what you get if you put in God Is An Astronaut as the ‘seed’ band. Note: The formatting is better tabulated in the actual program

Results for artist similar to God Is An Astronaut whos top album on LastFM is All Is Violent, All Is Bright

Artist    Match    Top Album on LastFM
Collapse Under the Empire 1 Find a Place to Be Safe
If These Trees Could Talk 0.968446 If These Trees Could Talk
Maybeshewill 0.939173 Not for Want of Trying
This Will Destroy You 0.817125 Young Mountain
Exxasens 0.763217 Beyond the Universe
Explosions in the Sky 0.728914 The Earth Is Not a Cold Dead Place
65daysofstatic 0.705380 The Fall of Math
Caspian 0.686965 The Four Trees
I Am Waiting for You Last Summer 0.676615 Edge Party

More importantly, here is the code. But remember, its Python 2.7, to run in 3.x you would need to change  stuff. Secondly, and more importantly, you need to get hold of an API key from LastFM and alter the code accordingly (I have marked where the API key needs to go). Finally, don’t forgot to indent where appropriate – again the formatting is difficult to maintain in this post.

Enjoy

#!/usr/bin/env python

# load funtion modules for url based data and regular expressions
import urllib2
import re

# initalise data for url of lastFM audioscrobbler, api key and limit of artists and albums returned
rooturlFM = “http://ws.audioscrobbler.com/2.0/”
apikeyFM = “your_lastfm_apikey_goes_here”
limitFM = “10”
limitFMa = “1”

# get artist name from user
artistFM = raw_input(“Please enter an artists name: “)

# replace any blanks in artists name
artistFMtmp = artistFM.replace(” “, “%20”)

# construct full url for audioscrobbler query to find 10 similar bands
totalurlFM = rooturlFM + “?method=artist.getSimilar&artist=” + artistFMtmp + “&limit=” + limitFM + “&api_key=” + apikeyFM

# open, read and close data from audioscrobbler url query
file = urllib2.urlopen(totalurlFM)
dataFM = file.read()
file.close()

# find name information in data and clean up
name = re.compile(“<name>.*</name>”)

nameFM = name.findall(dataFM)
nameFM = [n.replace(“&amp;”, “and”) for n in nameFM]
nameFM = [n.replace(“&apos;”, “‘”) for n in nameFM]
nameFM = [n.replace(“<name>”, “”) for n in nameFM]
nameFM = [n.replace(“</name>”, “”) for n in nameFM]

# find match probability in data and clean up
match = re.compile(“<match>.*</match>”)
matchFM = match.findall(dataFM)
matchFM = [n.replace(“<match>”, “”) for n in matchFM]
matchFM = [n.replace(“</match>”, “”) for n in matchFM]

# find most popular album for seed band and cleanup
totalurlFMna = rooturlFM + “?method=artist.gettopalbums&artist=” + artistFMtmp + “&limit=” + limitFMa + “&api_key=” + apikeyFM
file = urllib2.urlopen(totalurlFMna)
dataFM = file.read()
file.close()
namealbumFM = name.findall(dataFM)[0]
namealbumFM = namealbumFM.replace(“&amp;”, “and”)
namealbumFM = namealbumFM.replace(“&apos;”, “‘”)
namealbumFM = namealbumFM.replace(“<name>”, “”)
namealbumFM = namealbumFM.replace(“</name>”, “”)

# initalise list for album population
albumFM = [“”]*10

# looped look up to lastfm for finding most popular albums by similar artists
for i in range(0,9):
    nameFMtmp = “”
    nameFMtmp = nameFM[i].replace(” “, “%20”)
    
    totalurlFMa = rooturlFM + “?method=artist.gettopalbums&artist=” + nameFMtmp + “&limit=” + limitFMa + “&api_key=” + apikeyFM
    
    file = urllib2.urlopen(totalurlFMa)
    dataFM = file.read()
    file.close()
    albumFM[i] = name.findall(dataFM)[0]
    albumFM[i] = albumFM[i].replace(“&amp;”, “and”)
    albumFM[i] = albumFM[i].replace(“&apos;”, “‘”)
    albumFM[i] = albumFM[i].replace(“<name>”, “”)
    albumFM[i] = albumFM[i].replace(“</name>”, “”)

# printout band names, match and top album
print(” “)
print(“Results for artist similar to ” + artistFM + ” whos top album on LastFM is ” + namealbumFM)
print(” “)
print “Artist”.ljust(30), “Match”.ljust(10), “Top Album on LastFM”
for n in range(0,9):
    print nameFM[n].ljust(30), matchFM[n].ljust(10), albumFM[n]

 

Engineers – Three Fact Fader

Posted in Dream pop, Indie Rock, Post-rock, Shoegaze by newmusicexcess on December 21, 2009

Track listing:

1. Clean Coloured Wire
2. Sometimes I Realise
3. International Dirge
4. Helped by Science
5. Brighter As We Fall
6. Hang Your Head
7. Crawl From the Wreckage
8. Three Fact Fader
9. Song For Andy
10. Emergency Room
11. The Fear Has Gone
12. Be What You Are
13. What Pushed Us Together

Engeeners second album, Three Fact Finder, is a trippy, loopy and laid back ride through laconic sonic diversity. Simon Phipps’ seductive vocals ride on a heady flow of lethargic angst. Shoegaze perfection!

Reviewed at:

Delusions of Adequacy – http://www.adequacy.net/2009/12/engineers-three-fact-fader/

Drowned In Sound – http://drownedinsound.com/releases/14482/reviews/4137217

musicOMH.com – http://www.musicomh.com/albums/engineers_0709.htm

New Musical Express – http://www.nme.com/reviews/engineers/10633

PopMatters – http://www.popmatters.com/pm/review/116472-engineers-three-fact-fader/

Lost At Sea – http://www.lostatsea.net/review.phtml?id=10606239904b235b537f2c1

All Music Guide  – http://www.allmusic.com/cg/amg.dll?p=amg&sql=10:0xftxztaldse~T1


Slaraffenland – We’re On Your Side

Posted in Chamber Pop, Experimental Rock, Jazz Fusion, Noise Pop, Post-rock by newmusicexcess on December 18, 2009

Slaraffenland - We're On Your Side

Track listing:

1. Long Gone
2. Meet And Greet
3. Too Late To Think
4. Stars And Smiles
5. The Right Place
6. Haunting
7. Falling Out
8. Postcard
9. Open Your Eyes
10. Away

The happy-go-lucky, We’re On Your Side, is Slaraffenland‘s third album. Experimental style-blender pop with a sprinkling of horns, woodwinds and other subtle embellishments allows you to both drift off and uplift leaving you in a ponderous and joyful mind space.

Reviewed at:

Pitchfork – http://pitchfork.com/reviews/albums/13534-were-on-your-side/

cokemachineglow – http://www.cokemachineglow.com/record_review/4925/slaraffenland-wereonyourside-2009

PopMatters –  http://www.popmatters.com/pm/review/114883-slaraffenland-were-on-your-side

All Music Guide – http://www.allmusic.com/cg/amg.dll?p=amg&sql=10:0pfpxztald0e~T1

Slant Magazine – http://www.slantmagazine.com/music/music_review.asp?ID=1846

Tiny Mix Tapes – http://www.tinymixtapes.com/Slaraffenland,9781