LDD-Audio — Three Days, One Source, a Desktop Audio Editor
LDD · AUDIO
A literate-programming case study

Three days of work.
A complete desktop
audio editor.

Not a prototype — a non-destructive, real-time DAW with a live mixer, spectral analysis, time-stretch and recording. Written once, as a narrative. From that single source came the C++, its tests, and a 228-page book.

~20h
Active work
20
Verified concepts
18
Test suites, all green
~228
Page typeset book
The method

TDD says the test is the specification, and the code is derived. LDD says the narrative is the specification — and both the code and the tests are derived from it.

Starts muted — use the volume control to enable sound

01 / Spec

The narrative is the spec

You write intent as prose and name the pieces. The model fills a specification that stays versioned in the source — it never guesses a design.

02 / Derive

Code and tests, both derived

One .weft source tangles into the program and its test suite, and weaves into a typeset book. Spec, code, tests and docs are one object.

03 / Enforce

The Prime Directive

A task isn't done until its prose is updated. Code and narrative can never drift — a mismatch is a failing build, not a stale comment.

Literate Driven Development is AI-assisted software authorship, with Literate Programming at its core. You write the reasoning once — and it becomes the shared context a person and a model both build from.

— literatedriven.com
The editor

A real DAW, not a demo.

Every capability below is built, tested, and running on the desktop — a professional signal engine underneath a Qt interface.

Non-destructive by design

Sources are immutable; a cut or a fade is an operation, never a lost sample. Unlimited undo, versioning and recovery — by construction.

32-bit float, sample-accurate

Float audio with exact timing is the internal currency of the whole engine — from decode to mixer to export.

Real-time-safe engine

The audio callback never allocates, locks or does I/O. No dropouts — the real-time discipline is enforced, not hoped for.

One graph, two renderers

Real-time playback and offline export drive the same signal graph — bit-identical, so what you hear is what you bounce.

A live mixer

Pan, gain, mute and solo — heard the instant you move them, because playback streams the project block by block.

Automation

Draw a gain envelope on a track; the fader moves itself as it plays — and it's saved with the project.

Spectrum & spectrogram

A live FFT analyser over a scrolling waterfall — the frequency-domain view that makes it an editor, not just a recorder.

Time-stretch & restoration

Stretch, pitch-shift and de-click — spectral processing that reshapes time without moving a file.

Recording & plugins

Capture from the input straight onto the timeline, and host processors through an internal plugin API.

C++20Qt 6CoreAudioruns on Apple SiliconMIT-licensed
One source, three artifacts

Write it once. Derive everything.

The source of truth

.weft narrative

Prose that explains the why, with the code and tests woven in — the only file anyone edits.

tangle
weave
Machine

C++ + 18 test suites

Compiled with -Wall -Wextra -Werror, all green.

Human

A 228-page book

Typeset PDF with Bauhaus covers, glossary and bibliography.

There is no design doc that rots and no code with stale comments. There is one narrative, and everything else is derived from it by weft. Reading the book is reading the system.

Time & cost

Three days. Every stage green.

~20 hours
of active, AI-assisted work across three days — 84 commits, each stage tangling, building and testing green before the next.
~6 hours
for the entire desktop interface — timeline, mixer, automation, spectrum and recording, phase by phase.
$8.24
one metered session's cost — most of it cached context, not fresh tokens. A rounding error next to a hand-built DAW.

Figures from the project's git history and the session's own cost meter. The build spanned three working days; the dollar figure is one measured session, dominated by cached-context reads.

The concept ledger — every layer, built & verified
PCMTimeCodecEngineProjectCommandsDSPGraphAutomationWaveformAnalysisAdvancedDSPRecordingPluginsRenderPersistenceUIAudio I/OGUI
The book is the program

Read the reasoning.
Run the software.

A non-destructive, verifiable audio engine and a desktop editor — one literate narrative, from which the code, its tests, and this book are all derived. Part of Literate Driven Development, Volume 2.