2015-12-08

Coding dub techno in Ruby using Sonic Pi

Dub techno lends itself to code thanks to its formulaic nature. Indeed, A Bullshitter's Guide to Dub Techno says:

“Sadly, a lot of dub techno out there is unbelievably dull — greyscale, unadventurous, utterly and literally generic. It must seem easy to make because after all, all you need is the a submerged kickdrum, a few clanking chords stretched pointlessly out into arching waves of unmoving, unfeeling nothingness, and maybe the odd snatch of tired melodica, snaking around like a cobra that desperately needs to be put out of its misery.”

I decided to try to code dub techno in Ruby using Sonic Pi. Sonic Pi is an app for live coding sound. It started as a tool for teaching computer science using Raspberry Pi but it works damn well for making a lot of noise. Here's my attempt at coding dub techno in Sonic Pi:

The source code is available here.

My attempt exploits some of the dub techno stereotypes, such as the excessive repetition progressing as I slowly build the sound. As Joanna Demers writes on dub techno and related genres in Listening through the Noise: “Static music goes nowhere, achieves no goals, does no work, and sounds the same three hours into the work as it did when the work began.” In case of dub techno, it is an intentionally bare and stripped-down version of techno. It often focuses on the timbre of sound, using modulating synthesizers heavily drenched in reverb and echoes. Demers writes: “Static music is not only music that avoids conventional harmonic or melodic goals but also music that takes specific steps to obscure any sense of the passage of time.” Dub techno keeps melodic or harmonic progressions to a minimum, usually employing single minor chords oscillating through entire tracks. In my code, I use solely the D minor chord, which varies only in chord inversions and octave shifts.

I think that Sonic Pi offers a fluent live coding experience. For example, the nested with_* functions (such as with_fx) accepting Ruby blocks as arguments provide an intuitive way of representing bottom-up sound processing pipelines. Furthermore, live coding provides a fast feedback loop. Your ears are the tests of your code and you can hear the results of your code immediately.

Overall, I really enjoyed this attempt at dub techno. I would like to thank to Sam Aaron and co. for creating Sonic Pi and I would encourage you to give Sonic Pi a shot.

4 comments :

  1. Absolutely amazing work. Thanks so much for sharing. Please keep on creating more stuff with Sonic Pi - I have so much to learn from you...

    ReplyDelete
    Replies
    1. Thanks, Sam! I still have a lot to learn (for example, correct syncing), so I'll be definitely spending some free time with Sonic Pi.

      Delete
  2. Really nice work!
    Mind sending me the whole thing so i can see without having to write it out with the vid slowly...

    Thanks in advance :D

    ReplyDelete
    Replies
    1. The complete source code is linked from the blog post. See here: https://gist.github.com/jindrichmynarz/f233f75c719abe6a6c81

      Delete