Live Coding Techno With Strudel

The super talented [Switch Angel] is an electronic music artist, with a few cool YouTube videos to show off their absolute nailing of how to live code with Strudel. For us mere mortals, Strudel is a JavaScript port of TidalCycles, which is an algorithmic music generator which supports live coding, i.e. the music that is passed down to the synthesizer changes on-the-fly as you manipulate the code. It’s magical to watch (and listen!) to how you can adapt and distort the music to your whims just by tweaking a few lines of code: no compilation steps, hardly any debugging and instant results.

The traditional view of music generators like this is to create lists of note/instrument pairs with appropriate modifiers. Each sound is specified in sequence — adding a sound extends the sequence a little. Strudel / Tidalcycles works a little differently and is based on the idea of repeating patterns over a fixed time. Adding an extra sound or breaking down one sound slot into multiple sounds squeezes all the remaining slots down, causing the whole pattern to repeat in the same period, with the sounds individually taking up less space. This simple change makes it really easy to add layer upon layer of interest within a sequence with a few extra characters, without recalculating everything else to fit. On top of this base, multiple effects can be layered—more than we can mention here—and all can be adjusted with pop-in sliders directly in the code.

You see, the code is also the visualizer. As the sequence runs, the notes and time periods are highlighted, with piano rolls and oscilloscope views adding to the visuals to help guide you. Tweaking the various components of the sound composition in real time with embedded sliders is a quick and easy way to smoothly hear the impact of settings. It just makes sense. Additionally, since Strudel is written in JavaScript, you can pull in external libraries of customized functions to make your code more straightforward to read, like this short library from [Switch Angel].

On the back end, the built-in web-based synthesizer is basic but functional for roughing out. Still, for absolute control, you’re going to want to send the notes over to something like SuperCollider or Sonic Pi. This is easy because Strudel supports OSC, making it a simple, configurable item.

If you were thinking that you’ve seen a JavaScript-based generative music thing before, you’d be right. Whilst we’re thinking about generative music and generative art in general, what about having a look at this neat sound-and-light sculpture?

Thanks to [JohnU] for sending this in!

15 thoughts on “Live Coding Techno With Strudel

  1. Reminds me of the demoscene ‘shader showdown’ competition but for sound.
    very cool tool and performative coding, not easy to perform live like this, keep all the baals in the air and keeping things sounding good

    1. What I do with SonicPi is record my live coding sessions and then edit them later in Audacity or Reaper. Cut out the mistakes. Duplicate the successes. Get some nice layering.

  2. The built-in ‘superdough’ synth is more than “basic and functional”, it’s fully featured with a performant sampler capable of granular synthesis, plus loads of synths and effects. It sounds great, as you can hear in Switch Angel’s videos, and is well integrated allowing scope and fft visualisations in-line with the code.

    It’s true you can use OSC, but so far that’s currently only really working with superdirt – the supercollider-based synth used with TidalCycles.

  3. I dabble a bit with Electrosmith’s Daisy Seed, which is an open platform for making audio effects and synths. (supports a bunch of runtimes, including Pure Data).

    But Strudel REPL is a wild approach to coding music. And the results look fantastic in skilled hands.

  4. Nice : – ]. Things sure moved way pass PureData : – ] (which is one of the awesomest lightweight wares out there, holding still its ground quite well).

    Translation – live coding was already available within PureData, just at the kind-of sort-of granular level, and one had to invest some time into learning the thing properly. I’ve seen ppls adding live scripting, they went with Python, but could be something else (PureData is written in ANSI C … so is Python, btw … just saying).

    But I get the gist, and Strudel does look awesome to use. CLI, love it, short and concise, and I also love the idea that one can weave in chord progressions; all it needs now is a bit of Markov-chain-ing to break out of the a closed/infinite looping and voila, pop music generated, on demand, endless variants : -]

    Here goes entire weekend :-]

  5. Honestly when I first saw this I thought it was a very well done music video, when I realised it was actually live I had a bit of a moment.

    Every so often you see something that feels like something from a sci-fi future, and this is one of those things.

Leave a Reply to SebCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.