Taming the Database.

Running a big database for the first time (the db of cinetum, a website to find movies on Amazon Prime Instant Video is way smaller) I ran into a couple of different issues I did not forsee.
In the beginning when I wrote huge parts Crate.one had barly 5000 Songs in the database.
With improving the crawler and a rapidly growing pile of songs the website started to slow down. When I got to 300'000 songs some querys did take up to one second.
What might not sound much compared to the real world equals years in digital aplications and centurys in the world of databases.
At some point the Database choked on a query crashing the whole website for an entire weekend.

To solve this issue I had to realize my problem was much bigger, to that point I had almost no understanding of databases ouch.
My first step was building a propper index, that points to the right places, so instead of reading every single entry in the catalog it could just look at the table of context to find the corresponding songs quickly.

Soon (about 10 hours of reading, ranting and coffee later) I had an idea about databases and the time to look up a single song went down to 0.4 seconds maximum and an average 0.07 seconds.
Reducing the time spent by 60% in the longest querys to 87% in the average query time.

To further optimize the backend and preparing the launch to a broader audience I wrote a benchmarking tool to measure and compare the execution speed of my website.
It basically runs 50 querys in a row and measures how much time it takes.

In order to clean up the mess I created when the website was a funny litle script, I decided to restructure the ids (I used the beatport id as my id for songs and artists because it was easier and "if it works it aint stupid").
Unfortunatly it took a while to change all the fields in the database and my code but the effort paid off.
The speed increased by one magnitude and the benchmark needed 0.3 seconds for 50 requests instead of 3.0 seconds.

What is Harmonic Mixing?

Harmonic mixing is a technique of mixing that has gained a lot of attention over the last years.
The idea is that playing two songs which are in the same or in related keys will sound great together and make it possible to make long transitions or combining two different melodys.

Every song has a certain key, a group of pitches, that it is made of. To every key belong serveral scales, some times a song can change its key but within electronic dance music this is rather uncommon.

There are different types of notation to make it easier to understand the principles without having to bother about music theory and the scale of fifths.
Tagtraum Industries invented the so called Open Key Notation. Every Key is represented as a Number from one to twelve combined with Minor (M) and its corresponding Major (D)

Finding Matches

there are several possibilitys to chose from:

  • playing another song in the same key should always sound good since the scales are identically.
  • going up one key (e.g. from 5M to 6M or 12D to 1D) results in an increase of energy in your mix.
  • going down by one key will make it sound more deep.
  • increasing the key by two will give your mix a major boost of energy and tension.
  • it is also possible to change from a minor to a major (e.g. 6M to 6D)

How Crate One Can Help You

The goal of Crate.One is to make it easier for you to find songs for your next DJ set.
To get started simply enter one song and start listening to Songs you could use in your mix with the Spotify integration (no premium account needed). Crate.One will provide you with a list of songs that are all from the same genre as the song you entered and are compatible with its key. If you cannot find any good songs simpley reload the page.

Spotlight

My Name is Kaspar Houser and I am the founder of this website.
I am from Greifswald, Germany and I like to play all different styles of electronic music.
Audj.io helps me finding new songs that are in the same Key.

Getting Started

This page is the result of an experiment: I wanted to test if I could write a script that could create a whole mixtape on its own.
I started to aggregate a database with songinformation like tempo, key and length.
To determine the quality of the song I generated a score that ranges form 0 to 100 out of various parameters.
I restricted the script to stay within one genre and let it create a electro house playlist.

The result did turn out quiet nicely and I decided to push it a little further. With my recent experiences with my other project cinetum I had some experiences with writing websites in php + laravel, using various api.

I wanted to make this app something that helps djs creating better sets and finding new and good songs more easily.