Silence, Chance, Cage, Code

Random Silence 2

“Un coup de dés jamais n’abolira le hasard.”  ~ Stéphane Mallarmé, 1897

John Cage is well known as the composer who formalized the use of silence as a compositional element on par with any other note or sound.  He was also the composer who, though Zen Buddhism, introduced chance into composition, allowing the I Ching to dictate the terms and conditions of sound heard in a way that no egomaniacal romantic would have ever allowed.  Cage was content to determine the methods of composition without micromanaging the process note-by-note.

There are many good books on Cage’s work, including Michael Nyman’s Experimental Music:  Cage and Beyond and Kyle Gann’s No Such Thing as Silence.  But unlike many other composers, Cage is quite capable of explaining himself and his methods.  He is immanently quotable.

“And what is the purpose of writing music?  One is, of course, not dealing with purposes but dealing with sounds or the answer must take the form of a paradox:  a purposeful purposelessness or a purposeless play.  This play, however, is an affirmation of life– not an attempt to bring order out of chaos nor to suggest improvements in creation, but simply a way of waking up to the very life we’re living…” (Cage, Experimental Music, 1957).

Random Silence 1

This program borrows a couple of techniques from Cage.  This implementation of the standard breadboard circuit documented here uses the random number generator within the Arduino to determine which instruments and which pitches will be used for four notes.  Instead of being able to manipulate the materials composers usually control, in this case, the composer or performer can only control the amount of silence.  The four potentiometers to the left on the breadboard control the amount of silence between the four random sounds.  The fifth potentiometer controls the length of time they sound and the sixth controls the overall volume.

The video below demonstrates the circuit in action (or the lack thereof).  This is a very quiet video, asking you, as Cage would, to listen carefully.  Video and code below.

The Sound

The Code


  This program implements the methods of John Cage, including
  random chance selection of musical material and the use
  of silence as sound.

  Elliot Inman

  The program randomly selects 4 notes to be played
  by 4 randomly selected instruments allowing the user
  to control only the amount of silence between the notes
  using 4 potentiometers.  Two additional potentiometers
  capture the desired length of time each note in sequence
  will be played and the overall volume -- allowing the
  user to increase the silence by making the notes play
  for a shorter length of time and/or reducing the volume
  of all notes to 0 for any length of time.

  This program requires no external libraries and is
  written with an emphasis on simplicity, not perfection
  -- no interrupts or other more complex code.  Three
  functions are defined at the bottom of the program.
  MIDI is transmitted via HAIRLESS MIDI or CLASSIC MIDI;
  select the appropriate rate for your setup or you will
  hear only silence.


// Create variables to use throughout the program.

int note[3];  // array for four notes
int velocity[3];  // array for velocity for each note
int silence[3];  // array for four silences

int overall_volume;   // overall loudness
int note_duration;  // length of time each note is played

//  SETUP the Arduino with a baud rate and tell
//  it what to do with various pins
//  This section also initializes the random set
//  of notes, velocities, and instruments.
//  Pressing RESTART on the Arudino board will
//  in effect generate a new random selection.

void setup() {
  //  Set MIDI baud rate for HAIRLESS MIDI 115200:
  //  Serial.begin(115200);
  //  If using CLASSIC MIDI:

  /* Select 4 notes at random from between MIDI note
     number 48 and 60, velocity of 60 to 120, and
     general midi instruments from 0 to 127 */

  for (int i = 0; i < 4; i++) {
    note[i] = 48 + random(12);    // note 48 to 60
    velocity[i] = 60 + random(60);  // velocity 60 to 120
    program_change(0xC0 + i, random(127)); // random instrument
  delay(2000);  // momentary delay to allow user to get ready


//  LOOP that will cycle endlessly.

void loop() {
  while (digitalRead(12) == HIGH)
  { // Turn LED on to indicate running
    digitalWrite(13, HIGH);
    for (int i2 = 0; i2 < 4; i2++)
    { silence[i2] = map(analogRead(i2), 0, 1023, 0, 10000);
      note_duration = map(analogRead(A4), 0, 1023, 0, 1000);
      overall_volume = map(analogRead(A5), 0, 1023, 0, 127);
      control_change(0xB0 + i2, 7, overall_volume); // controller 7 is volume
      noteOn(0x90 + i2, note[i2], velocity[i2]);
      noteOn(0x90 + i2, note[i2], 0);

/*  noteOn function to play a MIDI note
    COMMAND 0x90 sends NOTE ON on Channel 1.
    PITCH is the note from 0 to 127 with 60 as middle C.
    VELOCITY is how hard the note is struck (from 0 to 127),
    but is often perceived as volume.
    Using 0 for velocity is the same as turning a note OFF,
    so that is often used instead of a note OFF command.
void noteOn(int command, int pitch, int velocity) {

/*  control_change function to send a control message
    CTRL_CHANGE 0xB0 indicates control change on Channel 1.
    CTRL_NUMBER is 7 for volume
    CTRL_VALUE is the actual value
void control_change(int ctrl_change , int ctrl_number, int ctrl_value) {

/*  Program_change function to send a program message
    PROGRAM_CHANGE 0xC0 requests a program change on Channel 1.
    PROGRAM_NUMBER is the actual program value
void program_change(int program_change , int program_number) {

~ WEI 2017

This entry was posted in Experimental Music, John Cage, Uncategorized. Bookmark the permalink.