Adding Genres to my Rockin App

Currently, I have an empty genres table that looks like this:

emptyGenres.png

My thought when I created it was I’d just use booleans for each column (except artistID, of course). I was going to use these as a short list of categories to create charts with but I’m now thinking I want to use all of the genres Spotify may provide.

Their console gave me the following genres for Alice Cooper:

  "genres": [
    "album rock",
    "classic rock",
    "comic",
    "glam metal",
    "glam rock",
    "hard rock",
    "metal",
    "protopunk",
    "rock"
  ]

I’m fine with that. I wrote about Spotify genres once before, wondering how artists were assigned genres. Were tracks and albums assigned genres and the artist was then assigned all of those? That makes the most sense to me, but I don’t think that’s how Spotify does it.

I wanted to test and dig around but despite the fact that Alice Cooper has tracks that might not fit any of those genres, I couldn’t think of an Alice Cooper album that would go beyond those listed above. So I did Iggy Pop:

"genres": [
    "alternative rock",
    "classic rock",
    "dance rock",
    "garage rock",
    "glam rock",
    "new wave",
    "permanent wave",
    "protopunk",
    "punk",
    "rock"
  ]

The first thing I notice is Alice didn’t get “punk” despite being voted “Punk of the Year” in 1973 by Cream magazine readers. I don’t even know what “permanent wave” is. Anyway, I chose Iggy because I wondered what genre his two French language jazz albums might fall under.

Preliminaires (33EUXrFKGjpUSGacqEHhU4)

"genres": []

One version of Preliminaires has a genres property but no values.

Preliminaires (0bwmAmXOTTfX1PMS0psdjM)

"genres": []

Same.

Après

"genres": []

Same. No surprise.

As a “control group,” I also tried:

  • Raw Power – nope, no genres
  • Lust for Life – no genres

Anyway … what I’m wondering is — can I use Spotify’s genres in the way that I want to? If I want a list of punk bands, will One Bad Pig appear or not? If they don’t, I can add the genres myself … the question really is, I guess … how do I design the table(s)? Maybe just a two-column table (artistID, genre) with an index for each. And … create a function that

  1. gets an artist
  2. gets the genres array
  3. for each genre in genre, insert a row with the artistID and the genre

Man, I hope the spelling for their genres is standardized … like … no “Funk” and “Phunk” or some such nonsense.

Yeah, that’s what I’ll do.

One Bad Pig, by the way, gets:

"genres": [
    "christian metal",
    "christian punk",
    "deep christian rock"
  ]

See, this is why I didn’t want to use Spotify’s genres. I have to write extra code to make sure a “punk” chart includes “punk” but also “protopunk” as well as “christian punk” and … whatever else. Seriously — ew.

The silver lining is, it will all make for a killer relationship chart.

Advertisements

Major Milestone Monday

After lots of hard work, I have D3 not only working with my database but have album art to go with the albums. It took me a while — even after I got the album covers to appear — to get the covers to display where I wanted them. I had to do math a lot. Still not “done,” but this is a big, big deal. This is my #BadAssTakeover.

I have cron jobs that regularly reach out to Spotify and store the popularity of artists, albums, and tracks. Here is a sampling of the bar graphs I can now do. Albums are in chronological order and the numbers are the popularity scores as of Sunday, April 22, 2018. Their popularity scores are relative to all albums on Spotify but I don’t know how they work … I don’t know if an album’s popularity takes into consideration the tracks’ popularity.

Click all images for full size

Alice Cooper

aliceCooper_01

Alice has tons of compilations which is frustrating for multiple reasons. He’s one of the artists that makes me think a vertical graph might be better.

aliceCooper_02

David Bowie

davidBowie_01

As you might expect, Bowie has a ton of albums even without compilations.

davidBowie_02

I’m not sure what the albums without art are … their titles are visible in a sortable table on a different page but I’m busy at the moment …

Bride

I chose them as a sample for a couple reasons. One, they have relatively few albums and two, they were played last night on IntenseRadio during The Great Scott Diversion.

bride

Deliverance

I really don’t like Deliverance but a lot of people do and they have a new album out.

deliverance

Iron Maiden

I feel like I should like Iron Maiden more than I do. Today was a bad Iron Maiden day for me. I’ve been trying to find a relatively inexpensive used copy of Live After Death (on vinyl) and finally found one at a local used record shop but they wouldn’t sell it to me because it wasn’t priced yet. How do I know it was relatively inexpensive if it wasn’t priced yet? The cover was in horrible condition.

ironMaiden

Led Zeppelin

I chose them because I wanted to show some really tall columns … all that “gray space” in the screen shots is how high up the columns could go.

ledZeppelin

Led Zeppelin is another reason my recent … I’ve started buying records again — for the first time in over 30 years — and it’s a lot less fun than I thought it would be.

Meat Loaf

meatLoaf

I think all those blank spaces are compilations. He’s like Alice that way. Ew.

Mortification

Mortification, like Deliverance, are in my database because I wanted a health selection of thrash and black metal and similar artists to compare to each other.

mortification

One Bad Pig

Because I love them.

oneBadPig

They only have four albums which is sad. Well, they’ve also got a demo and a live album but those aren’t on Spotify.

Resurrection Band/Rez Band/Rez/Resurrection Band

rez

For some reason, there’s at least one … wait … it does say Resurrection Band … I thought Ampendectomy was a Glenn Kaiser solo album. Can you believe Lament isn’t their most popular album? People are dumb.

Why does it work? What happened?

All of a sudden! (That’s a Tourniquet reference) One week ago, my cron jobs started working. I’m very happy and very confused. I pulled what I’ll loosely call “reports” on various random artists to compare what time batches of data were pulled from Spotify to the times I set in the crontab — wondering if it was some weird fluke or maybe I’d done it manually (in the middle of the night) and just forgotten.

Good News: No ghosts or gremlins — they’re actually working.

When I got to Bloodgood, I received quite a shock.  Their #1 song was from their latest album. But wait, there’s more — these are their Top 25 tracks on Spotify:

bloodGoodTracksTop25.png

Not only are most of them from Dangerously Close (2013) but most of the rest are from Out of the Darkness.

I would have thought the list would be dominated by tracks from Metal Missionaries and Detonation. I gave Dangerously Close a try when it was first released but didn’t like it and I only ever liked one song enough to remember it from Out of the Darkness (“Top of the Mountain” which appears twice in the top 25).

As it turns out, one need look no further to find evidence of how out of touch I am with other Bloodgood fans than the ranking of Rock in a Hard Place — my personal favorite Bloodgood album. It ranks last among their studio albums with the exception of … whoa … I thought Metal Missionaries was at the bottom because it’s a “25th Anniversary Edition” but there’s no “regular” edition elsewhere on the list.

BloodgoodAlbumsRanked.png

I think I need to go back and listen to those last two albums … maybe I missed something.

However …

while requests for 12th Tribe data finally seem to be working (for some reason, they weren’t for a while), artist popularity for One Bad Pig has only been fetched (using the term loosely) twice and not since the middle of last December. Album and Track data is up-to-date but nothing for artist popularity. The same arrays are used for all of them … well, maybe it’s what my browser pulled just now and not really what’s in my database … hold on … nope, MySQL Workbench gives me just the same two rows.

Well, I’ll be …

One Bad Pig‘s latest album, Love You to Death (2016) is tied for first place as well. Wow, I thought that album kinda sucked, too. It’s tied with I Scream Sunday (1991) which … is their second most-recent album.

I keep waiting to exhale so I can maybe start working on the data viz for all of this …

Spotify Genres

I created a little genres table recently to categorize the artists I’ve entered into my little database. I created columns for these crude descriptions:

  • rock
  • xian
  • rap
  • alt
  • hardrock
  • electronic
  • metal

I can’t believe I didn’t include “classic rock” considering it was my shower thoughts about that genre that inspired this whole project.

Every Noise at Once lists all 1,523 genres Spotify uses (as of the last time ENaO updated their little page). They get a wee more “granular” (as the kids today say) than I did.

ENaO lists 142 rock genres including

  • alternative rock
  • indie rock
  • alt-indie rock
  • indie rockism
  • Russian (and many other nationalities) rock
  • classic rock
  • classic Russian rock
  • spanish rock
  • spanish indie rock
  • rock en espanol
  • space rock
  • deep space rock
  • deep soft rock

Spotify has 13 christian (not to be confused with gospel or uplift) genres including

  • christian rock
  • deep christian rock
  • christian alternative rock
  • latin christian
  • deep latin christian

There’s also

  • 48 jazz
  • 10 gothic
  • 12 dark
  • 7 industrial
  • 127 deep
  • 24 tech (tech, techno, technical, aggrotech, ghettotech, etc.)
  • 23 rap, not to be confused with
  • 47 hip hop

Of course, each artist can have multiple genres attached to them.

Alice Cooper, for example, falls under

  • album rock
  • blues-rock
  • classic rock
  • glam metal
  • glam rock
  • hard rock
  • heavy christmas
  • mellow gold
  • metal
  • protopunk
  • rock

I don’t know which comes first, the artist’s genres or if the songs and/or albums get a genre and all of those genre are applied to the artist.

I’m choosing Alice Cooper because his career has included so many types of music … his album Alice Cooper Goes to Hell falls under … well, how about that … it seems albums don’t have genres. They have a genre property but, so far, none of the albums I’ve seen have any values for the genre property.

Tracks from Get an Album’s Tracks don’t have a genre property at all. Using “I’m the Coolest” from Goes to Hell, I checked the large Track object and it doesn’t have a genre property either.

I’ll tell ya, I’d be rather pissed if someone recommended Alice to me because I like metal so I left the record store with Pretties for You, DaDa, From the Inside and Zipper Catches Skin. For the record, all of those albums are way better than Raise Your Fist and Yell, Along Came A Spider, Dragontown and Brutal Planet.

Let’s try Steve Taylor. I predict (see what I did there?) a combination of christian, punk, new wave, and rock. Spotify says

  • christian metal
  • deep christian rock

I would never in a million years have even imagined metal. I don’t know what deep means.

Steve Taylor & The Perfect Foil has no genre values so I fully expected Steve Taylor & The Danielson Foil to have none but they also fall under deep christian rock. For those of you who know who Mr. Taylor is, I’m obligated to report Chagall Guevara are also deep christian rock.

Finally working some D3 into this sweet little app o’ mine … ta-da!

SFCgraphNoCovers.png

After well over a year of scraping every spare couple of minutes of learning to create things with code, one of the original two purposes is finally being realized! Had to learn PHP, SQL, jQuery, and D3 (and Python along the way) for the above and it’s now still just a skeleton of my full vision.

For genres, I expected S.F.C. to have christian, rap, hip hop, or a combination of two or more. What do they have? None. Search for christian hip hop and you’ll definitely get square miles of piled high landfills of crap like Lacrae but no SFC. Sad. Rigged.

Yo, yo, yo! I just noticed artists have a followers property which I’m totally going to start grabbing. Is there a benefit to following other than having artists appear under My Music > Artists?

I wonder if albums have a saved/saves property … nope … but that would be interesting, I think.

Hmm … Freedom of Soul, however, is deep east coast hip hop. No christian or uplift, though.

  • 12th Tribe is null
  • Playdough is christian hip hop — finally!
  • Say What? is null

Last try is for One Bad Pig. I’m not optimistic. I feel pretty dissed.

Holy crap. One Bad Pig is

  • christian metal
  • christian punk
  • deep christian rock

I accept that.

I wonder why they don’t fall under “christian” and “punk” separately. Or, maybe … no, probably not.