Chapter 1 — The Case for a Headless Studio

Take 47 is a diff

Here is a complete, honest description of how I changed the guitar sound on one of my songs last month:

-GUITAR_AMP = AMP_TWIN
+GUITAR_AMP = AMP_AC15

One line of code. I changed which amplifier the guitar plays through — from a Fender Twin to a Vox AC15 — the way you’d change any setting in any program: edit the variable, run it again. Ninety seconds later I had the same song, same performance, every note identical, through a different amp.

Not a performance like the last one. The same performance. When I couldn’t decide between the two amps, I generated both versions and listened blind. When I wondered whether the chorus effect belonged before the amp or after it, that was a one-line change too, and the answer took four minutes to settle beyond argument.

If you’ve ever used recording software — GarageBand, Ableton, Logic, any of the programs the industry calls DAWs (Digital Audio Workstations) — you know this is not how it normally goes. Changing your mind after the fact means clicking through the project, re-doing things by hand, and hoping you remember what else you touched. Your experiments live in the undo history and nowhere else.

My whole studio is a set of Python scripts. A song, for me, is a program whose output is a finished audio file. This book is about how that studio works and how to build your own — and you don’t need to be a Python expert to follow along. If you can read a for loop and a function definition in any language, you’re equipped; everything Python-specific gets explained the first time it appears.

But first I owe you an argument for why anyone would do this.

What a DAW actually is

Strip the interface off any music production program and you find the same four machines inside:

  1. A scheduler — a list of what should happen when: play this note at this moment, trigger this drum sample at that moment.
  2. A plugin host — the part that loads instruments and effects (plugins) and pushes audio through them.
  3. A mixer — the part that combines many instrument tracks into one, each at its own volume.
  4. A renderer — the part that runs everything and writes the final audio file.

Everything else — the timeline you scroll, the piano roll, the faders — is user interface on top of those four functions. And the interface is the whole product: it’s what lets a musician who will never write a loop make records.

But here’s the thing about those four machines. A scheduler is a sorted list. A mixer is addition. A renderer is a loop. And the plugin host — the one genuinely hard piece of engineering — turns out to be something you can install with one command:

from pedalboard import load_plugin

amp = load_plugin("NeuralAmpModeler.vst3")   # a real guitar amp plugin
produced = amp(guitar_recording, 44100)      # audio in, amped audio out

That’s a real, professional-grade amplifier simulator — the same plugin working guitarists use in Logic — loaded and running in two lines of Python, no window anywhere. (The 44100 is the sample rate, which we’ll properly meet in the next chapter; for now, it just means “CD-quality audio.”)

Once I understood that plugins — the crown jewels of forty years of audio software — could be driven from a script, the rest of the DAW stopped looking necessary. What remained was a question: if the studio were a program, what would that buy you?

Buy-in #1: the performance that never has a bad night

Run one of my song scripts twice, and the two output files are identical. Not “sounds the same” — byte-for-byte identical. Programmers call this determinism: same input, same output, every time.

That sounds like a party trick until you see what it enables. Every choice in the song — every note, every volume level, every effect setting — is a line of code. So every experiment becomes a controlled experiment. When I compare the AC15 version against the Twin version, I know with complete certainty that the amp is the only difference. The drummer didn’t rush one take; there are no takes.

Even the “human” imperfections are deterministic. My bass and guitar parts get small random timing and volume variations — real hands drift, and music with zero drift sounds robotic. But the randomness comes from a random number generator with a fixed seed (a starting value that makes the “random” sequence repeatable). Take 47’s tiny stumble is identical to take 1’s, unless I choose to change one number and roll a new performance.

Determinism also makes curiosity cheap. Does the synth pad even earn its place in this song? Multiply the pad’s volume by zero, render, listen. Ninety seconds. When experiments cost that little, you stop settling questions by fatigue and start settling them by listening.

Buy-in #2: the studio that remembers why

Because a song is a text file, a song’s history is a version-control history. Mine reads like a producer’s notebook, except every entry is executable:

bass: added a distorted layer under the clean one, quiet — the clean
      bass alone got lost under the drums
drums: swapped LinnDrum for MFB-512 after comparing all eight machines
chorus: lead guitar enters 8 bars later; doubled the quiet section

Every one of those is a decision I can revisit, reverse, or branch from. What did the song sound like before I doubled the quiet section? Check out the old version and render it. What if the whole album used the smaller-sounding room? That’s a branch, and the experiment runs across twelve songs while I make dinner.

Ask what the equivalent is in a DAW: project files named song_final_v3_REAL_final, and the reason the bass changed in March existing only in your head. I’m not claiming version control makes better music. I’m claiming memory does — and code is the only studio medium that remembers everything, including intent.

Buy-in #3: the for-loop is a producer’s superpower

The moment that converted me wasn’t about sound quality at all. I needed to pick a drum machine for a song. I had drum sounds from eight real machines — the famous LinnDrum, the Roland TR-808, six others. The DAW way to choose is to swap sounds in by hand, audition two or three, get tired, settle. The script way is a loop: render the song’s actual beat, through the song’s actual effects, once per machine. Eight audio files, one blind listen, one clear winner.

And the winner was not the machine the genre’s history said it should be. It was better. I’d never have found it by hand, because by option four I’d have stopped looking.

That’s the general shape of the leverage: anything your script expresses as a setting — the amp, the drum kit, the tempo, the arrangement — becomes something you can try every version of, for the cost of a loop. A DAW asks: is this good? A script can ask: is this the best of everything I have?

And it compounds. The band I built for one song — the guitar rig, the human-timing engine, the shared room reverb — played the next song the day I wrote its chords. There’s a twelve-track album on my drive that exists because the cost of one more song had fallen to: describe it, listen, revise.

What this costs you

Now the honest part, because the DAW’s interface is not a weakness — it’s the entire point of a DAW, and giving it up costs real things.

You lose immediacy. There’s no grabbing a knob while the music plays. My creative loop is edit → render → listen, and even at ninety seconds, that’s a different rhythm than turning a physical dial. Some ideas die in those ninety seconds. (Some survive because of them — being forced to listen to the whole section, rather than looping two bars forever, catches problems the DAW workflow hides. But the trade isn’t free.)

You lose recording. This book will not help you record a singer or mic a guitar cabinet. A code studio is an arrangement and production instrument: it plays sampled, synthesized, and simulated instruments with programmed performances. If your music is built on live takes, this pipeline can still be your sketchpad and your mixing back end — there’s a whole chapter on handing work between the script world and the DAW world — but the recording booth stays human.

You take on plumbing. Plugins built for the wrong kind of processor. Sample libraries in formats nobody documented. Libraries that won’t load for reasons that take an afternoon to diagnose. Several chapters of this book exist precisely because I lost those afternoons — you’re buying the afternoons back, but you should enjoy that kind of problem-solving to live here.

Who finds the trade worth it? Developers who make music and always felt the DAW wasn’t quite their instrument. Producers drowning in repetitive rendering work a loop should be doing. Tinkerers who want to know what the magic boxes actually do. And anyone building software that needs to produce music without a human at the controls.

The shape of the machine

Here is the entire studio this book builds, as one picture:

  the song, as data          sections, chords, patterns — plain lists
        │
  note events                one list of notes per band member
        │
  instruments                samplers, synths, sampled drums — one track each
        │
  effects                    each member's amp/pedal chain (real plugins)
        │
  the mix                    volumes, plus one shared "room" reverb
        │
  the record                 final file + per-instrument files for remixing

Every arrow is a plain function; every box is a chapter. Part I builds the instruments. Part II assembles the band. Part III makes an album with it and ships it.

One warning before we start: the first time you run a script and a finished song comes out — mixed, warm, breathing — the DAW in your dock starts to look strange, like a fax machine after email. I take no responsibility for what happens to your old projects after that.

Let’s build the instruments.


Next — Chapter 2: A Synthesizer You Can Script.