Coder Social home page Coder Social logo

pgvr / music-mash Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 3.04 MB

๐Ÿ“ป Create Spotify playlists for social gatherings that are liked by everyone (hopefully ๐Ÿ˜Ž)

Home Page: https://music.codingcastle.dev

TypeScript 41.99% JavaScript 1.24% HTML 4.14% Python 50.78% SCSS 1.85%
genre playlist metrics spotify-api spotify-account

music-mash's Introduction

๐Ÿ“ป MusicMash

๐Ÿ’ก Idea

The party host creates a session and invites all guests to join with their spotify accounts. Using the top 50 tracks of each guest a genre as well as a track metric (danceability, accousticness, ...) analysis is done to find a playlist that fits something for every guest. The playlist is then created in the host's spotify account.

Live at: https://music-mash.netlify.com/

๐Ÿ‘จ๐Ÿปโ€๐Ÿ’ป Monorepo

Frontend

The frontend was built using Angular and the Nebular library. The frontend is automatically deployed from git to netlify.

Backend

The backend was built using NestJs and Mongoose to connect to a Mondodb. Another backend is running python's flask server to some in depth data analysis using Pandas. Both backends are automatically deployed from git to heroku.

๐ŸŽ‰ Testing in the field

So far I have gotten mixed results. If the taste of music is diverse amongst guests the resulting playlist tends to settle for something generic like pop with a few reaches in the individual genres. When a group is mostly homogenous in musical taste the playlist accurately describes the preferences and can lead to some cool discoveries since the /recommendations endpoint of the spotify api can suggest songs that no participant has necessarily listened to.

๐Ÿ—„๏ธ Data Analysis

The spotify api provides detailed metrics for each track available. Some of these metrics are "danceability", "accousticness", "instrumentalness", "power" and few more. Each value is between 0 and 1. When querying the /recommend endpoint all these metrics can be included with a min_, max_ and target_ value. Before sending the request all tracks are analyzed and for each metric the lower quartile is used for the min value, the upper quartile is used for the max value and the median is used for the target value. This should remove outliers and result in a good representation of the groups desired metrics. The /recommend endpoint also needs up to 5 seed_tracks, seed_artists or seed_genres. Since picking 5 tracks or artists would not result in a good representation of the group I decided to use the seed_genres which led to another problem.

For the seed_genres only about 100 genres are allowed, but spotify annotates their tracks with over 3000 different genres. To pick out the 5 most represented genres of the group I downloaded all available genres and matched all available seed_genres against the 3000 others. This is basically a map which gives the closest possible seed_genre for a given genre. To achieve this the Levenshtein is used to match the genres based purely on text similarity. After sorting out some genres manually, e.g. classic rock was matched to classical, the genre map seems functional but not perfect.

The genres of each track are then looked up in the map and the resulting seed_genres are summed up to find the top 5.

music-mash's People

Contributors

pgvr avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.