Flexible Arrays


A few weeks ago I started tinkering around with the Sonic-Pi live coding environment. I had been inspired by some other live coding examples, but didn’t fancy diving in to a complex software environment, and Sonic-Pi was quick and simple to install and start working with.

One thing I quickly discovered that I liked was the way you could work with arrays of values.

The syntax allows you to create an array of variables, called a ‘ring’, and then ‘tick’ through the values in-time with the bpm of the piece, automatically going back to the 1st value in the array when reaching the end.

You can adjust the size of the ‘ring’ by adding or removing values, and the ‘tick’ will also adjust to reflect this.

I enjoyed using this with multiple ‘rings’ hosting variables corresponding to amplitude values for percussion sounds. Adding or removing values from a ‘ring’ would have the effect of adding/subtracting beats from the percussion loop, allowing me to easily set-up and manipulate interesting poly-rhythm effects.

I wondered if there was a way to mirror this elastic/flexible array technique in Pure Data – there is.


The patch above lets me type values (up to 16) into a message box and send these values to an array whilst also adjusting the limits of a counter to ensure I only read through the values sent to the array (rather than the whole array).

I’ve been playing with a version of this today to trigger some karplus-strong synthesised percussion sounds, also using another array to adjust the rate of the metronome to vary the ‘swing’ of the loops.

Another element of this techniques I like is the ability to quickly increase or decrease the activity of the soundscape, simply by adding or removing ‘zero’ values into the array.

Also, by creating multiple message lists for each array, I can develop more structured arrangements for percussion parts, switching from one section to another and back again, which could open up some areas for exploration in performance.

I’ve found it interesting to consider how my experience with one set of tools has led me to develop the way I work with another set of tools – whilst I don’t imagine that I will spend much more time developing work in Sonic-Pi, by using it for a short time I have discovered some new approaches to building compositions in real time which I have been able to transfer to the Pure Data environment, opening up some new areas for me to explore in my work in this environment.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: