Hey there! I run a Facebook group called Electronic Music Philosophy where, among other discussions, I set challenges for the group to complete and release as an album every 6 weeks. I’ve been trying to use Sonic Pi for my contributions as much as possible to familiarize myself with the program, and hone my skill.
Our most recent challenge was an exploration of phase music (Reich style), and I felt that the source of my track was strong enough to share.
Source: https://gist.github.com/Skoddiethecat/6d3581beee3be35b388c634aceb5c439
Output: https://electronicmusicphilosophy.bandcamp.com/track/transitional-entropy
As an interesting easter egg, the code includes a commented line from an earlier revision where my primary melody was playing duophonic chords. I ended up deciding that this overwhelmed the track, but it seemed fun to keep it included for anybody playing with the source.
Here is a brief synopsis of my compositional process for this track:
I initially began with a random phrase in 5-ET, and had three melodies phasing with a randomly changing, but in-sync tempo to create rhythmic variation. After about a week of this, I decided it sounded terrible and threw it out.
I went back to the drawing bored and started thinking about Reich’s Piano Phase. The melody of Piano Phase is interesting on its own, and even sounds good played a single time without repetition. With this in mind, I started looking at melodies with a prime number of notes in 5-ET, but this was still too cacophanous for me. I considered switching to an approximated Pelog in 12-ET, but I do this SO MUCH. Searching for something else, I got to thinking about Gamelan Jegog, and specifically how it doesn’t sound like Gamelong Gong Keybar. I looked up the tuning and discovered that it uses a 4 note scale that is pretty darn close to a dominant 7th chord in 12-ET. After a little bit of messing around, I had my melody.
At about the same time that I reached this stage, a friend posted about Euclidean rhythms. The idea seemed pretty interesting, so I started looking at how to accomplish it in Sonic Pi. I didn’t have to look far, Spread generates them directly into a Ring. A few lines of code (and the discovery of Ruby’s weird one-liner conditionals) later, and I had a melody that would phase while working through random euclidean rhythms in sync. Furthermore, my melody had 13 notes, but the rhythm has a maximum of 12 pulses, which causes the first note to shift forward no matter what.
Once I had this established, I added a faster version of the melody with no euclidean rhythm two octaves up, and another two octaves down at a slower speed. I was generally happy with the sound at this point, so I refactored the code to functionize each instrument, then created higher level functions to call and phase the instruments, as well as apply effects. Finally, I wrote the main code to ‘arrange’ the piece by calling the high-level functions and specifying how many times they should repeat, as well as any arguments that I wanted to vary throughout the piece. After listening to this a few times I felt that it was too sparse, so I went back and added legato strings to reinforce the harmony, following the same patterns I had used for the other parts.
The piece has five major sections with changes indicated by a chime:
• The first section plays the bass 4 times, then brings in the melody and higher melody. After 8 more cycles of the bass, the strings come in to round out the sound. This section lasts for just under 10 minutes.
• The second section is the same as the first, except the euclidean rhythm for the melody begins to rotate as well as phase, creating more complex rhythms. This section lasts for just under 10 minutes as well.
• The third section redefines many of the variables, simplifying the melody, doubling the tempo of the bass, changing the number of euclidean pulses to 5 (from 12), and using a different random seed to vary the sequence of rhythms.
• The fourth section uses a loop to slow everything down, by adding a constant value to the timing variables each phrase
• The fifth section changes the melody to a rising pattern while continuing to slow, and this finishes out the track.
I had a LOT of fun making this piece, and I hope it’s even half as enjoyable to listen to.