Live-coding in Haskell with Dirt and Tidal

Live-coding in Haskell with Dirt and Tidal

I am not a programmer and probably never will, but I like to think of myself as someone who tinkers with everyday tools – tools like a computer. I use my computer for a lot of things and especially for playing with music software. My favorite toy when I was a kid was a toy laptop that had a BASIC editor and I had tons of fun with it (thanks, GrandPa!).

[su_spoiler title=”Read my rant” style=”fancy” icon=”plus-circle”]

When my great friend Greg introduced me to DJing and music production a couple of years ago, we used to sit for hours in front of his computer, listening to loops that we just made, marveling at the ease with which we would make snare drums out of white noise, filters and envelopes. We had a ton of fun doing that, trying to imitate sounds we would hear in modern dance music and composing bits and pieces of tracks that would never be finished (except for some that are now in a secret folder on a TrueCrypt partition inside a hard drive sitting in a vault).

Techno music used to be about the future and the wonderful things to come. That was some 20+ years ago. It now revolves around a kitschy vision of a future pictured in the past, in a melancholic inversion. Producers spend a ton of cash on gear that is sometimes older than they are (and I did it once too). They spend hundreds on DAW plugins that supposedly make tracks sound like they come out of vintage equipment. Now I wonder what happened. People making techno music used to be enthusiastic about the future, not looking back to a mythical golden era. Something’s wrong here. What techno needs could be the modern equivalent of 909s and 303s: machines that can be pushed out of their normal usage envelopes and into new uncharted territories. Maybe you can use a computer to make interesting sounds too and not just emulate a plastic box that was fresh 20 years ago. Don’t get me wrong; I love vintage synths and I think they are delicious instruments. I am the proud owner of a Roland MC 202 – a machine whose sequencer is even more mysterious than the 303’s. I also like to make digital music with only a computer, a text editor and a terminal window. Deal with it, Octave One. Live-coding is such a thing now that there even was a TED conference about it.

[su_youtube url=”http://www.youtube.com/watch?v=GSGKEy8vHqg”]http://www.youtube.com/watch?v=GSGKEy8vHqg[/su_youtube]

[/su_spoiler]

[su_youtube url=”http://www.youtube.com/watch?v=Qeks3mPvlGU”]http://www.youtube.com/watch?v=Qeks3mPvlGU[/su_youtube]

My first introduction to live coding was this screencast by Yaxu (aka Alex McLean) using the Haskell language and what he was going to call Tidal (a frontend to the Dirt sampler he was making). I was hooked. It was intriguing, the sound was interesting and yet I could not figure how it was produced – all I saw was a sequence of command-line blobs and bits of code describing a score that I could then hear. And then I realized I had to embrace my computer for what it is. The quality of sounds that comes out of it is what makes it musical; digital supposedly sounds cold and I should stop fighting this cold and use that quality in a musical way instead. A couple of months ago, I began researching this live-coding thing and trying some software to make music in an usual way. This was also a period of my life when I listened to a lot of noisy digital pieces by people like Muslimgauze.

First up was SuperCollider. It’s a language, a sound server and now even an IDE. It’s probably the most complete and versatile piece of sound software I used. The learning curve is steep though and I only just figured how to sequence actual notes two months ago. Then I tried Pure Data. It’s yet another paradigm, borrowing from early modular synths and basically just consists in boxes that link to one another in order to make a synth, a sequencer and whatnot. It’s also fun and very complete and looks a lot like Max/MSP (it was in fact developed by the same guy/genius, Miller Puckette). Then again its complexity makes it hard to get instant gratification. And the same thing could be said of other environments/languages like Fluxus (for video purposes). Those are tools mainly developed with programmers in mind, not musicians interested in new ways of making music.

Live-coding
Instant gratification?

That’s something Yaxu’s Tidal has no problem offering. It’s very easy to install and use and results are quickly interesting, with a bit of practice. It’s also a really fun way of describing patterns and modifying patterns on the fly with some effects and transformations that can be applied. It reminds me a lot of Ixi Lang in that regard (unfortunately only available for OS X).

One of the best parts of that software is that it does not require you to be a programmer to use it. Of course it helps to know your way around a command line interface or your Emacs editor (the only way to use Tidal as of now). But my total lack of Haskell skills never was a problem when using Tidal – thanks to the great documentation Alex is maintaining. It really is that simple. For instance, I would play a (somewhat lame) cover of Plastikman’s Spastik with this few lines of code:

d1 $ every 1 (density 2) $ sound "rm*8"
d2 $ sound "bd*4"

and make all kinds of transformations using effects like digital distortion, granular effects and cutups to the sounds on the fly.

My favorite is the striate function: it cuts samples into pieces plays them back in a stuttery way. Another favorite of mine is the vowel formant filter that makes everything sound roboticly awesome.

Should you want to give it a go, the code is here and fairly simple instructions are available for OS X and Linux installation.

Mastodon