Six silent defects in a generative music system

A commercial application built on mathematics from outside music — chaotic maps, strange attractors, fractals. The mathematics was implemented correctly throughout. In six specific places it still wasn't doing what the label said — and all 373 tests passed.

NDA · de-identified Engagement: audit Defects: 6 + 1 structural Delivered as: written findings

An independent review. Client and product de-identified; the findings are unchanged.

// The situation

The science was real. The operating point was not.

A commercial generative music application built its entire premise on mathematics from outside music: chaotic maps, strange attractors, fractal functions, cellular automata. A user picks a transform — logistic map, Lorenz system, Julia set, Weierstrass function — and the system turns a musical motif into something shaped by that mathematics.

I was asked to check whether the science was being used faithfully or decoratively. The honest answer surprised me in the direction of the developer: the mathematics was correctly implemented throughout. The Lorenz integrator was textbook. The cellular automata reproduced Wolfram's canonical output exactly. The escape-radius handling included details most implementations get wrong. This was not scientific vocabulary bolted onto a sequencer.

It was also, in six specific places, not doing what the label said.

All 373 of the project's tests passed. They passed before my review and they passed after it. Every defect below sat underneath a green test suite, in shipping code, in a product with real users. That is the entire reason this kind of review exists.

// The six findings

Silent, numerical, and individually invisible.

Each defect is described the same way: what the code did, what it should have done, what the user experienced, and why nothing caught it.

// Findings, in full
Finding 01

The most provably chaotic map produced a constant tone

What it did

The doubling map, x → 2x mod 1, is the canonical chaotic map — and in binary it is a left bit-shift. Each iteration discards one bit of the seed and reveals the next. A float64 carries 52 mantissa bits. After ~52 iterations the orbit reached exactly zero and stayed there.

The specific case was worse than the general one. The seed encoding placed 440 Hz at exactly 0.5, which is one bit-shift from zero. Every A-natural in the range — including the application's own default reference pitch — collapsed to a drone within one to three notes.

What it should have done

Sustained chaotic wandering for the length of a phrase.

What the user experienced

A transform labelled “chaos” that emitted the same note repeatedly.

Why nothing caught it

The function returned a valid orbit of the correct length and type. Its contract was honored. Only the content was degenerate, and no test asserted on content.

Finding 02

The tent map's default height was the one value that breaks it

What it did

The tent map's height parameter defaulted to 2.0 — and the full tent map at height 2 is exactly conjugate to the doubling map. Same bit-shift, same mantissa exhaustion, frozen at step ~52. At height 1.9 it never froze. At 1.99 it never froze. Only the shipped default failed.

What it should have done

Behaved as the chaotic map it is at essentially any other height.

What the user experienced

Nothing, unless they moved the slider — at which point the transform started working, with no explanation of why.

Why nothing caught it

Testing a parameterized function at an arbitrary parameter value passes. The defect lives at a single point in parameter space, and that point happened to be the default.

The principle underneath

The maps that are most provably chaotic — doubling and full-tent, both exactly conjugate to the Bernoulli shift with Lyapunov exponent exactly ln 2 — are precisely the maps that cannot be chaotic in floating point. Their chaos consists entirely of revealing bits already present in the seed. They generate no new information; they expose existing information, and a float has a finite supply.

The logistic and sine maps survive because their nonlinearity folds high-order bits back down into low-order ones, manufacturing new structure at every step. Provable chaos and computable chaos are not the same property.

Finding 03

The Lorenz transform could not reach chaos at any setting the interface allowed

What it did

The equations and the fourth-order Runge–Kutta integrator were correct. The defaults ran the system for 0.64 Lorenz time units. The attractor's e-folding time is ≈1.10 time units — so a default run was shorter than a single e-folding time.

Measured on the shipped code: two seeds one cent apart ended the run closer together than they started. Maximum divergence across all sixteen output tones was 0.25 Hz, well below audibility. Zero wing switches — the orbit stayed on one lobe for the entire run. The parameter controlling this was capped, and the cap was below the useful range. At maximum, the transform reached 3.2 time units; meaningful behavior needs roughly 16.

What it should have done

Audible butterfly-wing switching and sensitive dependence.

What the user experienced

A single smooth glide, indistinguishable from an ordinary envelope.

Why nothing caught it

The system was implemented correctly and integrated correctly. The defect was not in the code but in the window onto it — roughly 25× too short. No test can detect that without knowing the physical timescale of the phenomenon being modeled.

Finding 04

High notes were silently deleted

What it did

The pitch-to-plane encoding placed a note at a radius proportional to its octave, unbounded. The quadratic escape radius is 2.0. A sufficiently high note landed outside it, the iteration returned an empty orbit, and the note contributed nothing. At the default exploration setting, notes three octaves above the anchor vanished. At the setting a curious user would naturally reach for — “show me more of the plane” — everything above the anchor octave disappeared.

What it should have done

Mapped every note in the piece's range to a point inside the window.

What the user experienced

Missing high notes, worse the further they explored, with nothing in the interface explaining it.

Why nothing caught it

An empty orbit is a legal return value. The failure path and the success path were the same code path.

Finding 05

One of four fractal presets was not fractal

What it did

The Weierstrass function is nowhere-differentiable when ab ≥ 1. The four presets used ab = 0.60, 1.50, 2.40, and 4.80. The first is an ordinary smooth differentiable function — a pleasant gentle wobble, but not a fractal, offered from a menu of fractal geometry.

What it should have done

Delivered the property named on the label.

What the user experienced

A working transform producing a musically fine result, mislabeled as something it mathematically was not.

Why nothing caught it

Nothing in a test suite computes the box dimension of a preset. The check requires knowing the theorem that defines the category.

The fix came with an upgrade

Adjust the low preset so all four are genuinely fractal, then label each preset with its computed box dimension — D = 1.37, D = 1.63, D = 1.88. A real, verifiable number describing exactly what the user is selecting. Very few tools in this space can say anything that precise.

Finding 06

A famous constant used for the wrong kind of quantity

What it did

Each successive note was divided by Feigenbaum's δ = 4.669. On the default dimension, an eight-note phrase of half-second notes ran 0.500, 0.107, 0.023, 0.005, 0.001 seconds and onward — five of eight notes under 10 ms, inaudible clicks. The transform was unusable past three or four notes.

Beneath the practical problem sat a conceptual one. δ is a ratio in parameter space: it describes how the gaps between successive bifurcation points shrink as a control parameter increases. It is not a ratio of states, durations, or frequencies. Used as a geometric scaling factor on note lengths, the constant was decorative — 4.5 would have done identical work.

What it should have done

Either not invoked Feigenbaum, or used δ for what δ governs.

What the user experienced

A transform that collapsed into silence after four notes.

Why nothing caught it

A test asserts that durations shrink by the expected factor. They did. Correct arithmetic on a quantity the constant does not describe still passes.

And there was a faithful version available

δ governs the period-doubling cascade — the route by which a periodic system becomes chaotic by doubling its period again and again. That is an inherently rhythmic phenomenon. Computing the superstable parameters of the logistic map yields cycles of exactly period 1, 2, 4, 8, 16, 32, with parameter gaps converging to δ.

As music, the listener hears one note repeating, then two alternating, then four, then eight — and then the cascade accumulates and breaks into chaos. The period audibly doubles, and the spacing between phrases is Feigenbaum's constant. That uses δ for exactly what δ is, and I am not aware of anyone having made it audible in a compositional tool.

// The structural finding

The one question that needed a change of class.

Alongside the six defects, the developer had an open question: which additional transform would produce genuinely emergent behavior? The answer was that no transform would.

Why no transform would do it

Tracing the pipeline showed a strict left-fold — each transform takes a score and returns a score, feed-forward, with every score-level operation mapping independently over the voices. Nothing in the codebase let one voice observe another. The only contextual dependence reached the preceding phrase within the same voice.

That makes the architecture a directed acyclic function composition: rich, hierarchical, path-dependent, and possessing no dynamics of its own. The dynamical systems lived inside individual transforms; the structure around them was inert. Emergence requires interaction between components, and there was no channel for it. Adding a fifteenth clever transform to a feed-forward pipeline yields a feed-forward pipeline.

The recommendation was therefore not a transform but a change of class: close the loop by measuring a global property of the score and feeding it back as a parameter for another pass, converting the pipeline into a system whose state is the score itself — or couple the voices directly, for which Kuramoto phase synchronization is the natural first candidate, with a genuine phase transition and a well-defined order parameter.

// The general class

Six defects, one category.

In every case the implementation was correct and the operating point was wrong.

The mathematics was right. The code matched the mathematics. What failed was the relationship between the shipped parameters and the region of parameter space where the modeled phenomenon actually exists. A chaotic map outside its chaotic regime. An attractor observed for less than one e-folding time. A fractal preset below the threshold that makes it fractal. A constant applied in the wrong space entirely.

This is a distinct failure class from a coding error, and it has properties worth knowing:

The generalization is not about music. Any system that implements a mathematical or statistical model has an operating regime, and the regime is rarely tested — because testing it requires knowing the theory the model came from, which is a different job from writing the code. That is true of a retrieval threshold, a sampling temperature, a convergence criterion, an evaluation set that does not cover the regime a model is deployed in. The code runs, the tests pass, and the system is quietly outside the conditions under which its own mathematics means anything.

// The outcome

What changed, and what resulted.

what the client changed after the review, and what resulted.

On confidentiality. Work is done under NDA by default, and anything published is de-identified. This writeup removes the client, the product name, and anything that identifies either; the defects, how each was found, and what changed as a result are described in full. Your own review will not appear here with your name on it.

Green tests are not the same as correct.

If you have a production system whose output you can't fully vouch for — a model running outside the regime its mathematics assumes — that's exactly the case for an independent review. Book a call and tell me what it is.