DEV Community

Cover image for Code project for mixing songs together, idea explanation
Jean Carlo Zuniga
Jean Carlo Zuniga

Posted on

Code project for mixing songs together, idea explanation

This blog contains an idea that I have in mind which combines two of my biggest passions; listening to music and coding. The goal here is to explain the problem and the proposed solution to implement, and gather all the possible feedback I hopefully get here in order to transform the idea into something useful while learning a lot during the process.

Context

I listen to lots of music daily, but I have noticed that given the few free time I have for discovering new songs, I often end up listening to mixes of the hottest music of the week or month to be up to date with trends.
These mixes are a unique kind of art, just like drawings, singing, coding, painting, etc. because they have the essence of the disk jokey (DJ) impregnant all over the place. You can even detect a DJ just by listening to her/his work.
The Djs, in order to have a mix that is enjoyable, work in several basic characteristics about it. I don't know much about musical theory, so I speak from an aficionado point of view, but for example these mixes have to sound harmonic, the songs that compose them have to be smoothly synchronize so they enter in the right time to the loop, they have to show lots of sparks of the dj essence; like effects here and there (scratches, sound effects, etc.) among others.

The idea

Given all these inputs, my idea is to code a solution for creating these mixes automatically and upload them to stream platforms to be listened by anyone.
In order to achieve this; I will build a tool for analysing songs as data streams, and select the ones more likely to sound good after mix them together. This sentence took 3 or 4 seconds to be written, but right there are the biggest challenges of the project:

  • to select the songs from a given dataset that would create a mix that people can listen and enjoy.
  • to actually mix songs together and give the "human" essence to the final result so no one can detect it was created by a machine.

After all that is done, there will be trivial tasks like upload the mixes to music platforms. Don't will cover them in this blog.

How to get there?

So as to achieve to select songs that have potential to sound good mixed together, I will be using Fourier transforms. There is a huge theoretical explanation on this amazing mathematical process, but summed up; the wave that represents a sound in a bidimensional space is the combination of several waves that, by sounding together; compounds that very first wave. By using Fourier; we become able to discompone a wave in the ones that conform it.
When I start having songs in such a granular detail and I get to store them in data structures for working with them, the process of finding similarities will become more robust since there are lots of variables to consider to actually find positive matches, meaning songs that will sound good together.


Graphic: Christine Daniloff.

The previous process is going to be executed in a huge amount of songs so I can have a big enough dataset to produce daily mixes with high quality (given the few aspects about a mix quality that we saw before, and more I will find out in the way). The idea is to have some sort of machine learning, with a clear training set of positive matches; that can grab this information and actually find coincidences.
The expected inputs to have in order to create a mix are a set of songs, with the exact time where one can follow the other in order to create a smooth mix to listen. After I achieve this, I will focus in making it sound more "human" by coding the effects (in very general terms) that makes a mix have the essence of a DJ.

Conclusion

At last; we just did a walk through of an idea that is in the process of grab form. I wrote this with the humble goal of collect all feedback from you readers, so I can consider more details of the problem to solve, get to know already existing things that may help, validate if this is a valid approach for solving the problem, and so on. If you have any feedback please reach me out at: jeanczm@gmail.com so we can catch up on whatever topic you want to related with this blog.

Thanks for reading :).

Top comments (0)