Composing & Art with Cellular Automata

Lab 5 Blog Post — COMS3430 Spring 2026

What Is a Cellular Automaton?

A cellular automaton (CA) is a grid of cells, each of which can be in one of a small number of states (usually just alive or dead). At each time step, every cell looks at its neighbors and follows a rule to decide its next state.

The concept behind this was invented in the late 1940s by mathematician John von Neumann, beginning from one question that I find very interesting: can a machine build a copy of itself? His colleague, Stanislaw Ulam, suggested using a discrete grid as the mathematical framework. From there, the first cellular automaton followed. Von Neumann eventually designed a 29-state CA that could theoretically self-replicate since it reads itself and builds something from itself.

20 years later, mathematician John Conway designed a simpler 2-state CA (Conway's Game of Life).

The Idea

Von Neumann's idea is very interesting to me; the premise that a machine can build other machines would be very useful for society, albeit also dangerous. Looking at the Game of Life, it's shocking that this could actually work in the real world. What surprised me about this lab was that all we need for a self-replicating cell is such a simple set of rules! You map rows to pitches and generations to time. A cellular automaton doesn't know anything about music. It only knows a grid of cells, a neighborhood, and a rule for if each cell lives or dies. Yet, it can produce an interesting art form when you interpret its output as music and graphics (or even relate it all to nature, the stars).

The code is just a 10-row by 18-column grid, a wrap-around boundary so edge cells behave identically to interior ones, and a birth/survival rule that updates the whole grid in steps. Each row is a pitch from the chosen musical scale. Each generation is a moment in time. Rows with at least one alive cell sound their pitch in that generation, arpeggiated from low to high.

Why Wrap-Around Boundaries Matter

Due to the constraints of the screen, early on I tried a fixed boundary, where cells outside the grid counted as dead. The result was that patterns near the edges always died faster than those at the center, so the sequence would thin out and go silent toward the end. Wrapping the grid on both axes (so column 0's left neighbor is column 17, and row 0's top neighbor is row 9) keeps the automaton statistically uniform across the whole surface. Musically, this means the density of notes doesn't fade without reasoning from the CA.

Personal Choices for Composition (Density and Rule Choice)

The two most musically meaningful knobs turned out to be initial density and rule selection — not the scale or the octave, which I expected to matter more.

Conway's Life (B3/S23) with low density (0.2) produces dispersed, isolated patterns that slowly cycle or die. The music comes out hesitant, with long silences. At higher density (0.5) it produces chaotic early generations that stabilize into oscillators, which translates into sequences that start complex and gradually settle into a repeating figure. Noise finding itself into pattern is something composers work hard to achieve intentionally, so I found this very interesting.

What the Piano Roll Reveals

Adding a piano roll visualization (generation on the x-axis, pitch row on the y-axis) made the CA's structure understandable in a way that listening cannot. You can see oscillators as repeating column patterns, gliders as diagonal streaks, and still lifes as horizontal bars that stay fixed for many generations.

It also revealed something unexpected: the visual structure of Life patterns maps onto recognizable musical textures. An oscillator with period 2 produces a trill. A still life produces a sustained chord. It's very interesting how the automaton isn't composing on purpose, but the tools it uses overlaps with the vocabulary of music.

Limitations

The current design treats all alive cells in a row as equivalent, since a row with one alive cell and a row with seventeen alive cells both contribute the same single note. I wish I could figure out a better way to represent sounds in this program without introducing weights or biases in certain sections on my own. A better mapping might use something like the alive cell count as a velocity or duration modifier. Also, each note in an arpeggiated generation has the same duration despite how many pitches are produced. This makes it uninteresting, as there is not any variation.

Rhythm in general is absent here. The only rhythmic information is how many pitches activate per generation. Denser generations take longer to arpeggiate, so they feel slower. A fully serialized approach would treat duration and accent as grid parameters with pitch, which would require a second grid or more complex state encoding.

Takeaway

Cellular automata are very interesting in and of themselves, but especially as a compositional tool, because the composer's control is indirect. You don't write notes, they almost write themselves. You write initial conditions and a rule. The system then generates consequences you couldn't fully predict. That gap between intention and outcome is where the interesting music, new ideas/skills/techniques, and further innovation thrives. The same logic applies to algorithmic composition as a whole, and I plan to continue exploring it!