Creativity - Technology - Learning
Live Coding Toolkit for Pure data

Live Coding Toolkit for Pure data

The Live Coding Toolkit (LCT) is a suite of Pure Data abstractions (predefined functions) for musical live coding.

I have been doing musical live coding performances since 2005 and until now these have been in text-based languages, in particular using Impromptu and XTLang (both developed by Andrew Sorensen). In recent years I’ve been increasingly using Pd for many algorithmic music projects and so it seemed natural to use it for live coding too.

Being a real-time system, Pure Data lends its self to live coding practice, however, because it was not designed with live performance in mind, functions (objects) that assist live coding in Pd are limited, and thus the performing experience is not always a fluid one. The LCT is designed to automate some common algorithmic patterns used in live coding, facilitating a more elegant live coding experience.

The LCT is available for download from GitHub. To use, download the repository and add the folder to your Paths in Pure Data’s preferences. Most of the abstractions take optional arguments to set initial parameters, which can be updated via inlets as the patch is running. Pd is a ‘natural’ environment for musical live coding because it has powerful audio capabilities, runs in real-time, and is editable on the fly. However, it was never designed for live coding and so was absent some of the processes that are typically used in live coding performances. This library adds those, at least the ones I often rely upon.

An article about the Live Coding Toolkit for Pure Data and its implementation of live coding design patterns was published in Organised Sound in 2023.

There are a small set of abstractions in the LCT, they include process-based abstractions which are the critical design patterns for supporting live coding. There are support abstractions to assist with simple sound-making and wrappers for audio and MIDI output. The abstractions are:

  • tempo : send bangs regularly at a particular BPM
  • cycle : phrase looper
  • periodic : stepped simple harmonic motion
  • euclid : euclidean rhythm generator
  • randchord : generate and store a randomised chord
  • randseq : generate and store a randomised number sequence
  • defer : schedule an event into the future by a number of beats
  • stairs : stepped transition between two values
  • ramp : smooth transition to the next value
  • rand : linear, gaussian and random walk
  • modrand : make a random selection at each modulo cycle
  • direct : pass input values to a specified outlet
  • quant : pitch class quanitze
  • trans : transpose a number or list of numbers
  • midi : MIDI note output and MIDI note and control change input
  • map : scales data from one range to another
  • gate : probabilistically let data through or not
  • synth~ : simple mono subtractive synth
  • polysynth~ : 8 voice version of synth~
  • fm~ : simple 2-operator frequency modulation synth
  • polyfm~ : 8 voice version of fm~
  • drums~ : simple synthesized drum kit
  • sample~ : load and playback a mono or stereo audio file
  • polysample~ : 8 voice version of sample~
  • echo~ : stereo audio feedback delay
  • gate~ : probabilistically let audio through or not
  • gain~ : stereo audio gain control with mute
  • panner~ : stereo audio panning
  • out~ : stereo audio output with level control and reverb

A User Guide, Help files, and Examples are included in the GitHub repo. There are some video tutorials online.

Below is a performance using the LCT and the Hydra graphics environment in March 2023 at the Queensland Conservatorium, Griffith University.

“Recur Again” by Andrew. R. Brown. 2023. Performance with the Live Coding Toolkit for Pure Data.

I introduced the LCT at the Hybrid Live Coding Interfaces 2021workshop. Below is a video of my presentation at that conference, starting at the 41 min mark.

Presentation of the LCT starts at the 41 min mark.

Above is a live coding performance with the LCT at Solstice Stream December 2023.

Functions in the LCT are based on live coding techniques outlined in Sorensen, Andrew & Brown, Andrew R. (2007) aa-cell in practice: An approach to musical live coding. In: Proceedings of the International Computer Music Conference. pp. 292–299. ICMA, Copenhagen.

Details of the LCT are published in Brown, Andrew R. 2023. Live Coding Patterns and a Toolkit for Pure Data. Organised Sound 28(2), 264–275.