← Back to all projects

Procedural Music Generator

An Agent Skill that renders finished background music in pure Python — no music model, no sample library, no DAW — with seamless loops and a measured seam before delivery.

Year
2026
My role
Product definition · UX · Development · Launch
Platform
Skill / Workflow
View on GitHub
README of the procedural-music repository

The background music playing on this site is one of its renders: "Soft Static" — 90 BPM in F major, a seamless 2m49s loop.

01

The problem

Background music for a video or a site has three bad options: paid libraries, assets with unclear licences, or a music model that needs a network call and cannot reproduce yesterday's result. Doing it by hand in a DAW needs music theory and mixing skills I do not have. The brief was one sentence in, a finished track out, offline, and the same track every time.

02

Approach

Composition, arrangement, mixing and quality control are all deterministic Python: a preset sets the style, a seed pins the randomness, and a self-check report decides whether the render ships. Nothing is sampled from anywhere — every partial is computed.

03

Key product decisions

01

Seams by folding, not fading

The render runs 3.2 s past the end, folds the tail back onto the head and cuts on a whole bar, so the reverb tail is never chopped and the harmony still lines up when the loop wraps. The first version faded at the loop point instead, which left a level notch on every repeat.

02

One seed pins everything random

The same seed re-renders the committed demos byte for byte, because it fixes the noise beds and the reverb impulse response. Without it every run produces a different file.

03

Percentile, never absolute

A seam whose head and tail were both forced to silence reports a step of 0.00000 and passes a naive check for the wrong reason, so every seam number is a percentile against the rest of the track.

04

From brief to delivery

01

Brief

Pick one of six presets (88 BPM in D major to 118 BPM in G major) and change only what the brief touches: BPM, chord progression, lead timbre, reverb, band targets.

02

Render and check

--qa measures every file written: peak, RMS, crest, five-band balance from an averaged Welch PSD, stereo width, and the seam against the rest of the track.

03

Fix and hand back

A failing check names its layer, so the fix lands on the cause rather than on the EQ. The track is delivered with its seed and the render numbers.

05

What I learned

Reproducible is harder than good-sounding. A byte-identical re-render needs the randomness pinned and the checks judged relatively — absolute numbers hide exactly the defects they are meant to catch. The background music playing on this site is one of these renders.