Learning to Code Without a Community

▶ Watch (01:14)

Sam Aaron learned to program alone. No local programmers, no internet, no YouTube. Just a ZX Spectrum manual that exposed a beep command and a draw command. At secondary school he got a graphical calculator for maths lessons and ignored the maths.

“And I perverted the screen into a games engine.” — Sam Aaron

He built worm races you could bet on, a tank game with a trigonometry arc, and eventually a Pac-Man so slow it drew one frame at a time. The first thing he searched on AltaVista was “who else is making weird computer games with a calculator.” Not many people were, and his games looked more interesting. That settled the career question.

How SuperCollider and Clojure Became Sonic Pi

▶ Watch (08:46)

SuperCollider is a synthesis engine with a network API: think nginx, but for music. Sam wanted to drive it from code but Ruby’s concurrency was a disaster for multi-part music. A Rich Hickey talk at a GOTO conference sold him on Clojure. A mutual friend connected him to Jeff Rose, who had just started Overtone (SuperCollider plus Clojure). Sam took a year off to build it.

When the JVM refused to run on the original Raspberry Pi, he had two weeks to ship. He switched to Ruby and implemented Clojure’s concurrency primitives inside it. That became the core of Sonic Pi.

Why Erlang Concurrency Fits Music

▶ Watch (31:51)

Sonic Pi ran on Ruby, Erlang (Joe Armstrong wrote those parts), and C++ for MIDI and Ableton Link. Managing that stack alone was a nightmare. Tau 5 drops everything except the BEAM.

“you don’t really care about errors. You let it let it fail.” — Sam Aaron

Each instrument is a share-nothing process. A supervisor restarts a crashed process without touching anything else. You write single-threaded code; the runtime handles isolation. Sam’s observation: any concurrent system ends up with a half-implemented OTP. Sonic Pi was no exception, so moving to the real thing was obvious.

Using AI Agents to Harden the Sandbox

▶ Watch (28:20)

Sonic Pi’s Ruby runtime was built to be safe for children from the start: sandboxed, memory-constrained, no arbitrary execution. When AI agents arrived, Sam’s first reaction was that they were hideously insecure. His second was that his sandbox was the right place to test them.

He turned an agent loose on the sandbox and told it to escape. It couldn’t. But the AI agent pen-test (30:48) found two denial-of-service holes: the agent ate all the CPU, then all the memory.

“I was using the agent as a pen tester.” — Sam Aaron

Sam patched both issues, re-ran the agent, and confirmed it could no longer pull either attack.

Q&A

Can you give statistics on how widely Sonic Pi is used? Sam said he doesn’t track statistics and doesn’t believe impact should be a number; he noted Sonic Pi shipped on every Raspberry Pi and has been used by millions, but Python’s dominance in curricula is the main barrier to classroom adoption. ▶ 15:15

Can Sonic Pi be used to teach music theory, not just coding? Sam described teaching a masterclass at the Royal Conservatoire of Antwerp, where graduating jazz musicians had used Sonic Pi as their performance instrument, and said that advanced musical use was always the goal. ▶ 24:12

How do you see AI changing music creation? Sam said he wants to perform as himself, not alongside an AI, but sees code-based tools like Sonic Pi and Tau 5 as useful because an AI can generate a score (not just audio) that a human can then study, modify, and learn from. ▶ 41:42

Notable Quotes

And I perverted the screen into a games engine. Sam Aaron · ▶ 2:43

you don’t really care about errors. You let it let it fail. Sam Aaron · ▶ 35:53

I was using the agent as a pen tester. Sam Aaron · ▶ 30:48

concurrency and music are are entwined. Sam Aaron · ▶ 26:23

Key Takeaways

  • Sonic Pi shipped on every Raspberry Pi and has reached millions of students, but Python’s dominance in curricula keeps it out of mainstream classrooms.
  • Erlang’s share-nothing process model mirrors musical concurrency: each instrument is an isolated thread, and the supervisor tree restarts any that crash.
  • Sam used an AI agent as a low-cost pen tester against his Ruby sandbox, found CPU and memory exhaustion holes, patched them, and re-tested until the attacks failed.