SONIC PI
Make beautiful algorithmic music
Create royalty-free music automatically, or try your hand at producing music by coding. Mike Bedford explores both composition options…
credit: https://sonic-pi.net
OUR EXPERT
Mike Bedford never progressed beyond piano lessons as a child. Despite that, music production holds a fascination with him, and all the more so if it’s done digitally.
T osay that digital technology has revolutionised the world of music is a massive understatement. Starting with the introduction of the audio CD in 1982, and continuing through to today’s streaming services, for the vast majority of people, listening to music is a digital experience, despite the recent vinyl revival.
And the change has been no less dramatic in the realm of music composition, performance, recording and post-processing. Music notation software has largely displaced pen and paper and, let’s face it, when did you last hear of music being recorded on a multichannel analogue tape recorder? Our subject here, though, falls between these two extremes of music consumers and professional musicians. Here too, digital technology comes to the fore in the form of what we’re calling algorithmic composition. And even if you don’t need royalty-free music, you’ll still get some hands-on experience of this intriguing type of software.
A history lesson
Let’s go back to Austria in the 1790s. Attributed to Wolfgang Amadeus Mozart, Musikalisches Wuerfelspiel, which means Musical Dice Game, involves generating waltzes from the repeated rolls of two dice. Like most schemes for algorithmic composition that followed, despite the random element, the rules ensured that the laws of music were upheld. What’s more, it’s in keeping with our aim of enabling non-musicians to create music.
As Mozart says in the introduction to his creation, it enables someone, “to compose without the least knowledge of music so much German Walzer or Schleifer as one pleases, by throwing a certain number with two dice”. And just in case you’re wondering, there are 759,499,667,166,482 unique compositions.
Implementing Musikalisches Wuerfelspiel in software has commonly been used as a programming exercise so you might like to pick up the gauntlet. If so, you can download Mozart’s original rules at https://bit.ly/lxf291mozartand, fortunately, the text appears in English as well as German. Alternatively, if you don’t want to reinvent the wheel, you can get a feel for this early form of algorithmic composition using the JavaScript implementation at https://bit.ly/lxf291mozzer.
Long before digital technology gave us computer generated music, Mozart was creating random waltzes using a pair of dice.