Sign in →
CloudLab Works emblem: Waku the orca ringed by CloudLab and WorksCLOUDLAB WORKScrossed whale bones, one end a wrenchCloud City, headwaters of the agentic cloud revolution!

Code as Music

The lab as sound, and as the Salish Sea. The lab's activity drives an instrument written in Sonic Pi. That is L79 behind this page, a Southern Resident in Haro Strait. The light on the water moves with the music; a deploy sends a ring across it.

lab · loading

Press play. Your browser becomes the instrument; nothing streams from the lab.
Spectrum, low notes left in amber, high notes right in teal; the line is the waveform. The graph follows whichever is playing: the lab or a recording.

Live on Twitch

Friday Drop: every Friday, 12:00 PM Pacific. The week's new lab music premieres live, with the visualization and chat. See it on the calendar (subscribe there) · Twitch-only feed · schedule on Twitch

The lab streams at twitch.tv/cloudlabworks: this music and its visualization as an always-on radio, live builds from the Duvall lab, and architecture whiteboard sessions with chat. Follow the channel and Twitch tells you when it goes live.

Follow on Twitch Short link: cloudlabworks.dev/twitch. Following needs a free Twitch account; watching does not.

How it works: a small state file drives the score. The page reads it every half minute and plays it: E major, a slow plucked arpeggio and an airy pad in the calm; minor, slower, with a low tone underneath, when the mood turns; a rising bell figure when something new ships. The score is code in git; the browser is a second copy of the instrument. The sea is the visualizer: swell follows the low end, light on the water follows the highs, and a deploy is a breach.

Reading: music as the original programming language

Michael Mucciarone, a pipe organist turned engineer, argues in Music: The Original Programming Language (Capital One Tech, 2020) that sheet music is code and the musician is its interpreter: a page of Mozart runs in a trained reader's head the way a script runs in Python. The mapping holds further down. Instruments are languages, each with its own syntax and idioms (a piano's grand staff is polyphonic, a trumpet's single treble line is monophonic and transposes to B flat), and a pianist picks up the trumpet faster than a non-musician picks up either. The note is the object, with duration in powers of two, dots and accidentals as properties, ornaments as decorators. Repeat signs and first, second and third endings are loops with a branch on the iteration count. His pseudo-code for a passage with three numbered endings:

x = 0
for x in range(4):
    play measure 1
    if x == 1:
        play measure 2
    elif x == 2:
        play measure 3
    elif x == 3:
        play measure 4 to end
    x += 1

This page runs the argument in reverse: the score is code in git, the browser is the interpreter, and the lab's own state is the input.

Recordings, by date

Recorded from the lab's own instrument: twenty seconds around each fault, recovery and deploy, assembled nightly into one take per day.

  1. Loading…

Tracks

Music written as code and rendered from the script. Each track is an original arrangement by Alex, built in Sonic Pi and bounced to audio without a keyboard, a microphone, or anyone else's recording in the chain. Arrangements, not reproductions: the songs belong to their writers; the code and the render are Alex's.

  1. Three Little Birds

    Sonic Pi arrangement of the Bob Marley song · 74 bpm · 130 s · MP3, 192 kbps

    Alex's own arrangement, not Bob Marley's recording and not a sample of it. Four live loops running against each other at 74 bpm, the classic reggae tempo, rendered headless through Sonic Pi's engine for 130 seconds.

    • Piano skank: A major and D major chords on the off-beat, the "and" of every beat.
    • Lead melody: the chorus line, played on a synth lead.
    • Drums: a one-drop reggae pattern, bass drum on the one, snare on two and four.
    • Hi-hat: closed hi-hat on steady eighths.

    Sonic Pi has no arrangement view and no timeline; the loops are the arrangement. The same script played longer would be the same song, longer. Where the instrument above turns infrastructure state into sound, this is the plainer case: a score in a text file, and an engine that plays it.

  2. Is This Love

    Sonic Pi arrangement of the Bob Marley song · 122 bpm · 142 s · seed 7 · MP3, 192 kbps

    Alex's own arrangement, not Bob Marley's recording and not a sample of it. Six live loops at 122 bpm, and this one has a structure: an arrangement director cycles the song through verse and chorus, pre-chorus, and solo, switching every 16 beats, and the other loops read which section is current and play their part for it. Rendered headless for 142 seconds, six full passes through the cycle, from random seed 7, so the solo comes out the same every time it is bounced.

    • Arrangement director: sets the section, verse and chorus, then pre-chorus, then solo, 16 beats each, and repeats.
    • FM bassline: F-sharp minor to D under the verse, chorus, and solo; a G-sharp minor to C-sharp minor walk under the pre-chorus.
    • Piano skank: the chords on the off-beat, following the same section changes.
    • Lead line: switches synths per section. A saw lead carries the chorus melody, blade pads sustain through the pre-chorus, and the solo is a plucked F-sharp minor pentatonic line, notes and timing picked at random from the fixed seed, panned across the stereo field.
    • Drums: a one-drop pattern, bass drum on the one, snare on two and four, steady through every section.
    • Hi-hat: a closed hi-hat shuffle on eighths, pitched up slightly.

    The director is the whole trick. Each loop keeps its own time and only asks one question at the top of each pass through its pattern: which section are we in. That is enough to turn six independent loops into a song with a shape.

Background: L79, a Southern Resident male of L pod, just south of Turn Point, Stuart Island, in Haro Strait, in the Salish Sea. Photo by Erik Stockdale, Wikimedia Commons, CC0.