Tag Archives: supercollider

Endorsement – SuperCollider for the Creative Musician

I wrote a book endorsement for SuperCollider for the Creative Musician by Eli Fieldsteel

SuperCollider for the Creative Musician teaches how to compose, perform, and think music in numbers and codes. With interactive examples, time-saving debugging tips, and line-by-line analysis in every chapter, Fieldsteel shows efficient and diverse ways of using SuperCollider as an expressive instrument. Be sure to explore the Companion Code, as its contents demonstrate practical and musically intriguing applications of the topics discussed in the chapters.

The endorsement had a word count limit. This book deserves a more detailed review. I agree with Fieldsteel’s statement in the Introduction that the book is a  “tutorial and reference guide for anyone wanting to create electronic music or experimental sound art with SuperCollider.” Musicians, media artists, and programmers will learn the fundamentals and practical applications of SuperCollider by reading the book from cover to cover. I especially recommend this book to musicians seeking the connection between creative coding and their artistic practice. Electronic musicians learn to express musical ideas in numbers and symbols when they code music.  Coding trains users to think of music differently as a result, and the author does an excellent job of teaching how to do so. 

Fieldsteel’s expertise in composing, performing, and teaching SuperCollider for over a decade is evident in every chapter. The author correctly anticipates common beginner challenges and provides the most efficient solutions. I love Tip.rand sections dedicated to troubleshooting and debugging. They are essential in increasing productivity and decreasing the frustration of learning a new environment. The book’s biggest strength, as demonstrated in Tip.rand, is its accessibility. The language, style, and examples do not assume that the readers have previous programming, music synthesis, or audio engineering experience. Included figures, tables, and example codes are also effective and pedagogical. I was happy to see that the printed codes’ font is identical to the default font of SuperCollider IDE.  It reconfirms the author’s effort in creating inviting chapters to learn a language with a considerable learning curve.  

I spend the first month of my SuperCollider class helping students overcome the initial steep learning curve. The book will dramatically reduce the time and frustration of going over that hump. I don’t think other existing SuperCollider resources will help as much as Fieldsteel’s book for that purpose.

Elegy No. 2 – live at SPLICE Institute

I performed Elegy No.2, written in 2018 for violin and computer, with melodica at the SPLICE Inistute 2023. It is not a happy song, but I share what I can express only with music. Sarah Plum recorded the original version beautifully, but I have been playing the song as my solo shows since COVID.

If you own a melodica and want to play this, the score and SuperCollider file are available HERE. You don’t need to know how to use SuperCollider. The instruction to run the code is here. Please use the score as a guideline, and feel free to improvise.

847 Twins – Brief Analysis

The production of 847 Twins, the title track in the album Fan Art, is documented in four sections. The first section, Program, is a one-paragraph description of the music written for a concert booklet or album promotion. I share information and thoughts that may help listeners enjoy the music. The second section, Form, is for the creators who want to learn how I used electronic sounds in composition. The third section, Code, is for the technologists who want to learn how I designed the piece in SuperCollider, a code-based audio app. Links to the code are available here. The last part, Anecdote, has extra narrative relevant to 847 Twins but is optional to enjoy the piece.

If preferred, read this article in PDF format.

Program

847 Twins is a two-movement piece based on harmonic progressions of Prelude & Fugue in C Minor by J.S. Bach. An electronic remake of Bach is a well-known practice pioneered by Wendy Carlos and Pierre Schaeffer (Switched-On Bach & Bilude). I learned so much from reading and listening to their works. J.S. Bach is also my hero composer. Therefore, it seemed appropriate to dedicate a song to my musical cornerstones in an album about fandom.

Listen to the tracks linked below before reading the next sections.

The tracks are available on other major platforms at  https://noremixes.com/nore048/

Form

Mvt I. Pluck

Pluck and Blip, the two movements of 847 Twins, algorithms written in SuperCollider use the harmonic progression of the Prelude in BWV 847. The downloadable code, 847_Pluck.scd, generates randomized voicing patterns played by a guitar-like synth. Below is a step-by-step explanation of how the composition process. 

  1. Design an electronic string instrument. Each note of this instrument is detuned at a different ratio every time the string is “plucked.” The note’s duration, dynamic, string stiffness, and pan position also vary randomly. 
  2. Using the instrument in Step 1, strum a chord with notes at a measure in BWV 847. Unlike a guitar, a strum of a chord can have multiple pan, accents, and note durations due to the randomization in Step 1.
  3. Each measure of BWV 847 is played four times before advancing to the next measure.
  4. Add a bass part with gradually increasing loudness. It plays the lowest note in the corresponding measure. 
  5. Add the intro and the outro for a better form. They are not quoted from BWV 847.

In short, the first movement of 847 Twins is a reinterpretation of BWV 847 featuring an imaginary string instrument and a synth bass. I loved how Bach created exciting music with a predictable rhythmic pattern. The key was harmony and voicings. I wanted to emphasize that aspect with an additional layer of dynamics articulations in Pluck. The added bass line, which imitates the “left hand” of basso continuo, fills in the low-frequency spectrum of the piece. The bass part is best experienced with a headphone or a subwoofer. 

Mvt II. Blip

The first movement lacked elements of counterpoint, so I tried to make an electronic polyphony in the second movement. In Blip, each measure has 3-6 parts playing different phrases derived from a measure in BWV 847. The phrase shape, the number of voices, and articulation are determined randomly at every measure and create a disjunct yet relative form. Schaeffer’s Bilude explores this idea by combining piano performance and recorded sounds.   

Below is my process of creating a random phrase generator. Please run 847_Blip.scd to hear the piece.

  1. Create a list of pitch sets by reducing repeating notes in each measure of BVW 847.
  2. Make three different synth sounds.
  3. Make a phrase generator that uses the list in Step 1 and synths from Step 2. The instrument choices, phrase length, note subdivisions, and articulations are randomized. The SuperCollider code also has the option to generate a rhythmic variation (i.e., insert rest instead of a note). 
  4. Make a polyphony generator that spawns the phrase generator described in Step 3. The number of polyphonic voices and their octave transpositions are random. 
  5. Play and record Step 4 twice. Then, import the tracks to a DAW. Insert a reverb plugin on one track. The reverb should be 100% wet. 
explanation of analysis
explanation of analysis

The algorithm described above creates different timbres, polyphonic patterns, and the number of voicings at every measure. Furthermore, every rendition of the SuperCollider code makes a unique version of Blip. One measure can be a duet of two-note phrases, and the following measure can be an octet of eight phrases played in a four-octave range. The room sound created by the DAW reverb plugin doesn’t reflect the source, but it sounds similar enough to be heard as part of a whole. 

Code

Mvt I. Pluck

The SuperCollider file for Pluck consists of seven parts. Please download and use 847_Pluck_Analysis.scd to hear and modify each part. Make sure to run the line s.options.memSize=8192*16 to allocate enough memory. 

  • SynthDefs: SynthDef(“Gtr”) uses a Karplus-Strong physical model with controllable pan, frequency, stiffness, amplitude, and duration. SynthDef(“Bass”) makes a sinusoid tone with a percussive amplitude envelope. The UGen Lag.kr smoothens the sharp transient of the amplitude envelope. 
  • ~onenote: this function uses two SynthDef(“Gtr”) to create a detuned note. The amount of detuning is randomized along with other parameters of the SynthDef.
  • ~stroke: this function creates instances of ~onenote with pitches specified in the ~chords array.  ~chords is a collection of all the notes in the Bach Prelude, categorized and indexed by measure number. The order of the notes in a measure is random.  ~stroke plays the chord in sequence or reverse to simulate a guitar’s up and down stroke motions. 
  • ~strums: this function continuously triggers ~stroke. The global variable ~pulse determines the tempo. ~strumsend function is used once for the ending. 
  • ~clock: this function changes the chord progression at time intervals set by the global variable ~mdur. It also changes the parameters of ~strums by altering the values of global variables ~mm~accent~volume~notedur, and ~stiff. Note that both ~strums and ~clock functions must run simultaneously for a correct chord progression. 
  • ~bassline: this function plays SynthDef(“Bass”) a few seconds after the start of the piece. It uses the if condition to change the rhythmic pattern. The line pitch=~chords.at(count).sort.at(0) picks the lowest note of each measure as a bass note.
  • SystemClock: this scheduler syncs ~strums, ~clock, and ~bassline to play a version of Pluck. Every rendition of SystemClock will make a new variation of the track.    

Mvt II. Blip

The SuperCollider file for Blip consists of four interconnected parts. Please download and run 847_Blip_Analysis.scd to hear each part.

  • SynthDefs: The three SynthDefs, PBeepTBeep, and SBeep, are all slightly detuned percussive instruments featuring a classic oscillator waveform, such as sine, triangle, and pulsewidth. 
  • ~phrase: this function creates a short melodic pattern based on pitch sets received from global variable ~arp. It controls which SynthDef to use, amplitude, phrase length, note duration, and transposition. The last two arguments activate or deactivate that random rhythm generation and arpeggio pattern variation.  
  • ~section: this function duplicates ~phrase. The number of ~phrase and octave transpositions are randomized. The function also makes further variations on amplitude, note duration, and panning.
  • The Routine in the last section uses the ~piece array as a cue list with details on when and how to trigger the ~section. The array ~chords is a list of all the notes in corresponding measures of the Bach Prelude. The Routine also sends a changing pitch set from ~chords to ~phrase via the global variable ~arp.

Anecdote

847 Twins does not use the Adagio section of the Prelude and Fugue. When composing the first movement, I could not transition from a constant 16th-note drive to a free and improvisational ending. I tried to address this incompleteness by writing a complementary movement, Blip, but it did not work out. I made a satisfying solution six months after completing 847 Twins by incorporating an instrument I could improvise aptly and freely. Nim6tet, the sixth track in Fan Art, has six layers of no-input mixer improvisation guided by the chord progressions of the Adagio section. It shamelessly shows off no-input mixer sounds I can not create with other instruments. 

It took many attempts in the period of 1.5 years to finish three tracks about the first half of BWV847. The electronic interpretation of the Fugue part is a puzzle yet to be solved.

More Analysis and Tutorials

Updated on 4/13/2023

End Credits – Brief Analysis

End Credits, a fixed media composition included in the Fan Art album, is documented in five sections.  The first section, Program, is the program note to be included in a concert booklet or album promotion. I share information and thoughts that may help listeners to appreciate the music better. The second section, Form, is for the creators who want to learn how I used electronic instruments to create a complete piece. The third section, Code, is for the technologists who wish to understand how I coded the piece. Musicians familiar with code-based apps like SuperCollider and Max will benefit from analyzing the code. In the fourth section, Inspirations, I share why I chose to write the piece. The content is too personal to be on the program.  The last part, Uniquely Electronic, is a bonus section featuring sounds and ideas I could not express in an album format. Fan Art is available as streaming stereo tracks, but they are originally designed for multi-channel sound installation. The last section provides resources to realize songs in Fan Art at full capacity.

A PDF Version of this article is also available.

Program 

End Credits is an algorithmic composition based on the harmonic progression of Debussy’s Clair de Lune. The SuperCollider code written for the piece generates notes with unique overtones, and the overall sound reminds me of organ music at viewings. My friend and I joke about writing each other’s farewell music, and I got one for him now. If he doesn’t like it, I will use it as my exit theme.

Listen at Other platforms https://noremixes.com/nore048/ 

Form 

End Credits uses the harmony of Debussy’s Clair de Lune. The downloadable SuperCollider code, EndCredits.scd,  makes sound according to the following instruction.

  1. Choose a list containing all notes present in measure x.
  2. Scramble the order of the notes.
  3. Play notes at random timing. There is a 50% chance of two notes being played simultaneously.
  4. When all notes in the list are used, move to measure x+1.
  5. Repeat steps 1-4 in slow tempo (quarter note = 3.6 seconds). End Credit uses harmonic progressions from mm1 to mm27 of Clair de Lune.  

EndCredits.scd code also generates each note according to the following instruction.

  1. Make a sine tone with randomized slow vibrato and tremolo using two LFOs. Randomize amplitude envelope, LFO rate, LFO amount, and pan positions. 
  2. Make a single note by combining 5 sounds made in Step 1. Then, randomize each note’s positions, frequencies, and pan positions to make a slightly detuned note with a wide stereo image. 
  3. Make a single note with a random number of overtones using the note generated in Step 2. The note’s duration is also random but is almost always longer than a quarter note (3.6 seconds).

The resulting sound is an imaginary organ capable of changing the stops at every note. The instrument also seems to have multiple sustain pedals.

The compositional objective of making End Credits is akin to minimalism. I wanted to create a simple process that yields unexpectedly delightful sounds. So I simply made an ambient piece using additive synthesis and traditional harmony with computer-aided instructions. There’s no new technology or concept, but we create new sounds by combining old ideas. 

Code

EndCredits.scd, the SuperCollider file I made to generate the album version of End Credits,  has the following sections.

  • SynthDef (“Cell”): makes a sine tone with controlled random values
  • ~note: make a note event using SynthDef(“Cell”)
  • ~chords: an arrayed collection of note numbers representing harmonic contents.
  • ~event: play one measure using ~note with pitches  in ~chords
  • SystemClock: play the music 

To make sense of this section, open EndCredits_Analysis.scd on SuperCollider and refer to the code while reading the next sections. The analysis .scd file has simplified working codes. 

SynthDef(“Cell”) 

End Credit uses one SynthDef featuring two  LFOs, one ASR envelope, and one stereo sine tone generator. By playing two instances of SynthDef(“Cell”) with slight pitch differences, we can make a simple detuned sound. The codes in section //1. “Cell” without randomness shows the simplest form of the instrument. The actual SynthDef used in the piece is in //2. “Cell” with randomness. It applies ranged random values to give varieties in amplitude envelope’s attack and release time, LFO’s frequency, phase, amplitude, and pan position. 

~note

~note is a function with the following parameters.

~note.(pitch in MIDI number, duration (sec), volume (0-1), number of overtones);

By providing a number for each parameter, ~note creates a tone with a varying number of detuned overtones. As we can observe in //3. ~notes,  loops (.do) and ranged random number generators (rrand) were extensively used. Try to run the following line on SuperCollider to hear the difference. Notice that the sounds are not identical when the codes are re-evaluated.

~note.(50,10,0.3,1); //no partials

~note.(50,10,0.3,5); //some partials

~note.(50,10,0.3,10); //many partials

~chords and ~event

~chords is an array of interval values representing the notes in a measure in Clair de Lune.  As evident in //4. ~chords,   method .scramble is at the end of every measure to randomize the sequence order. For analysis purposes, only three lists are inside ~chords

~event plays ~notes according to the pitch choices in ~chords. One measure in End Credit is thus generated with the following parameter

~event.(measure index number, note duration factor, amplitude, overtones, harmony probability (0-1.0))

As we can observe in //5. ~event, the note duration factor is a multiplier for each note’s duration. The larger the number, the longer the note duration, resulting in a sustain pedal-like effect. The overtone amount also gets a slight randomization for variety. The last parameter, harmony probability, can control the chance of the following note being played simultaneously. 

SystemClock

Codes in //6. SystemClock is responsible for putting everything together to produce audible sounds. The section uses Routine to make ~event go through all the measures provided in ~chords. SystemClock provides a 2-second silence, a little pause before listening to everything. 

Inspirations

I composed End Credits n February 2021, the end of strict COVID-19 isolation days. I must have been listening to Debussy recordings often to keep myself together. Clair de Lune’s lowest note, Eb in mm15, felt like the most beautiful piano note then. The timing was perfect, and it resonated with the piano’s body and the listener’s mind. I wanted to recreate that in an electronic music context. So, I created a sound that imitates the slight detune of the low range of the piano. Then, perhaps due to COVID blues, I instructed the computer to play those sounds in blurry and slow motion.  

Uniquely Electronic

End Credit has two playback modes: ~onetime or ~infinite. The one-time version with a fixed duration (8:26) is available on major distribution platforms for listening, and any media player can play it. The installation version goes on indefinitely with varied timbre, timing, and duration. The listener will need to run EndCredits_infinite.scd on SuperCollider. Let it run for hours on solemn and not-so-happy occasions!

More Analysis and Tutorials

Updated on 4/13/2023

Fan Art – Album Link

Fan Art is now available on major platforms. For a comprehensive list of distributors, visit https://noremixes.com/nore048/

At a solo concert last night, I promoted Fan Art for the first time. As you can see in the picture, it felt awesome.

photo by David McCarthy

I will write more about each track in the following weeks. Go listen to the album!