Curated Playlist (2021)
Curated Playlist (2021)
Program generates a curated playlist from a user's musical preferences.
Based on Spotify's recommendation algorithm.
Uses a dataset of 175K+ songs.
Coded using C++
Problem
With modern music streaming services widely available, most people have hundreds, if not thousands, of songs saved to their library that they want to listen to. These libraries often contain a diverse portfolio of songs and genres. This is why we have decided on a project in which a user fills out a survey which relates to different song qualities, and we curate a playlist specific to their likings. The survey asks a variety of questions on their music preferences, such as their preferred genre, tempo, and valence (mood). The music playlist we curate would then reflect the data the user gave us from the survey. We will sort through a large catalog of music in our database and generate a randomly sorted playlist of songs that fit within the individual's music preference.
Features Implemented
Our program uses the Command Line Prompt in order to input a user’s music preferences. When an individual uses our program, their terminal will pop up with various question prompts. The user will be able to directly answer these questions in the terminal. The questions asked each have to do with a specific musical characteristic. Once finished with the questions, we then compare the data from the user’s responses with the data from our music database to generate a personalized playlist with recommended songs that the user would enjoy. Once generated, the playlist can then be downloaded as a file so that the user may see their recommended songs.
Description of Data
The dataset we are using is a Spotify Dataset of 175k+ songs released between 1921 and 2021. The data we are using provides different song qualities including: Artist, Acousticness, Danceability, Duration, Energy, Instrumentalness, Liveness, Loudness, Speechiness, Tempo, and Valence. Each quality has its own distinction and definition. Each question on the survey relates to one of these distinctions, so that we may accurately compare the user’s music preferences to the data we are using and ultimately curate a playlist that will reflect the user’s music taste.
Tools/Languages/APIs/Libraries Used
The language we are coding in is C++, and we are using the C++ Standard Template Library (STL). Additionally, we also use the std::chrono library in order to measure execution time of functions. We are using Visual Studio Code to parse and use the data set. We also used Command Line in order to input the user’s response. The data we are using is from a Spotify Dataset of 175k+ songs released between 1921 and 2021, as discussed before. Lastly, we use GitHub as a way to manage the team’s contributions and streamline the process.
Data Structures/Algorithms Implemented
• Merge Sort: Used to sort the playlist by different integer-based factors, such as duration or popularity. The factor used to sort the playlist depends on the user’s preference.
• Shell Sort: Used to sort the playlist by different integer-based factors, such as duration or popularity. The factor used to sort the playlist depends on the user’s preference. We included both a Merge and Shell sort in order to compare their execution times.
• Unbalanced BST: We created an unbalanced BST in order to shuffle the songs so that the curated playlist would be randomized.
• Vector: We used a vector to store the song catalogs so that we could filter through it and use it to create the curated song playlist (also a vector) depending on the musical preferences of the user.
• Array: Originally, we had the input of our Merge Sort and Shell Sort as a vector. However, we were getting many errors when trying to debug the sorting algorithms. To solve this problem, we decided to create an array from the song catalog and then use the array as our input instead of a vector.
• Ordered Map: In our playlist constructor, we used an ordered map to keep track of how many times a particular artist would appear in the user’s curated playlist. This way, we can recommend more songs from that artist for the user to enjoy.
• Unordered_map: The dataset we used had a major flaw: In the file where the artist name, song name, and song characteristics (quantifiable data) were located, there were no genres. There was a separate file with artists and their corresponding genres, but this did not include the song names or the song characteristics. In order to merge all the data together, we created an unordered map where the key was the artist name and the value was the corresponding genre. This way, we would be able to use genre along with all of the other quantifiable data. We also used the unordered_map to be able to check if the artist already existed when adding songs to the song catalog.
Data Structures/Algorithms Used
• Merge Sort: Used to sort the playlist by different integer-based factors, such as duration or popularity. The factor used to sort the playlist depends on the user’s preference.
• Shell Sort: Used to sort the playlist by different integer-based factors, such as duration or popularity. The factor used to sort the playlist depends on the user’s preference.
• Unbalanced BST: We created an unbalanced BST in order to shuffle the songs so that the curated playlist would be randomized.
Team: Maia Gervasone, Veronica Soden, & Reeya Gupta