Recurse Games

Procedural Music in Beatroot

February 25, 2018 | View Comments |
|

Beatroot is a program that procedurally generates music. It was made in 1 week as part of PROCJAM, and sounds like this:


How it works

Beatroot’s music is created through a series of steps, based on musical theory, which might be followed by a human composer. This is the same approach taken by Abundant Music, which is one of the better music generators I’ve found. Music can also be created using Neural Networks and other, simpler techniques. Tero Parviainen’s How Generative Music Works is an excellent introduction to these.

I’ll keep the musical theory to a minimum, XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Christer Kaitila’s Procedural Music Generation tutorial

Chords and Chord Progressions

First, we randomly select a tempo (speed) and scale (a palette of notes commonly used in music). Modes (types) of scale used include Major and Pentatonic. Each has a distinct sound, with things like Phrygian Dominant sounding more ‘exotic’.

Using notes from the scale, we randomly create a palette of chords (groups of notes played at the same time). Beatroot only uses triads (named groups of three notes, often referred to with roman numerals from I to VII), but others could be added (I did not have time to try this out). The palette might look like this:

Beatroot chord palette

Chords have a random chance of being inverted (like IIIc), or grouped in ordered pairs (like I-VI).

To make songs more distinct, each has a random frequency of different mutations applied to its chords (inversions, taking chords from different scales, increasing/decreasing an individual note). For example, one song might have 20% of chords inverted. I did not test which mutations actually improved the music - this would be worth further investigation.

Using chords from the palette, we create a random set of chord progressions (e.g., V-II-VII-IV). We start with the final chord (usually I), then choose the chord before that, and the chord before that. We become more likely to ‘stop’ (i.e., choose the starting chord) after reaching a reasonable length or on certain chords (V, I, VI, or IV). Certain chords are more likely to precede others XXXXXXXXXXXXXXXXX

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX Like/retweet prior to post: https://twitter.com/xiotex/status/918786568076316673 https://twitter.com/akirassasin_dev/status/898912394524610561 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

comments powered by Disqus