Web developer and designer.
mail [at] gabrieldavison [dot] me [dot] uk
about me...

Conway's Game of Life and Generative Musical Sequencers

July 23, 2020

Sound of life screenshot.

Conway’s Game of Life is a cellular automata first devised by the mathematician John Conway in 1970. The game consists of a grid of cells that have two states, either dead or alive. Each round the state of a cell is decided by the following three rules.

  • Any living cell with two or three living neighbours stays alive.
  • Any dead cell with three live neighbours comes to life.
  • Any live cell with less than 2 living neighbours or more than three living neighbours dies.

These simple rules lead to some interesting generative patterns and behaviour.

Animated gif showing the Game of Life in action

Using Robert Heaton’s guide from his series of blog posts ‘Programming Projects for Advanced Beginners’ I built my own implementation that runs in the browser. You can try it out here.

Not wanting to stop there I added a musical element to my design and a new iteration called the Sound of Life was born. This version uses the game of life as a generative musical sequencer. The board is divided up into zones. Each step the sequencer counts the number of living cells in the active zone and uses this information to trigger a note from a predefined scale.

The sound generation is handled by the Tone.js library. I used it to build a 2-op FM synthesizer that runs into a delay with a feedback control. The result sounds surprisingly good.

You can try it yourself here. Or read through some more detailed documentation on the projects github page.