Giter Site home page Giter Site logo

foreign-music's Introduction

Foreign Music Discovery

The foreign music finder helps you find music from other countries that's similar to music you enjoy, but hard to stumble across normally.

Try it at https://kklin.github.io/foreign-music! Because it's hosted on free Heroku dynos, it might feel sluggish, especially when first using it.

Note: Only tested on Google Chrome. I know for a fact that Safari does not work.

Note: A Spotify premium account is required

How It Works

The recommendations are generated in three parts.

First, a seed database is generated with representative music for common genres by analyzing Spotify playlists for each country.

Then, when a user requests recommendations for a specific track, Spotify's recommendation engine is used to generate recommendations based on the user's track, and a representative track from the seed database. This way, Spotify's recommendation engine will be "pulled" towards foreign music, but still consider aspects of the track that aren't captured by genre (for example, male vs female vocalist and tempo).

Finally, the list of recommendations are analyzed to determine their countries. English music is filtered out.

Next Steps

  • Allow users to directly save songs they like to their Spotify library.
  • More sophisticated in-app music playback. Users should be able to jump to the middle of songs, and the next song should automatically start playing when
  • Support non-Spotify-premium members. Rather than play the entire track, it should be possible to play samples of the music for them.
  • Allow filtering the recommended tracks by language.

Setup

  1. Start a Postgres server. I'm using Amazon RDS.

  2. Connect to the Postgres server and create the two necessary tables:

CREATE TABLE playlists (
  id text,
  owner_id text,
  name text,
  genre text,
  country text
);
CREATE TABLE tracks (
  id text,
  playlist_id text,
  name text,
  artist_id text,
  genre text,
  country text
);
  1. Create a Spotify application.

  2. Enter the Postgres and Spotify credentials in the configuration file. See the example for reference.

  3. Seed the database with node ./recommendations/recommendations.js seed.

This will take tens of minutes to complete, but logs should be printed as it goes through the different country and genre pairs.

  1. Start the recommendations server with cd ./recommendations && npm start

  2. Start the client-facing web server with cd ./webclient && npm start.

  3. Everything should be ready now! Go to localhost:3000 and start using the application!

Adding Countries and Genres

To add a new country or genre, edit the Country and Genre enums in ./recommendations/recommendations.js, and re-run the seed command. See the Setup section for more information on the seed command.

Note: To make the seeding process quicker, you can comment out the genres or countries that have already been seeded. For example, to add a new genre, add the genre to the enum, and comment out all the other genres.

foreign-music's People

Contributors

kklin avatar

Watchers

 avatar  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.