plamere / OrganizeYourMusic

Organize your saved music on Spotify
242 stars 40 forks source link

Simplify genre list #1

Open kmturley opened 7 years ago

kmturley commented 7 years ago

There are a lot of genres and it's difficult to organize 'new wave' and 'glimmer pop' into playlists. Could you have a function which sorts tracks into larger genre categories to automate this process for the user?

I had a go at prototyping it quickly by adding this function:

function simplifyGenre(genre) {
    if (genre.indexOf('classical') !== -1 ||
        genre.indexOf('jazz') !== -1 ||
        genre.indexOf('swing') !== -1 ||
        genre.indexOf('world') !== -1) { return 'classical, jazz & world'; }
    else if (genre.indexOf('alternative') !== -1 ||
             genre.indexOf('indie') !== -1 ||
             genre.indexOf('folk') !== -1) { return 'alternative, folk & indie'; }
    else if (genre.indexOf('dance') !== -1 ||
             genre.indexOf('drum and bass') !== -1 ||
             genre.indexOf('electro') !== -1 ||
             genre.indexOf('garage') !== -1 ||
             genre.indexOf('house') !== -1 ||
             genre.indexOf('beat') !== -1 ||
             genre.indexOf('break') !== -1 ||
             genre.indexOf('rave') !== -1) { return 'electronic, dance & house'; }
    else if (genre.indexOf('downtempo') !== -1 ||
             genre.indexOf('lounge') !== -1 ||
             genre.indexOf('easy') !== -1 ||
             genre.indexOf('chill') !== -1) { return 'lounge, downtempo & chillout'; }
    else if (genre.indexOf('funk') !== -1 ||
             genre.indexOf('disco') !== -1 ||
             genre.indexOf('r&b') !== -1 ||
             genre.indexOf('reggae') !== -1 ||
             genre.indexOf('soul') !== -1 ||
             genre.indexOf('motown') !== -1,
             genre.indexOf('quiet storm') !== -1) { return 'funk, soul & reggae'; }
    else if (genre.indexOf('hip') !== -1 ||
             genre.indexOf('hop') !== -1 ||
             genre.indexOf('rap') !== -1 ||
             genre.indexOf('urban') !== -1) { return 'hip-hop, rap & urban'; }
    else if (genre.indexOf('rock') !== -1 ||
             genre.indexOf('blues') !== -1 ||
             genre.indexOf('metal') !== -1 ||
             genre.indexOf('mellow gold') !== -1 ||
             genre.indexOf('wave') !== -1) { return 'rock, metal & blues'; }
    else { return genre; }
}

Then within your addTracks method:

        _.each(genres, function(genre) {
                genre = simplifyGenre(genre);

This is how it comes out:

screen shot 2017-07-03 at 4 46 26 pm

Although my version is not perfect (I'm guessing because the genres are based on an album, not a song?) could you implement something like this to your tool?

zkendall commented 6 years ago

I agree that this is a problem.

Another thing that might help is having a song-genre network graph view. Then you could visually see how songs grouped into related genres.

paranoidi commented 5 years ago

Yeah, I wanted to categorize my music into maybe 5 categories .. but there's really no chance / interest of doing so when I got about 200-300 "genres" from the scan.

kmturley commented 5 years ago

Check out my version which tries to sort them in Parent/Child genre lists: https://github.com/kmturley/OrganizeYourMusic

I use a list of genres nested under their parents here: https://github.com/kmturley/OrganizeYourMusic/blob/master/web/genres.js

This list is manually created, but ideally we could pull it from an API somewhere!