This code is for Sonic Pi and has been specifically written for a live performance by The Dead Goldfish Ensemble. In an effort to avoid the coding wagging the dog the live coding elements are about the arrangement rather than the musical material.
These pieces are intended to be loaded into the buffers simultaneously so it is important the variable names are namespaced to avoid pieces influencing each other. This is the reason for the dge1 etc. prefixes. Some of the pieces finish automatically but you do need to also press Stop to ensure that the code is properly unloaded.
I have not seen live coding done in quite this way so I hope it will be of interest. If you want to make use of the structural aspects of the code please feel free to do so - just change the notes and/or rhythm and it is your piece.
The live coding is done by commenting and uncommenting the cues. An unexpected feature of the language is the ability to pass named variables along with the cues. In this case it is used to set the sound and volume.
The live coding element here is in incrementing the section numbers. Once the last section has been reached it will automatically play three times and then stop. You still need to manually stop everything to ensure the code is unloaded properly.
This actually doesn't have any live coding elements and instead is an example of 'process' music where the music changes under a set of rules until it comes back to the beginning. The process here is to play one note of a phrase twice, then two notes, three notes etc. The use of two buffers is not actually necessary but as noted in comments you have to start them in the right order.
This started as an attempt to do something more percussive but the thing that made it was the misc_cineboom sound. This is a two buffer piece so don't forget to start them in the right order. The live coding part is in modifying the grid of ones and zeroes to change the pattern.
Another two buffer solution, this time to allow some of the variables to retain their values as the second buffer is re-started. This is important for the rhythm to remain consistent. The live coding element is in commenting and uncommenting the cues.
Another piece based around a sequence of patterns that are played in order. Again the pattern is played three times before automatically stopping. Take care to hit Stop to ensure the code is unloaded properly.
Another piece based around a sequence of patterns that are played in order. Again the pattern is played three times before automatically stopping. Take care to hit Stop to ensure the code is unloaded properly. You've probably noticed the DGE theme by now...
Another piece relying on cues for the live coding element.
Another use of two buffers to allow the rhythm to carry on unchanged as things in the second buffer are changed. The live coding is done by changing the ones and zeroes in the patterns.
This is varying which notes in a pattern are played by setting ones and zeroes in the pattern arrays.
One of the early attempts at having something to live code - the probably familiar structure of Terry Riley's In C where each instrument plays the patterns in turn, with the changeover being decided by the player until they are all playing the last pattern at which point the piece finishes.
This was composed specifically for a performance on the online radio station La Station on 25 October 2017