ls satyarth.me

about contact archive projects

ls projects

trophallaxis.wav cactus_juice.mp4

Livecoding Patterns

Some patterns I keep coming back to in livecoding

I’ve been livecoding in hydra and Tidal Cycles since about 2020, and want to share some patterns that I never get tired of.

Visuals

Feedback is my bread and butter in hydra. When VJing I like to set up a patch with feedback and audioreactivity, a source video/camera feed, and just walk away and chill out while my patch does its thing and lives its own life. This is a technique visual artists have been using for ages, but I picked up how to do in in hydra from watching Flor de Fuega‘s videos.

The basic premise is that we grab the video buffer’s last frame, apply some transformations, and slap some new content on top of it. We want the new content to act as a new layer, with the feedback happening under it. To do the layering, we use hydra’s layer, mask, and thresh functions like so:

src(o0)
    .modulateScale(src(s0), ()=>a.fft[1]*0.1)   //
    .modulateRotate(src(s0), ()=>a.fft[3]*0.1)  //  Transformations go here
    .hue(0.01)                                  //  Unleash your imagination!
    .layer(
        src(s0).mask(src(s0).thresh(()=>0.3+a.fft[2]) // s0 is the buffer containing our 'new content'
        )
    )
  .out()

Here’s the example patch in the hydra editor - open it up, give it access to your webcam/microphone, and make some sounds at your computer!

Sounds

Since my main instrument is the tabla, most of my sounds are written to accompany a live tabla performance. In Indian classical music, a tabla is typically accompanied by a ‘lehra’, a repeating melody with a constant tempo, played on an instrument like the harmonium or sarangi that acts as a scaffolding for the tabla player’s rhythmic explorations. This melody starts at a root note, then ascends and descends before arriving back at the root. The lehra doesn’t change, except for its expression being modulated by the accompanying artist in the context of the performance.

Livecoding works great for generative lehras! I like to pre-define a ‘root sequence’ based on the time cycle I’m playing in, and have different instruments playing that sequence and adding variations on top of it - so we get the ascending and descending structure with some improvisation to spice things up. I mostly use Tidal Cycles for generating midi sequences that I send to my DAW or VCV rack, but I’ll use strudel to illustrate my point here.

In this example I’ve hardcoded the variations which get picked randomly, but in Tidal Cycles I like to use Markov chains to try and make the sequences feel more alive.


XXIIVV webring