Skip to content

1. Controller and Model

Akshay Chacko edited this page Apr 14, 2021 · 90 revisions

Story Map

Story Map

Music Streaming

This app uses the Spotify API for Android. Spotify API allows us to not only get the publishment information about a song (title, artist, album, Spotify link, etc.), but also get calculated audio features, such as its danceability, energy, valence, and more.

Music Features & Analysis

This app uses the Spotify API to track and analyze the audio features of each song. The tracked features can be categorized as follows:

  • Mood: Danceability, Valence, Energy, Tempo
  • Properties: Loudness, Speechiness, Instrumentalness
  • Context: Liveness, Acousticness
  • Other In-depth Features: Segments, Tatums, Bars, Beats, Pitches, Timbre, and more

The major focus of our recommendation algorithm is to find songs with similar sentiments. When the recommender receives a song, it will run the music analysis on it and return other musical tracks with similar keys, BPM, and other user-specified features.

Recommendations

nearest_neighbors(initial_seed, initial_recs) link to source code

Building on the Spotify's powerful algorithm, we generate specific recommendations based on seed the seeding song and ranged audio features (keys, BPM, danceability, valence, etc). After the user seeds the first song, the recommender provides initial recommendation focusing on keys and danceability.

playlist_rec_helper(seed_list) link to source code

Is called by the read_playlist endpoint in order to communicate with the Spotify API and process the output into a format that can be used by the nearest neighbor algorithm. The Spotify API returns a long complicated nested JSON structure that is hard to work with on its own, and thus must be processed by this function after the data is retrieved. The seed_list argument is a string containing a Spotify playlist ID.

track_rec_helper(seed_list) link to source code

Is called by the getsong endpoint in order to communicate with the Spotify API and process the output into a format that can be used by the nearest neighbor algorithm. The Spotify API returns a long complicated nested JSON structure that is hard to work with on its own, and thus must be processed by this function after the data is retrieved. The seed_list argument is a string containing a Spotify track ID.

Clone this wiki locally