DEV Community

Cover image for VibeSync- Music Recommendation
RUDRA PRATAP
RUDRA PRATAP

Posted on

VibeSync- Music Recommendation

If you’ve ever gone down a rabbit hole trying to understand how Spotify or Apple Music always knows exactly what song to play next, you know how fascinating recommendation algorithms are. As a B.Tech CSIT student diving into machine learning, I wanted to peek under the hood of these systems.

That curiosity led to my latest project: VibeSync, a completely content-based music recommendation engine.

Try the Live Application Here | View the Source Code on GitHub

The Problem with Standard Recommendations

Most commercial recommendation systems rely heavily on collaborative filtering. This means the algorithm looks at what thousands of other users with similar tastes are listening to and recommends those songs to you. It works great, but it requires massive amounts of user behavior data—something I definitely didn't have sitting on my hard drive.

The Solution: Content-Based Filtering

Instead of tracking user behavior, I decided to focus purely on the music itself. VibeSync analyzes the mathematical profile of a track using audio features like danceability, energy, tempo, and acousticness.

By treating every song as a multi-dimensional vector, the engine calculates the cosine similarity between different tracks. When you input a target song, the algorithm scans the dataset to find the five tracks with the most identical sonic footprints—meaning they share the exact same "vibe."

Building the Stack

To bring this to life, I kept the tech stack entirely in Python:

  • Scikit-learn: Used MinMaxScaler to normalize the audio features so high-value metrics (like tempo) wouldn't overshadow low-value metrics (like danceability), and handled the similarity matrix math.
  • Pandas: For cleaning and structuring the track datasets.
  • Plotly & Streamlit: I wanted the project to be more than just a terminal script, so I used Streamlit to build and deploy a dark-mode, glassmorphic web dashboard that visualizes the feature comparisons using Plotly.

Top comments (0)