Modal2D  ·  a project note

The barely possible

Every sound in every game you have played is a recording. This is what happens when you refuse to record one — and then insist the result stay in tune.

FEM eigenanalysis CUDA solver Modal synthesis 120 chromatic slots C++17 + Dear ImGui

01Three categories, and the one worth living in

Research is not mainly a way of producing results. It is a way of acquiring a map: a sense of where the edge of the possible actually runs, which is almost never where people assume it runs.

The map has three regions. Two of them are well surveyed and largely uninteresting. The third is where all the leverage is, and it is under-explored more or less by definition.

Region one
Possible

Solved, productised, competitive. You can buy it. Building it yourself is a decision about cost and control, not about capability.

Region two
Not possible yet

Blocked on something real — a missing algorithm, a physical limit, an order of magnitude nobody has found. Effort here is a bet on a breakthrough.

Region three
Barely possible

Technically solved in a literature somewhere, and abandoned in practice. Not because it does not work — because it was expensive, or awkward, or nobody built the tooling that made it usable. This is the interesting one.

The third category is peculiar in that membership changes without anyone announcing it. Hardware moves, a solver gets ten times faster, someone writes the one piece of tooling that was missing — and a technique that "everybody knows is impractical" quietly stops being impractical. The knowledge that it is possible stays parked in papers, and the belief that it is not stays parked in industry, and the two can sit there disagreeing for twenty years.

Knowing which things are barely possible is worth more than knowing how to do any one of them. It tells you where to look.

I do not publish any more. That changed the output, not the habit — the reflex to ask is this actually hard, or does everyone just believe it is? did not go anywhere, and it is not something I switch on for a project. It is closer to how I read a problem than to something I do to one. What follows is one worked example: picking a technique out of region three and finding out, concretely, what was keeping it there.

02The candidate: sound you compute instead of record

Hit a metal bar. What you hear is not a waveform stored anywhere. It is a shape obeying an equation. You could, in principle, solve the equation instead of recording the bar.

In practice nobody does. Games, film and virtually every audio tool ship samples: recordings, pitched and layered and crossfaded. Samples are cheap, predictable, and they sound exactly like the thing they are, because they are the thing they are.

Meanwhile there is a real research literature on physically modelled sound going back decades — modal synthesis, finite-element eigenanalysis of plates and shells, contact models for impact. The physics is not in doubt. The mathematics is textbook structural dynamics. And it is essentially absent from shipping software.

So: region three. And the question that matters is not "does it work" but what specifically kept it out. Two answers, and only one of them has expired.

Cost — expired

A generalised eigenproblem over a few thousand degrees of freedom used to be a coffee break. On a GPU it is interactive. This objection is simply gone, and it went quietly.

Control — still live

A solver hands you an object that rings. It does not hand you C5. There is no knob for pitch, because pitch is an emergent property of geometry and material. Nobody could ask the technique for anything, so nobody used it.

If you work in rendering this shape of story should feel familiar. Path tracing was correct and well understood for decades while being considered hopeless for production. What changed was partly hardware — and partly that people built the denoisers, the importance sampling and the artist controls that turned a correct algorithm into a usable one. Nobody ever doubted the rendering equation. They doubted you could afford it and art-direct it.

Physical sound synthesis is at the equivalent moment, minus the tooling. The affordability arrived. The controls did not. That gap is the whole project.

03What the machine does, in one page

Enough to follow the argument. The mechanism in full is a separate page.

Take the object. Mesh it. Assemble the two matrices that structural dynamics gives you: K, which says how hard it is to bend, and M, which says how much of it has to be moved. Then solve the generalised eigenproblem.

K φ = ω2 M φ Each solution is a pair: a shape φ the object is willing to hold, and the frequency ω at which it holds it. That is a mode. A struck object is doing all of them at once, in proportions set by how you struck it.

Every mode then behaves as one damped harmonic oscillator — a decaying sine. Striking the object projects your impulse onto each mode shape, which sets how loudly each one starts. Sum the oscillators, and that sum is the sound. There is no filtering of a recording anywhere in this, and no sample.

The useful mental model is not "simulation" but spectrum with a physical cause. A synthesiser also adds up sine waves; the difference is that here you do not choose the frequencies. The geometry chooses them, and it will happily choose ones you did not want.

Where to go deeper. The mechanism — meshing, assembly, the eigensolver, damping models, the air cavity — is laid out in How It Works, and the parts that took real work are in the deep dive. This page is the story, not the manual.

04The turn: a sound effect cannot be wrong, an instrument can

This is the decision that shaped everything after it, and it started as a complaint about evaluation.

Suppose you build a physical model and it produces a clang. Is it right? Nobody can tell you. Nobody knows what that particular imaginary crate is supposed to sound like. Every demo of physically modelled audio I have ever seen lives in this comfortable space, where "plausibly metallic" is indistinguishable from correct.

Plausible is not a measurement. If your model cannot fail, you are not testing it — you are admiring it.

So point it at something that can fail. C5 is 523.25 Hz. Twenty cents flat is audibly wrong to any musician and measurably wrong to everyone else. An instrument has to land on a specific frequency, respond to where you strike it, hold its place in a chord with eight others, and do all of that repeatably.

Making it play music was not scope creep. It was the only honest test available. And it immediately started failing in ways a clang would have hidden: notes an eighth of a semitone flat, notes that stopped dead instead of ringing, notes that sounded thin next to their neighbours. Every one of those is a real defect in the model or its controls. Every one of them is invisible if all you ask for is a clang.

LISTEN

The same set, tuned and mistuned

Tuned

Optional listening comparison not included · tuned.

Each bar solved, measured, resized and re-measured until it lands within a few cents of its note.
~40 cents out

Optional listening comparison not included · mistuned.

The same geometry, the same material, the same code path. Only the sizes are slightly wrong. This is what "plausibly metallic" sounds like when you finally ask it a question with a right answer.

TO ADD — render both from the app and drop them at docs/audio/tuned.wav and docs/audio/mistuned.wav.

05The inverse problem is the whole difficulty

Forward is easy and is what the papers do. Backward is what an instrument maker needs, and it is the reason the technique never shipped.

Give me a shape and a material and I will tell you what it sounds like. That direction is a solve: mesh, assemble, eigen-decompose, done. It is the direction every published figure runs in, and it is genuinely not the hard part.

Now run it backwards. I want C5. What shape?

There is no formula. For a uniform bar clamped at nothing you can get an analytic answer, and the moment your object is a box, a shell, a disc with a hole in it, or anything a person would actually want to hit, the analytic answer is gone and you are left with search: guess a size, solve, measure the error, guess again. Each guess is a full eigen-decomposition.

shape → sound   one solve       sound → shape   a search over solves And the search is over a function you cannot differentiate cheaply, cannot evaluate quickly, and — as it turns out below — cannot even assume is monotonic.

This asymmetry is the actual answer to "why does nobody ship this". Not that it sounds bad. Not that it is too slow to play. That you cannot ask it for anything. A sampler answers "give me C5" in nanoseconds because someone recorded C5. A solver has to go looking.

Which reframes the project. The interesting engineering is not the physics — the physics is a known quantity you can look up. It is the tuning loop, the tolerance handling, the search that has to converge without a human watching it. It is, in the rendering analogy, the denoiser rather than the rendering equation.

06Where the obvious thing turned out to be false

The one moment in this project I would actually defend as research, and it consists entirely of not believing myself.

The first tuner rested on an assumption so comfortable I did not notice making it: that the fundamental falls smoothly as the object grows. Bigger is lower. Every instrument you have ever seen agrees — the long strings are at the left of the piano, the big pipes are at the back of the organ.

If that holds, tuning is easy. Measure two sizes, fit the power law, extrapolate to your target, polish. I built exactly that, and on bars it worked.

Then it started missing on other shapes, and instead of tightening the search I swept it: solve every size across the range and plot what actually comes out.

Schematic, not measured data. What a sweep of the lowest audible mode against size looks like for a shell-like shape. The smooth curve is the assumption. The real thing has a region where growing the object raises the pitch, and a gap where nothing lands in the audible band at all. TO ADD — replace with a real sweep exported from the app.

Two things were wrong with the premise, and only the first was surprising:

Modes cross

"The fundamental" is not one physical thing. As geometry changes, two mode families slide past each other in frequency and a different shape becomes the lowest one. The curve you are tracking is not one curve. It is the lower envelope of several, and envelopes have corners.

Some sizes have nothing to say

At certain proportions the lowest mode drops below audibility or the shape simply fails to produce a usable one. The search asks for a measurement and receives no answer, which a bisection that assumes continuity handles very badly.

The fix was unglamorous: throw away the power law, sample the space, keep a table, and interpolate inside it. Slower to set up, and it does not care whether the function is monotonic, because it never assumed it was.

The measurement took an afternoon. The assumption had already cost me a week of tightening a search that was converging correctly on the wrong model.

I want to be precise about what the research habit contributed here, because it was not knowledge. I did not know that mode crossing would bite. What the habit supplied was the instinct to distrust a premise that was working — and to spend an afternoon on an experiment whose only purpose was to try to embarrass me. That instinct is most of what a research background is actually worth in engineering work, and it does not expire when you stop writing papers.

The same thing again, one level up

The measurement that replaced the power law produced a headline of its own: for five of seven shape families, the fundamental moved by tens or hundreds of per cent when the width changed by one representable float — a distance of about six nanometres on a nine centimetre object, over which nothing physical can happen. Read straight, that says the quantity the tuner searches over is not a function of the thing it is varying, and no search can converge against it.

That was too good a line to publish without checking. The probe had held every other parameter fixed at one convenient value, so I swept them.

The headline survived for the boxes and collapsed for the string — which I had just told someone was broken, against their direct experience of it working.

For a string, the parameter I had frozen is the cross-section. I had measured a 0.4 mm beam on a 180 mm span — a 450:1 sliver — and reported the result as a property of strings. At a realistic 3 mm the same shape is stable to the last bit and reports a perfectly plausible 819 Hz. The failure was never about which shape it was. It tracks how slender the geometry is, which is a statement about conditioning and element quality, and a far more useful thing to know than a list of shapes to avoid.

Both halves of that are the same habit, applied twice. The first time it caught a premise I had assumed. The second time it caught a conclusion I had just finished being pleased with — which is the harder of the two, and the one that decides whether a measurement is worth anything.

07Touch is geometry

Where you hit it is not a detail of performance. It is an input to the physics, and getting it wrong makes a correctly tuned instrument sound broken.

A mode has a shape, and that shape has places where it does not move: nodes. Strike a node of a mode and you put almost no energy into it — you are pushing on the one part of the object that particular standing wave has no interest in.

This is not subtle. Striking near a node of the fundamental measured roughly twenty times less energy in it than striking the antinode, and what you hear is not a quieter note. It is a different, wrong instrument: the fundamental barely speaks, the higher modes dominate, and the sound stops almost immediately instead of ringing.

I found this the way you find most things, which is by having a bug. A whole set was tuned correctly and sounded dead. The frequencies were right to within a couple of cents. The energy was going somewhere else, because the player was striking each bar at its geometric centre and for one whole family of shapes the geometric centre is very close to a node.

LISTEN

The same bar, struck in two places

Antinode

Optional listening comparison not included · antinode.

Where the fundamental moves most. Full, long, in tune.
On a node

Optional listening comparison not included · node.

Same object, same material, same tuning. Only the strike point moved.

TO ADD — docs/audio/antinode.wav and docs/audio/node.wav.

The consequence for the tool is concrete: the tuner records where you struck, stores it with the instrument, and the player replays each note at the same relative spot. Touch is not a performance parameter layered on afterwards. It is part of what the instrument is, and it lives in the file next to the geometry.

08So why not just use samples?

The honest answer is not "this sounds better". For one recorded bell, a recording wins and it is not close.

The argument is about everything you did not record.

A string's overtones sit at close to whole multiples of its fundamental — that near-harmonic stack is why a violin has an unambiguous pitch. A bar, a plate and a bell do not do this. Their overtones land at ratios that have nothing to do with the harmonic series, and that inharmonic spread is exactly what makes a bell sound like a bell rather than like an organ pipe.

Where the overtones land. Top: a near-harmonic stack — whole multiples of the fundamental. Bottom: the sort of spread a struck bar gives you, which no amount of pitch-shifting a harmonic tone will produce. Schematic, drawn to make the contrast legible.

You can sample a bell. You cannot sample the bell that is three percent larger, in bronze instead of aluminium, with a slightly thicker wall, struck two centimetres off centre — because that is a different recording and nobody made it. Pitch-shifting will not get you there: shifting moves every partial by the same ratio, and the real object's partials move by different ratios when you change its proportions. That is why a pitched-down bell sounds like a bell in a lift shaft rather than like a bigger bell.

A sampler gives you points. A solver gives you the space they were drawn from — including all the points nobody thought to record.
LISTEN

One geometry, several materials

Bronze

Optional listening comparison not included · bronze.

Aluminium

Optional listening comparison not included · aluminium.

Glass

Optional listening comparison not included · glass.

Identical geometry and identical strike, three materials. Not the same recording filtered three ways — three solves.

TO ADD — docs/audio/mat-bronze.wav, mat-aluminium.wav, mat-glass.wav.

09The ensemble

The payoff, and the point at which the thing stops being a demo and starts being an instrument you can be dissatisfied with.

Once a single note can be asked for and delivered, a set follows: tune a range, give each octave its own material, and hand the whole arrangement a score. The instruments are laid out as themselves — real geometry at real relative sizes, not icons — and struck where they were tuned to be struck.

WATCH

Tuning a range, then playing it

TO ADD — video Auto-tuning an octave, spreading materials across the set, and playing a piece with the whole ensemble visibly vibrating. docs/video/ensemble.mp4

Two details from this stage are worth keeping, because both are places where the physics refused to stay in its box:

Materials change pitch

Frequency scales as √(E/ρ). Swap aluminium for bronze and a tuned instrument is no longer tuned. The tool treats a material change as invalidating the tuning, because physically it does.

An arrangement is a whole state

Geometry, material, strike point, damping and the score are one artefact. Saving half of it reproduces something that sounds subtly wrong, which is worse than something that obviously fails.

LISTEN

A piece, played by solved instruments

A current native performance provides an ensemble listening example. Listen to the recorded custom ensemble →

TO ADD — export from Music mode to docs/audio/ensemble.wav.

10What is still hard

The claim is that this is closer than the industry assumes. Not that it is solved. Being precise about the difference is the entire value of having a map.

the inverse problem
Still a search, not a formula. Tuning one note takes many solves, and the search needs a sampled table because the function will not promise to be monotonic. Fine offline; nowhere near interactive retuning of arbitrary geometry.
shape complexity
Simple families tune readily. Box-like shapes resist, and measurement says the cause is cruder than mode crossing: once the geometry becomes slender enough, the solve stops returning a usable answer at all. A closed box reports a fundamental of 39 kHz for a 9 cm object, and a value that moves by hundreds of per cent when its width changes by one representable float. Nothing a search does can help with that.
dimensionality
Plates and shells, with thickness as a parameter, rather than full 3-D solids. That covers most struck idiophones and excludes a great deal else.
radiation
Coupling to the surrounding air is modelled, not resolved. Real radiation patterns and room interaction are a separate problem of comparable size.
nonlinearity
Modal synthesis is linear by construction. Hard strikes, rattles, and the tension effects that make a gong a gong are approximations bolted on rather than consequences of the model.
conditioning
Slender elements make the stiffness matrix badly conditioned, and under a size threshold it is solved in single precision. The result is a spectrum that is deterministic within a run and occasionally disagrees between runs. Bounding element aspect ratio is the obvious next move, and it is not done.

None of these is a reason not to have built it. They are the shape of the remaining work, and knowing their shape is the difference between "this could be great" and a plan. The honest summary is that the cost objection to physical sound synthesis has expired and the control objection has not — and that the control objection is engineering, not physics, which is a much better problem to have.

11Why this one

I build renderers. This is not a renderer, and the overlap is not the domain — it is the posture. Both are cases of taking a physical process that is well understood on paper and arguing with it until it runs at a useful speed with controls a person can actually hold. Modes and light transport are the same kind of problem wearing different clothes: a linear operator, a basis you get to choose, and a sampling strategy that decides whether the whole thing is tractable.

The reason I go looking in region three is not tidiness. It is that the region is systematically under-explored — the people who know it is possible are usually not the people with a reason to build it, and the people with a reason have usually been told it is not possible. Sitting in the overlap is an unreasonably good place to work, and getting there mostly requires being willing to read the papers and then ignore the received wisdom about what they are good for.

The map is the part that lasted. Not the publications — the ability to look at something everyone has written off and ask, seriously, whether they are still right.

This project is one dot on that map, plotted properly: what was assumed, what was measured, what the measurement refuted, and what is genuinely still out of reach.