The DJ Assistant is a web application that connects to Spotify and helps you rearrange the songs within your playlists based on BPM (Beats Per Minute) to match a desired BPM profile. This tool is a quick way to reduce the workload to create West Coast Swing dance playlists, and it will automatically upload the playlist to Spotify for you. This tool was created primarily as a fun project for Yours Truly to learn Web 1.0 development during his journey to become a software engineer.
Dance playlists need to vary in BPM so that there aren't too many fast or slow songs played consecutively, otherwise dancers will get hot and stop dancing, or get bored and stop dancing. The DJ Assistant ensures a smooth and enjoyable dance experience by intelligently ordering your tracks.
The target profile is defined as discrete BPM targets for a song at a given index in the playlist. The DJ Assistant reorders the songs in the playlist such that it minimizes the overall error between the BPM of the actual songs and that of the target profile. Simply put, it tries to make the BPM curve of the playlist match the target BPM curve. This task is a variant of the classic assignment problem in computer science and can be efficiently solved using the Hungarian algorithm, which is implemented in Scipy. The song information, including BPM, is retrieved from the Spotify API.
With the DJ Assistant, you can:
The example profile shown above is a sine curve with tempo (in BPM) on the y-axis and song index on the x-axis. It was created using the built-in profile creator in the app. The goal of this profile is to spread out the songs along the sine curve to create a natural ebb and flow in the dance energy. This ensures that high-energy songs are followed by lower-energy ones, allowing dancers to catch their breath and preventing listener fatigue. By alternating the tempo in a wave-like pattern, the playlist maintains a dynamic yet balanced progression, enhancing the overall dance experience. The profile is defined manually by the user, setting the desired minimum BPM, maximum BPM, and number of cycles. The songs of the playlist that you select will then be spread along that profile. Making an ideal dance playlist requires manual tuning from the user. Once a playlist has actually been fit to a given profile, the user must look at the new arrangement and decide if the songs are appropriately spread out. If they are not, consider adding more cycles to the profile.
This is an example of an analyzed playlist. The algorithm took the playlist which was provided and attempted to match the BPM of the songs to the target profile. Hover over the points on the plot to see details about the songs.
This website is simply a GUI for the underlying Python library that was written to provide the playlist sorting functionality. This tool followed the principle of API driven development, meaning the Python library is a superset of the functionlity provided by the limited GUI available here. Visit the GitHub repository for more information regarding the Python library.
If we get enough users, we plan to introduce several exciting features: