The application allows you to input various parameters like BPM, time signature and the drumkit used to preview the generated drumbeat. These drumbeats can then be exported as midi files to be used in your favorite DAW!
The algorithm which generates the beat works like this:
Before the algorithm can begin, it first has to now certain things.
- Which drumkit is used to preview the beats (this does not affect beat generation)
- How many triggers long is the beat?
- How many of those triggers fit in one quarter note?
- At what BPM will the beat be generated?
Finding the 'important beats'
The algorithm will first decide which hits are important to ensure the beat actually feels like a beat. It does this by choosing one of tree options from the correct row. The result of that is then shuffled.
Let's say the algorithm chooses [3,2,2] because we chose 7 triggers per measure. This will result in an rhythm consisting of the following triggers:
Now if we shuffle the results the following variations can be made:
|x||-||-||x||-||x||-||3 2 2|
|x||-||x||-||-||x||-||2 3 2|
|x||-||x||-||x||-||-||2 2 3|
Assigning the 'important beats'
Now that we've selected the important beats they are distributed over the kick and snare drum sequences using the following chances:
|20%||Both kick and snare|
Fine tuning the results
Before generating the hihats it goes through a few more actions:
- Add a kick at the first beat.
- Remove any snares from the first beat.
- Check if there are any snares at all
- Insert a snare at the last important beat if no snares are found
- Insert a random kick after each kick that was not preceded by another kick.
Generate the hihats
The algorithm will now generate the hihats by either:
- randomly adding a hihat or kick after each trigger without kick or snare
- adding a hihat after each trigger with a snare
Now that generation is done the beat will start playing using the built-in drumkits. The user has options to regenerate, write to midi or change generation parameters.
The source code can be found on GitHub