Inspiration
DJ AI takes a set of user-selected songs and intelligently determines an optimal ordering based on musical compatibility. It then dynamically generates smooth transitions between tracks. Unlike typical AI DJs that rely primarily on simple fade-outs and fade-ins from the end of one track to the beginning of another, our system can transition between any sections of songs — such as chorus to buildup or verse to drop. We achieve this by separating each track into stems (vocals, drums, bass, and highs) and selectively fading or blending components depending on what produces the smoothest musical result. This allows for more creative and natural-sounding transitions that closely resemble the techniques used by human DJs.
What it does
DJ AI takes a set of user-selected songs and intelligently determines an optimal ordering based on musical compatibility. It then dynamically generates smooth transitions between tracks. Unlike typical AI DJs that rely primarily on simple fade-outs and fade-ins from the end of one track to the beginning of another, our system can transition between any sections of songs — such as chorus to buildup or verse to drop. We achieve this by separating each track into stems (vocals, drums, bass, and highs) and selectively fading or blending components depending on what produces the smoothest musical result. This allows for more creative and natural-sounding transitions that closely resemble the techniques used by human DJs.
How we built it
We began by consulting a DJ to better understand transition techniques and identify which musical features matter most in a live mix. From there, we built the backend in Python using audio processing libraries such as librosa, scipy, and Flask. Our system includes functions to detect:
- BPM (tempo)
- Musical key
- Energy levels and beat structure We also made a function to determine the different sections of a song. Using cosine similarity scores based not he frequency of words or energy in a song, we made a cosine similarity matrix to determine which parts of the song were the most frequent, with those being the chorus, repeating this process with different similarity levels to find the other sections of the song. We then turned each section of each of the songs in the playlist into a vector, then compared sections to determine which sections had similar starting and ending keys and beats, helping us determine our ordering. We combined these features into a transition engine capable of selecting compatible sections and generating blended outputs as a single WAV file. To improve mix quality, we incorporated music theory principles, logarithmic scaling for smoother fades, and key compatibility scoring (including Camelot wheel relationships). We also used Demucs for stem separation to enable component-level mixing. Finally, we connected our backend to an HTML/JavaScript front-end visualizer via a Flask API, allowing users to upload songs, analyze them, and generate mixes interactively. ## Challenges we ran into One major challenge involved limitations of Spotify’s API, which does not permit training machine learning models using their data. This made it difficult to rely on labeled section data (e.g., intro, chorus, buildup). To overcome this, we developed our own section detection approach using similarity matrices and energy analysis. By identifying repeated high-energy segments in WAV files, we were able to approximate chorus sections and other structural components without relying on proprietary datasets. Another challenge was handling genre incompatibility. Some songs differ significantly in tempo, key, and structure, making certain mixes impractical. We learned that sometimes the best transition is choosing not to force one. ## Accomplishments that we're proud of Creating high-quality mashups typically requires professional DJ tools and experience. We’re proud that we were able to produce smooth, musically coherent mixes using custom preprocessing techniques, stem separation, and mathematically tuned fade curves. Perhaps most importantly, we built this entire system in approximately 24 hours — in a domain we had little prior experience with. Taking on a technically complex, creative problem and delivering a working solution within such a short timeframe is something we’re especially proud of. ## What we learned Building an AI-powered DJ highlighted the complexity of music as data. Not all songs are compatible, and musical intuition still plays an essential role — even in the age of AI. We also learned that music data is highly regulated, meaning creativity and domain understanding are just as important as machine learning when building audio applications. Ultimately, we gained a deeper appreciation for both music production and the challenges of intelligent audio processing. ## What's next for DJ AI We plan to expand DJ AI by:
- Adding more advanced transition styles and effects
- Improving compatibility scoring between songs
- Supporting additional file formats and genres
- Enhancing the real-time visualizer and UI experience Long-term, we would love to refine and release DJ AI as a public tool, making intelligent, high-quality mixing accessible to anyone.
Log in or sign up for Devpost to join the conversation.