OOLOI.ORG
Menu

OOLOI

OVERVIEW

FAQ

DOCUMENTATION

NEWSLETTER

November 2

17/11/2026

0 Comments

 
Picture
Open the font menu on the Hegazy–Gourlay Workbench and there's a new name, second in the list after Bravura: November 2. Its designer, Robert Piéchaud, has kindly allowed it to appear there. The same bars, under the same rules and the same settings, can now be set in it and compared directly with the ten fonts Ooloi bundles.

Why November

​November began in 1998, and its model, in Robert's own words, is Universal Edition in Vienna around the turn of the twentieth century, when it began publishing Schoenberg, Berg and Webern. That's one of my favourite looks in printed music, and it's why Ooloi's documentation already recommends November 2 as its notation font.
​
From now on, examples on this blog and in the documentation will use November 2 alongside Bravura. I personally prefer November 2, but Bravura is the reference font of SMuFL and Ooloi's default for any piece whose house style names no other, and both belong in front of the reader.
Picture

Fourteen Glyphs

November 2 is a commercial font, and it isn't bundled with Ooloi. Nor is the font itself on the workbench. What the page carries is the 14 glyphs its examples draw: their outlines, bounding boxes and anchors, the font's engraving defaults, and its copyright line. No font file goes out with the page.

Ooloi itself will use November 2 only on computers where it has been bought and installed. It's available from Klemm Music.

What to Compare

​The spacing rules know nothing about any particular glyph. Every font gets the same rules, the same settings and the same placeholder values, and the geometry comes from each font's own outlines. So every difference you see between two fonts on the page is a difference of ink.

Leave the settings where they are, then switch between Bravura and November 2 in the font menu. Some places to look:
  • Accidentals. How close a sharp, flat or natural comes to its own notehead, and how far it tucks towards the note before it.
  • Ledger lines beside accidentals. The chromatic ledger bar, A5 to C7, is the densest case on the page. Raise the vertical reach and watch where the lines stop short of each sharp's crossbars.
  • Dots and flags. A notehead keeps clear of the previous note's dots; how much room that takes depends on the shape of the dot and the note.
  • Full compression. At r = −1 the ink alone sets every width, so that's where the fonts differ most.

As before, change one setting at a time, start near r = 0, and zoom in: many of the differences are about a tenth of a staff space.

My thanks to Robert Piéchaud, for the font and for the permission.
Picture
0 Comments

Smooth Operator

16/11/2026

9 Comments

 
There is a new two-stave example on the workbench. In its second bar, the upper stave has two eighths, a triplet, a quintuplet and a sextuplet; in the lower, a triplet of eighths, four sixteenths and a triplet of quarters.
​
I was dragging the gauge into compression, as I do with every new example, when the lower stave stopped looking right. At −0.35 the sixteenths weren't evenly spaced, and neither were the triplet eighths before them. In each group the first note stood apart from the rest, as if it had been given a little more time.
Picture
To me, that spacing is the signature of the computer engraving far too many people have grown used to after decades of exposure. Under a beam the stems form a comb, and the eye reads any irregularity in it as rhythm. Wide, narrow, wide on every beat puts a small lengthening on each beat's first note and a breath before the next: the print doing the performer's job, and badly.

Even visual rhythm isn't negotiable. Working with Hegazy and Gourlay's model on the workbench has made it plain that this is what engravers do instinctively, and that irregularity disturbs the visual harmony of a page. So it had to go, and the first question was what in the model had put it there.

One Raster

​The cause was in Ooloi's own structure. Every stave in a system is spaced on one shared raster: a column wherever any stave has a note, and between neighbouring columns a gap that behaves as one of Hegazy and Gourlay's springs. Each gap has an ideal width, from the durations, and a minimum, the closest its ink allows.
Picture
Where the other stave's notes fall between two of a stave's notes, that stave's interval is cut into several gaps. Under compression the old rule let every gap give up the room above its minimum. A gap between two notes of the same stave has a real minimum: 1.38 spaces here, the least distance between two noteheads in succession. A gap between a note in one stave and a note in the other has none of its own, since nothing in it can collide; the stave's two notes are kept apart by a constraint spanning both gaps. So a cut interval had its whole width to give, and an uncut one only its room above 1.38. The cut ones shrank faster, until the constraint caught them.

At −0.35, three equal triplet eighths came out 1.783, 1.380 and 1.783 spaces apart: the upper stave's second eighth cuts the middle interval, and nothing cuts the outer two. The sixteenths, cut in the middle by the upper stave's triplet, went 1.653, 1.380, 1.380, 1.653.
​
The rule was tidy: every gap reached its minimum at exactly the same moment, at full compression. A single stave can never show what's wrong with it, because there every interval is one gap. It took two staves with interleaved tuplets, and once they were there the fault turned up in four of the bar's seven groups. The lower stave's triplet had its middle interval 23% narrower than its neighbours, its sixteenths 17%; the upper stave's triplet had 13%, and the quintuplet 12%. The lower stave just shows it worst.

A Second Witness

What the cure had to do followed from the cause. A cut interval must give exactly what it would give whole, so a gap's share of the compression has to depend on the time it spans and on nothing else. The gaps of a cut interval then add up to the interval, whatever falls inside it.

Before changing anything, I went to LilyPond's source. LilyPond's spacing rests on the same springs, and its source is open, so reading it is the nearest thing to comparing notes with someone who's worked through the same equations. Its note springs give by duration: how much a spring yields is fixed, when the spring is built, by the time it spans, and the collision minimum only stops it. A cut interval gives what the whole would, and a part's equal durations stay even. On the evidence of the source, LilyPond seems to have reached the same judgement.
​
It also showed me I'd been wrong. In 'Vestigia Nulla Retrorsum' I wrote that shrinking by the room above collision was LilyPond's default as well. It's LilyPond's rule only between barlines, clefs and the like, never between notes.

Two Questions

​So I made every gap compress in proportion to its ideal width. The evenness was there at once, and on the workbench it looked exactly like what engravers do. It also broke casting off.

Ooloi chooses where systems break by pricing every candidate system, with Knuth and Plass's method as TeX uses it. The price depends on how far a system is compressed, measured against how far it could go. TeX's constants mean what they say only if the end of that scale, r = −1, is the tightest the system can be: here, the point where ink would collide. Priced proportionally, a system whose gaps have their minimums at 80% of their ideal widths reaches its collision limit at r = −0.2, with a badness of 0.8, which TeX's scale calls nearly perfect. Priced as before, the same system scores 100. The line-breaker would have crammed systems to the edge of collision and thought them a bargain.

The mistake was asking one rule to answer two questions. How tight is this system? That's the line-breaker's question, and it's still answered against the collision limit. How should the room be shared among the notes? That's placement's question, and it's now answered in proportion to the durations, at a ratio of its own that fills exactly the width the breaker priced.

Ooloi already worked this way when stretching: the breaker prices the stretch, and placement hands it out through weights that send it into the white space between noteheads. Compression now works the same way. Both stages share one set of minimums, so nothing the breaker accepts can collide when it's placed.

This is also where Ooloi and LilyPond part company. My first fix had done what LilyPond does, one law for pricing and placing, but inside a price whose constants assume the collision limit sits at r = −1. LilyPond's price makes no such assumption: its spacer measures a line by a force that isn't tied to any collision limit, and prices compression through a penalty of its own. On its own terms that's coherent. Ooloi's line-breaker is calibrated against collision, as TeX's is against the limits of its glue, so in Ooloi the two jobs had to come apart.

Which is exactly why LilyPond is so useful to me, even where we do things differently. Another worked example of Hegazy and Gourlay's model in use is invaluable. I'm not ripping LilyPond off, but I am able to benefit from all the research behind it.

Where Evenness Gives Way

​Here are the same two beats at the same width, placed by the new rule.
Picture
​The triplet eighths are 1.730 apart, three times over; the sixteenths 1.557, four times. The bar is exactly as wide as before and the breaker priced it exactly as before; the room is simply spent evenly. At full compression the two rules agree gap for gap, every gap at its minimum.

Put precisely, compression now shrinks the spacing without rewriting it: whatever is even at the ideal width stays even as the system tightens, in every stave at once. Whether notes are even at the ideal width is settled earlier, by the long-standing rule that spacing follows the shortest note sounding. The lower stave's triplet quarters sit under the upper stave's quintuplet and sextuplet, and come out 5.6 and 6.0 wide before compression has touched them.
​
From there on, evenness gives way only to ink. The Accidentals checkbox on the example adds six accidentals at five places. In the lower stave's sixteenths, A, A♯, A♮, A, the intervals before the sharp and the natural keep the room their accidentals need, 2.576 and 2.252, and the other two stay even at 1.564. The sharp needs more than a sixteenth's ideal width, so its interval is wider even before any compression, until the system is stretched far enough to release it.
Picture
Because the staves share columns, the sharp and the natural widen the upper stave's triplet as well: 3.33, 2.70 and 2.40 at the ideal width, where it was 2.40 three times. That's the model doing what an engraver would. The column belongs to both staves, and so does the room the accidental needs.
​
Another stave's notes do the same once they're as close as their ink allows. Below −0.36, the upper stave's sextuplet reaches its minimum inside the lower stave's second triplet quarter and holds it there, while the first quarter goes on shrinking. There's a limit here, and it's a proof rather than a measurement: once staves interleave, every stave evenly spaced and every gap reaching its minimum at exactly the same moment can't both be had. The old rule had the second. I chose the first.

At the Workbench

​All of this happened in a single day, from the drag that showed the fault to the rewritten specifications and the page as it now stands; the change itself took an hour or two. It was made in the model and the ADRs, not in Ooloi's Clojure, which will start from the corrected specification when this stage is built. That's what the workbench is for: the eye judges the spacing before anything is built into Ooloi itself.

The example is on the workbench; that link opens it on its own, at the ratio in the pictures. Drag the gauge further into compression and watch the lower stave's sixteenths stay even. Tick Accidentals to see where evenness gives way, and Raster to see the shared columns that cut one stave's intervals.
​
When the mathematics and the eye disagree about rhythm, it's the mathematics that has to change.
Picture
9 Comments

Springtime for Barlines

15/11/2026

0 Comments

 
Picture
On 12 November every barline in Ooloi became a discretionary break, TeX's device from 1981 for a place that looks different depending on whether a line ends there.

Variants at a Break described the decision. What I keep coming back to is what it cost, and what it removed. A system's width became a single sum and the gutter disappeared. Hegazy and Gourlay's springs, at the centre of the layout, didn't change at all.

Again.

That 'again' is what this post is about, and what it says about how notation software has been built.

Very Little Data

Hegazy and Gourlay's springs need remarkably little, and they know nothing about music per se.

The mechanism is Hooke's law with a stop, and it would space anything that comes in a row and mustn't overlap. What makes it musical is the data, and the data are what a musician already thinks in: how long each note lasts, which sets each gap's ideal width, and how much room its ink needs, which sets its blocking width. A system that can be specified in those terms can be specified musically, and that has turned out to matter more than I'd realised.

Since the middle of October the springs have taken in (a) the crowded first bar of a system; (b) ledger lines meeting accidentals; (c) glyph geometry from the fonts' outlines; (d) the space either side of a barline; (e) flags under compression; (f) rhythmic order among dotted notes; (g) two of Roland Gurt's questions; and (h) discretionary barlines.

Each was substantial, and each changed the data. None of them changed the springs.

A month ago, in The Seven Thousand Steps, I wrote that every task still to come would come down to giving the one model better input, never to teaching one more formatter about all the others. A month isn't long, and the last section of this post lists what hasn't been tried. But it's no longer only a prediction.

What the Springs Keep

​When I adopted the springs in October, I'd have said they were the right way to handle an accidental. That's true, and it's the small version. Building the algorithm has taught me what it does at the deepest level.

ADR-0055 states the premise in a sentence: spacing is how a reader sees the rhythm. A player doesn't measure distances. The eye reads the proportions of white between the notes, a long value as an open space and a run of sixteenths as a dense one, across the whole line at once. What Hegazy and Gourlay's springs do, underneath everything else, is distribute rhythm across a page so that those proportions stay consistent to the eye, system after system.

When a system is looser than ideal, only the white space stretches, and every white space grows by the same factor, so the ratios the eye reads the hierarchy by are the same at every looseness. That much ADR-0055 decided. What I hadn't seen until recently is why the springs do it so well. Springs come to rest where their stored energy is least, which is school physics. When each gap gives in proportion to its own white space, the least energy is precisely the arrangement in which the white spaces depart least from their ideal proportions, each change measured against the white space it happens to, with no two pieces of ink allowed to touch.

For programmers: stretched, the springs minimise the sum of Δ² / (2σs) over the gaps, where Δ is how far a gap has moved from its ideal width, s is its white space and σ is a constant, subject to every gap staying at or above its blocking width.

I wanted that checked before I believed it, and on more than three thousand random systems the springs' positions turned out to be exactly that minimum.

Seen this way, accidentals and augmentation dots are disturbances of the rhythm: ink that needs room the durations don't account for. A gap held open by a sharp stays at its blocking width while the rest of the line absorbs the difference, shared out over every free gap in proportion to its white space rather than heaped onto the neighbours. And once the system is loose enough, the disturbance vanishes. When every held gap has been caught up, each gap is exactly as wide as it would have been if the sharp had never been there.

Dots are subtler, because they're both things at once. The time a dot adds is rhythm, and goes into the ideal width. The ink it adds is a disturbance, and since the workbench caught a sixteenth slipping in above the dots of a double-dotted half, a note's dots count as part of its width.

Compression is where I have to be careful with the claim. Squeezed, Ooloi's springs give up room in proportion to what each gap has above its minimum, so long values give up more and the hierarchy flattens. Whether engravers did that, or kept the distances in proportion and squeezed the white around short notes instead, is one of ADR-0055's open questions, and printed plates will settle it. The springs can do either. Under stretching the question is closed.

Listening

​The arc is short, and every step of it is in the archive. For two years I dreaded casting off and spacing, and armed myself for a fight with formatters negotiating for room. Last December Knuth and Plass turned casting off into a textbook problem. In October the report Ulrik Bodén tracked down brought Hegazy and Gourlay's springs, and spacing became part of the same problem, consistent and expressible in a way I hadn't thought possible. On 12 November TeX's discretionaries took in the barlines. Twice, Vestigia Nulla Retrorsum, The First Bar of the System and Variants at a Break have the details.

Look at the dates of what was adopted: the newest is Hegazy and Gourlay's report of 1987, and the oldest is Hooke's law of 1676. Each time the design moved closer to an algorithm that has been understood for decades, special cases disappeared, from the specification and from the code, the model's and Ooloi's own, and what remained became more general and more powerful.

I've stopped regarding this as luck. An algorithm that has been around for decades has had its edges found by other people, and what it needs from its input is written down. Give it that, and you inherit the decades.
​

It also changes what I think my own part is. The springs are Hegazy and Gourlay's, and the search is Knuth and Plass's. What's mine is what surrounds them: a pipeline whose task, here, is to hand the springs data that let a pure algorithm do the work it was designed for, settled before breaking begins and never revised behind its back. Most of it was built for other reasons, before the springs arrived.

So a good part of my job turns out to be listening. The algorithm shows what it does with a rule, and if the rule is wrong it shows that too, usually in a case nobody would have thought to test. The animations were where I first heard it: a bar squeezed and let out again, until the model stopped being formulae. The workbench turned that into something closer to a conversation.

Where This Is Normal

​ADR-0057 made the workbench binding. Spacing is now worked out on an exact model before Ooloi builds it: a reference in Python, which computes every spacing figure in the ADRs, and an interactive version in JavaScript, which runs in the browser, held to each other by reference values written as exact fractions that Ooloi's own tests will read too. A stage is ready to be built when its ADR, both implementations and the reference values agree. When I wrote that down, I thought of it as a way of working I'd backed into. Only afterwards did I notice that other fields have worked like this for decades, under other names, and that they're among the most demanding there are.

Chip designers simulate the hardware against a reference model until the two agree bit for bit, because a mistake found after manufacture costs a new set of masks. Video coding learned the same lesson the hard way: when an inverse transform specified only to a tolerance let encoders and decoders drift apart, H.264 made it exact. Knuth said he wouldn't believe a program was TeX until he saw it process his torture test, TRIP.TEX, correctly. And TeX does its arithmetic in integers wherever a decision is made, admitting floating point only for setting glue, which, as the source points out, doesn't affect its decisions. Ooloi's rational arithmetic is the same rule applied everywhere.

Standards bodies add a discipline of their own, and it's the one where I have to be most careful. The W3C normally wants two independent, interoperable implementations of every feature before a specification goes forward, and independent means that neither shares or derives from the other's code.

The workbench's JavaScript was written function for function from the Python. The two catch each other's slips, and 9,632 cases agreeing to the last fraction mean something, but they can't catch a misreading they share. Two earlier models were written from the ADRs alone, one of them by a language model that had never seen the code, and both reproduced the ADRs' results.

Over-Engineered?

​In August last year I wrote a post called Is Ooloi Over-Engineered?. It was about infrastructure: multicore formatting, transactions, GPU rendering, the things that keep a large score usable. The question has come back in a new form, and it's a fair one. I'd expect it from other developers of notation programs as readily as from anyone. Fifty-nine ADRs. An exact model of the spacing in two programming languages, held together by thousands of reference cases. Every spacing figure in the ADRs recomputed whenever a rule changes. A public workbench. All this to space a few bars of music, in a program that hasn't yet drawn a note of its own.

I understand how that looks. But over-engineering of the kind that sinks projects is accretion. The Vasa went down in Stockholm harbour on her maiden voyage in 1628 because she carried too much weight above the waterline for the hull beneath her, and in 2003 IEEE Software ran her as a cautionary case for software projects. The last five weeks of Ooloi have gone the other way. The stability term, the stretch dial, a table of glyph pairs, the gutter and a leftover formatting record have all gone, each because something simpler that was already there covered what it had been for.

The apparatus is what makes removal safe. When a rule is replaced, the model shows what changes, in every case at once, and when nothing should change, it shows that nothing did. Without that you keep everything, just in case, because nothing can tell you what taking it out would break. That's how accretion starts.

Why Heuristics Were the Logical Choice

​So, some plain speaking, from someone who came across these things on the path, without setting out to find them.

My view is that music engraving software has been under-engineered, and for reasons that have nothing to do with the ability of the people who wrote it. Most of it was written by very competent engineers, as I said in Music for Computer Scientists. The reasons are structural. What follows is my reading rather than a finding about any particular program, and I count four.
​
  1. The field is small. Notation has never been big business, a handful of programs have defined it for decades, and the investment there is goes, sensibly, where the buyers are. I'd guess that engraving quality is seldom what decides a purchase, so the rigour it needs is seldom what gets paid for.

  2. The problem looks smaller than it is. Donald Byrd, whose 1984 thesis Hegazy and Gourlay cite, describes the complexity of conventional notation as 'more often underestimated than not'. Spacing looks like arithmetic, and its depth only shows when the arithmetic meets real music.

  3. Traditional architectures close the door. Where widths are negotiated by cleanup passes, they're only known after the breaks are chosen, and an exact solution really is out of reach. That makes the opposite misjudgement true in practice: engraving, the folklore says, is an art too full of exceptions to formalise, and every program built that way confirms it. Inside that circle a heuristic is the only kind of fix there is, and reaching for one is the logical thing to do.

  4. And the methods aren't part of the trade. Reference models, exact oracles, specifications that execute, implementations held to each other value for value: these belong to chip design, codec standards, compilers and formal verification, fields where a mistake found late costs a fortune. The same goes for the alternatives a step further up: an exact optimum where greedy filling is the habit, rational arithmetic where floating point is.

    ​Most developers of application software, in notation as anywhere else, never meet them, because nothing in their work demands them; the fields where they are encountered are very far from music notation. That's no criticism. The application programmer's toolkit is excellent at what it's for, and a reference model is very seldom part of it. I didn't set out to use one either. Igor Engraver was a product of its time, single-threaded on single-core machines like its contemporaries, and until October I fully expected to herd cats. I arrived at the method because the architecture made a small, exact model possible, and found its other names afterwards.

The algorithms were never secret. Hegazy and Gourlay published in 1987. What was missing from the field was a surrounding architecture that settles every width before breaking begins.

What Hasn't Been Thrown at It Yet

If the pattern holds, the consequences for the work ahead are large, and mostly quiet. The horizontal work that remains stops being a question of algorithms and becomes a question of values, measured from printed plates, the duration table first among them. Every new kind of notation arrives with a single question, which of the four forms it takes, and the answer has one place to go. Work of that shape can be listed and counted. (And the importance of this for plugin developers adding new graphics can't be overstated.)

But what the springs haven't met yet makes a long list, and it should be given: full scores, several voices on one staff, key signatures, grace notes, bar rests, and, outside the model altogether, slurs, most ties and page turns.

Any of these could be the first thing that doesn't fit, and ADR-0055 already says what happens then: the design changes upstream, and no pass is added after the springs. We shall see whether the pattern continues. It does seem that it will. But expecting isn't knowing, and the springs will have the last word.
​
I'll keep listening.
0 Comments

Variants at a Break

12/11/2026

6 Comments

 
Picture
A new ADR: 0058, Variants at a Break.

It began with a small question: should the space inside a system's preamble, between clef and key signature, be a spring like the space between notes?

​
It shouldn't. Look at any engraved page and the preambles stand one above another, the same glyphs in the same places, system after system. The eye reads them as part of the frame. Squeeze one and the column breaks. So the blocks are rigid, and only the approach from the key signature to the first note gives way.

Following that thread changed more than I expected. Every barline is now what TeX calls a discretionary break: three small records, for when no break falls there, when a system ends there, and when one starts there. A system is simply its start, its measures, the barlines inside it and its end, added up. The gutter is gone, its contents sent where they belong. The preamble comes from a table, so identical preambles are identical by construction. And the breaker stays exact.

None of the parts is new. Knuth and Plass had the three forms in 1981. But TeX's discretionaries may not contain glue. Ours contain springs.

And as a result, the workbench will need to learn how to draw key signatures. I'll start with C♯ major, and the reason is – Ondine…

6 Comments

A Living Workbench

10/11/2026

12 Comments

 
​The first pictures of Ooloi's spacing were stills. A still shows where everything ends up and nothing of how it got there. The animations changed that, and more than I'd expected. Watching a bar squeezed and let out again, I could see what Hegazy and Gourlay's model really is and how it behaves. Spacing stopped being a set of formulae and came alive.

Then there was the response. We were suddenly discussing music. That's when I realised I had a research tool on my hands, and one I could put straight into other people's.

So there's a workbench now: a fully interactive model that runs the core of Ooloi's horizontal spacing, as the ADRs specify it, on a few bars of music, redrawing them as the settings move. It’s on the site now, under Workbench, and the video above shows it at work.

​I'd put it on a par with making the
Librarian public. The Librarian lets anyone search the reasoning behind Ooloi's architecture; the workbench lets anyone see what its spacing does, try a rule and judge it by eye before a line of Clojure exists. It's a way of working I hadn’t planned, and one that follows directly from how Ooloi is built.

What It Shows

Across the top are the settings, each with a line saying what it does. Below them a gauge runs from compressed to stretched; drag its pointer and the whole passage follows. Under the staff are the springs, rust where a gap is held as close as its ink allows and grey where it's free, so you can see what's holding and what's giving way. The model recomputes and redraws in well under a millisecond, faster than the screen refreshes, so the music follows the hand. Nothing in it is rendered by Ooloi itself.

You can choose among the ten SMuFL fonts Ooloi ships with. No rule in the model knows what a sharp or a flag is, so every font gets the same rules, and when you change the font the spacing follows the new ink, with nothing tuned for any of them. Four of the ten are handwritten jazz fonts, which makes that a harder test than it sounds.

Among the Dots

​Here's the kind of thing it's for. In a bar with a double-dotted half note and two sixteenths, I was dragging the line from loose to tight and back, and somewhere on the way in the first sixteenth slid in above the dots of the half note: being higher, it touched nothing, so nothing held it back. The springs were doing exactly what they'd been told, and no test would have caught it. It still read wrong: a note standing inside the time of the note before it. The accidentals were tucking into the dotted note's space too, and that looked right.

So the rule became this: a note keeps its distance from the right-hand side of the previous notehead, dots included, while its accidental may still tuck in. For a while a checkbox let me compare the two. The answer was always the same, so the checkbox went, the ADRs were amended and every figure in them was regenerated. Below is the same bar under both rules, dragged from tight to loose:
Picture
It took a slider to see it, and then it was obvious at once. An animation runs past the moment at its own pace; a slider lets me stop on it and cross it again and again. Ooloi has no spacing code yet, which makes this the cheapest a mistake in it will ever be. The new rule will reach that code already decided, with the numbers it has to produce.

Why It Can Exist

​For what it covers, the workbench computes what Ooloi's spacing computes, in the same stages and to the same exact fractions, and Ooloi's own code will be held to its numbers. That's possible only because the spacing is small enough to copy. Every rule reaches the springs in one of four forms before the line is broken, and the pipeline runs one way, so nothing comes back afterwards to correct anything and each stage can be reproduced from its inputs alone. The arithmetic is exact, so the workbench and Ooloi can be compared for equality rather than within a tolerance. When a rule changes, the ADRs, the figures and the workbench change with it. The workbench will never run the whole formatting pipeline, and isn't meant to: it holds whichever parts of the spacing I'm working on, for exploring the mathematics until each rule is right, so that the herd of cats never gets in.

Where layout emerges from formatters correcting each other's work, there's no small model to take out and try things on. The behaviour lives in the corrections, and the only way to learn what a new rule does is to build it into the whole program and see what the rest of it makes of the change.

The new ADR-0057: Reference Model of the Spacing Pipeline makes this way of working binding.
Picture

Judgement

Ooloi's spacing has a motto: Hegazy and Gourlay provide the physics, I provide the dials, and the user provides the artistic judgement. Until now the third part had to wait for Ooloi to exist. It doesn't any more.
​
​Engravers can see at once where the page looks wrong and find out whether the house look they need is within easy reach of the dials, without reading a line of an ADR. And I get to see the consequences of my mathematical choices. Where every eye gives the same answer, there's a rule, as there was with the dots.
12 Comments

No Cats Were Herded

4/11/2026

6 Comments

 
Picture
​ADR-0055 says that the first note of a measure stands one staff space from the barline, measured to whatever ink comes first. It's a reasonable rule, and the kind you only really understand by looking at it. So I looked.

This week has been play, in the most serious sense I know: change a number, watch what the page does, change another. The stretch dial was already settled at 1, so that only white space stretches, which is what an engraver does. What I wanted now were sensible defaults for everything around a barline: the space after it, the space before it, and how both behave when a system is squeezed or pulled. Defaults defensible today, as legible as the mathematics allows, and still only defaults, since a house style can replace any of them.
​
What follows are four pictures, in the order I made them, each answering a question the one before had raised. They're computed by Ooloi's reference model, not rendered by Ooloi. Bravura's glyphs are drawn from the font's outlines and every contact is measured on them; the rest are placeholders until the plates have spoken. The music above is where it ended: four measures at the default settings, with nothing annotated. Everything below is how it got there.

One Rule, Six Notes

Here's the first column after a barline, six ways: a plain note, a sharp, a flat, a natural, two stacked accidentals and an arpeggio, at normal width and fully compressed. The sliders are the settings. Wherever a distance is drawn in a slider's colour, that setting is what put it there; grey is a result.
Picture
The trouble with the rule as written doesn't need a picture. One staff space to the first ink means that a sharp pushes its notehead 1.2 spaces further to the right than a plain note, and two stacked accidentals push it 2.1. Engravers don't do that. They let an accidental come closer to the barline than a notehead would, because the notehead is the rhythm and the accidental only announces it.

So the rule split in two. The standard distance, 1.0, runs from the barline to the notehead. A second setting, the least distance at normal width, lets any ink before the notehead come as close as half a space before it starts pushing. A third, the least distance at full compression, is where all of it ends up when a system is squeezed as far as it will go: a quarter space, approached in proportion on the way.

Now look at the bottom row. The sharp, the stacked pair and the arpeggio come in to a quarter space. The flat, the natural and the plain note stop at half a space, and nobody told them to.
​
A flat's upright, a natural's and a stem pointing down all run parallel to the barline, and two parallel lines closer than Bravura's double barline, whose lines are 0.4 apart, read as a double barline. That's the fourth setting, the least distance to a stroke, and it doesn't know what a flat is. It looks at the outline: where the edge facing the barline runs straight and parallel to it for at least a staff space, that edge is a stroke. A sharp's uprights are short and set back behind its crossbars, so a sharp isn't one.

Forty Staves

​The first column belongs to every staff in the system. If one staff's note has to move, the whole column moves with it, in every staff.
Picture
That's why the least distance at normal width matters more than it first seems to. In a score of forty staves, a single accidental in a single staff shouldn't push forty first notes to the right by its full width. An engraver would let that accidental sit closer to the barline than the standard distance and keep the column where it was. With the defaults, the sharp moves the column 0.70 rather than 1.20. Set the least distance at normal width to a quarter space, as the third panel does, and it moves 0.45.
​
The upper row stands still at normal width. The lower row runs through one adjustment ratio shared by all three panels, from fully compressed to as loose as TeX would tolerate, and the space after the barline shrinks in proportion as the stacks compress, like every other gap. Each panel ends in a double barline, so you can compare a stem beside a barline with the real thing.

Room to Spare

When a system stretches, every note's white space grows in the same proportion. The question is what the space after the barline should do meanwhile.
Picture
The fifth setting answers it: the share of the standard distance that stretches as white space does. At 0 the space after the barline stays put however loose the line gets; at 1 it keeps its proportion to every note's white. The three rows are identical down to normal width and only part company as the system loosens.
​
The default is a half, and it's also LilyPond's. Its barline gives the next note a semi-fixed space of 0.9, half of it fixed and half stretchable, and in this model that comes to exactly the same thing. The difference is that LilyPond chooses between a few fixed kinds of space (rigid, half, all), whereas here it's a number between 0 and 1.

The Other Side

​So far everything has happened after the barline. Before it the music is different: flags, dots, and the last note of a measure, whose space runs right up to the barline, which belongs to its measure, thickness and all.
Picture
​My first version gave this side a least distance of its own, a quarter space at every ratio. It left an eighth's flag 0.28 from the barline at normal width and a sixteenth's 0.25, and it looked cramped. The cure turned out to be no new setting at all. A least distance keeps ink legible beside a vertical line, and that has nothing to do with which side the ink is on, so the barline's own pair, half a space at normal width and a quarter at full compression, now guards both its sides. The stroke distance does too, which is why the up-stemmed quarter at the end of the first measure keeps its half space when everything else is squeezed.

The one setting that belongs to this side alone is the borrowing: how much of the barline and the space after it is taken out of the last note's own space. At 0, the default, the barline comes on top, as it does in LilyPond. At 1, the next measure's first note stands exactly where the last note's space ends, so the rhythm runs on across the barline as if it weren't there, at normal width and stretched alike. Watch the quarter at the end of the first measure: underneath, the barline adds 1.16, then 0.58, then nothing.

The eighth and the sixteenth have nothing to lend. Their flags need the room: a sixteenth gets 1.8 spaces, and its flag reaches 2.18 from the left edge of its notehead, so the barline makes way for it even at normal width.
​
And then there's the thing I keep going back to watch. At full compression, the two sixteenths in the third measure slide together until the first one's flag is a clearance away from the second one's stem, the two flags nesting one above the other. Nothing in the model knows what a flag is. The outlines of two notes, compared band by band, are all it has.

No Cats Were Herded

None of this needed a rule about anything in particular. There's no rule for a flat after a barline, none for a flag before one, and none to decide which rule wins when two of them meet. Every collision is the same comparison: two outlines, band by band, kept apart by a clearance. The settings say how far; the springs say where, and they're the same Hegazy and Gourlay springs that cast off the music.

Had I described spacing as rules about pairs of things, I'd be herding cats: a rule for a flat after a barline, another for a natural, another for a stem, exceptions to each, a referee for their quarrels, and a new cat for every new symbol. The springs and the outlines are what made the cats unnecessary, and I chose both for other reasons entirely, the springs for casting off and the outlines for a ledger line between a sharp's crossbars. Watching them pay out here, without being asked, is the best part of the week.

It's also why this week was possible at all. I could look for defaults by playing because the mathematics is pure: each setting does one job, so I could move one, look, and know that nothing else had shifted in some negotiation behind my back. And the model is exact. It's written from the ADRs in rational arithmetic, it reproduces their published numbers, and Ooloi's implementation will be checked against it number for number, so what these pictures show is what Ooloi will do with the same values, and any difference will be a bug. With a herd of cats I could have done neither. The defaults would have had to wait for the rendering pipeline, and then be found by arguing with it.
​
I want to be exact about the claim, though. The stroke distance is an optical rule rather than a matter of collision; it's simply stated geometrically, so that it applies to any straight edge. And there will be heuristics in Ooloi, because engraving is full of rules of thumb. One is already waiting: an up-stem just before a barline looks cramped, and LilyPond adds a little space for it. But rules of thumb will come where they cause no damage and no delay, on top of a model that already guarantees that nothing collides and every note stands where its duration puts it, never in place of it.

À la recherche des défauts perdus

So, for now: one staff space from the barline to the notehead; half a space to any ink at normal width and a quarter at full compression, on both sides of the barline; half a space to any stroke, always; the space after the barline stretching at half the rate of white space; and nothing borrowed from the last note. Each is a single number in a house style, and none needs another adjusted to it.

The relevant ADRs have been updated with the new settings, their defaults and the pictures you see here, ADR-0055, Horizontal Spacing, first among them.

Anyone who objects to the bottom rows of these pictures will be objecting to full compression, which is the limit the settings are defined at, not what a score will normally look like. A system that tight costs the line breaker more than a hundred times as much as one at its ideal width, so it adds a system long before it gets there. You'll see it where breaks are forced, or in a short passage between forced breaks with slightly too much music for one system and too little for two. And if a quarter space is still too tight for your taste, raise it: the breaker will simply add systems sooner.

Not everything came out clean. Compared band by band, two noteheads a second apart in successive columns were allowed to overlap a little in width, because their outlines curve away from each other and the ink never quite meets. Engravers don't let a note begin before the previous one has ended, so a rule about the order of columns is coming: a rule of rhythm, which outlines were never meant to know about. A dot at the end of a heavily compressed measure can also come close enough to a barline to look like half a repeat sign. Both will get their turn.
Picture
Exeunt, pursued by a stave
6 Comments

Between the Crossbars

1/11/2026

5 Comments

 
Cutting Corners Is Not Enough argued that spacing should follow the ink itself, not boxes around it. Taken to its conclusion, that applies to the ledger lines as well. So I recomputed them from Bravura's outlines, read straight from the font file, with everything else as in the animations since Ut Tensio, Sic Vis. This is what happens.

Here's a bar of chromatic sixteenths, dragged from its tightest to loose and back. Watch the panel on the right. At the tight end, ledger lines come in from both sides of the sharp, between its crossbars, and each one stops just short of the ink. The sharp stays tight to its notehead, and its lines lose only what the ink itself takes from them. Even at the tightest, nothing collides.
Picture
Incidentally, that's exactly what Magnus asked for under Dials: stave 4's sharp, tight to its notehead, without C♯6's ledger lines cut short. With the real shapes, a line simply runs on until it meets ink.
​
The second animation mixes sharps, flats and naturals. Each has a shape of its own, and all three are handled the same way, without a rule for any of them. Ledger line shortening occurs naturally regardless of the accidental, and on both sides of it.
Picture
​As before, these are reference models, not Ooloi's output. The outlines and Bravura's engraving metrics are real; the clearances and the opening width are placeholders.
​
And for anyone joining this thread late: every one of these values is a setting you can change.
​
This closes an arc that began with Ut Tensio, Sic Vis less than a fortnight ago, and it settles how Hegazy and Gourlay belong in Ooloi. Their springs decide where the notes go, and they never had to learn what a ledger line is. Everything about ledger lines happens at either end of the pipeline: Stage 1 works out how short each line may become against the accidentals' real shapes, and Stage 5 lengthens it again into whatever room the springs have given. The 1987 model stays exactly as it was. The six stages around it do the rest.
5 Comments

Cutting Corners Is Not Enough

30/10/2026

1 Comment

 
Picture
For almost two weeks now, the number of blog posts has reached an all-time high. The discussions here have all been about music. The turn came almost the moment horizontal spacing and casting off were settled, which is roughly what I predicted in The Machinery of Taste: once the work reached the page, the conversation would follow it into a musician's habitat.
​
My mind has followed it there too – hence all the posts – even though I really should be finishing the file picker's last bells and whistles. It keeps returning to a single ledger line, running between the crossbars of a sharp.

Between the Crossbars

In Dials, stave 4 keeps every sharp tight to its notehead and shortens the ledger lines around it. Under that post, Magnus Johansson asked whether stave 1 could have stave 4's accidental position without shortening C♯6's ledger lines. I said yes: the accidental would then stand on top of the line.

But would it? A sharp's bounding box, the rectangle around its ink, is mostly white space, so a ledger line that reaches into the box isn't necessarily under anything. The upper of C6's two ledger lines is the sharpest case. It runs between the sharp's crossbars, where the only ink is the two stems. Whether a full-length line there lies under the sharp, or merely passes through its white space, depends on exactly where the ink is. The ledger line is in the accidentals territory, but there's no actual overlap of ink.

The animation in Dials couldn't say. It worked from Bravura's bounding box for the sharp, refined by SMuFL's cut-outs: rectangles in a font's metadata that mark a corner of the box as empty. The panel beside stave 4 shows the lower ledger line reaching into one of them. But the space between the crossbars isn't a corner. No corner cut-out describes it, and no corner cut-out could, so the question behind Magnus's request can't be answered from the metadata at all. For engraving at this level, corner cut-outs are far too coarse.

​Cutting corners, in other words, isn't enough.

What the Font Knows

A font can describe a glyph's shape three ways. The bounding box is the coarsest. The cut-outs refine it, where the designer has supplied them. The outline is the ink itself, and every font has one for every glyph.

From the outline, Ooloi keeps each glyph's profiles: how far the ink reaches sideways at every height, and up and down along its width.
​
It isn't only the sharp. Rectangles fare worst against curves, and a flat's bowl is nothing but curve.
Picture
Text fonts, for lyrics and expressions, have no SMuFL metadata at all, but they do have outlines. So when Ooloi reaches the lyric hyphens Malte asked about on NOTATIO, the syllables will be spaced by their real shapes.

Read, Never Rendered

The obvious way to find the ink would be to draw the glyph and look. I considered it and rejected it: a bitmap depends on the software that draws it, so upgrading a graphics library could move a note. A page has to depend on the piece, not on the machine.

Outlines need no drawing. They're already exact numbers, and Ooloi reads them as the font stores them.
​
For the curious: each curve is halved until the polygon around every piece hugs it closely, and the profile is taken from the polygons, which always lie outside the curve. So a profile never cuts into the ink.
Picture
This happens once, when a font is registered. The profiles are stored with it, and layout only ever reads them.
​
(None of the pictures here was drawn by hand, by the way. They were computed from Bravura's actual outlines.)

Down the Mountain

This matters more than any single sharp. In High Hrothgar I described two kinds of notation program: on the mountain, the ones handed a whole piece, which take their time and produce the best pages; in the valley, the ones that answer as you work. Hegazy and Gourlay's casting off was the first piece of the mountain's knowledge to come down. This is the second.

Spacing against the ink has been the mountain's way. LilyPond, which shares Ooloi's lineage from Hegazy and Gourlay, builds the same kind of profiles from glyph outlines (the usual word is skylines), which a program that compiles the whole piece at once can afford. A year ago, in The Lineage: When Ledger Lines Shorten, I wrote that a ledger line shortened beside an accidental, in LilyPond's essay on engraving, sent a tingle down my spine. Fitting, then, that a ledger line beside an accidental should lead back into the same family.
​
What Ooloi adds is the way down. Read once and kept as data, the profiles give a program that answers as you work the mountain's geometry at no cost per keystroke. The springs, the ink itself and an answer while you type: as far as I know, no interactive program has had all three. That's why a ledger line between a sharp's crossbars is worth a post.

Tucking

Engravers have always let accidentals slip under things. When a note is followed by a lower one, its accidental can slide in under the first notehead; in a chord, stacked accidentals interlock. That's tucking (though not in the RuPaul sense), and profiles do it without being told: glyphs come as close as their ink allows, and no rule has to mention a flat or a sharp.
​
Here is F5 followed by C♯5, three ways. With the outlines, the sharp's whole upper half slips in beneath the F.
Picture
​(A caveat about these pictures: they show how close the shapes can come with nothing added for clearance, so with outlines the sharp actually touches the F. Real spacing keeps a gap. What matters is the order: boxes allow the least, cut-outs a little more, outlines the most.)

Some engravers call all of this kerning, whatever slides into whatever. It's a good analogy: in metal type, a kern was the part of a letter that hung over onto the next. But letters share a baseline and notes don't, so it isn't quite accurate.
​
Which brings me back to the line between the crossbars. Here is C6 followed by C♯6's sharp, as close as the outlines allow; the dashed sharp is where the boxes would put it.
Picture
In this gap the cut-outs don't help at all; only the outline lets the two come closer. And it answers the question behind Magnus's request: up to the sharp's left stem, the line runs through white space. Only beyond it is it under the ink.

Too Much of a Good Thing

​Look how far those ledger lines go, though: right up to the stem, further than an engraver would let them.

Going back to boxes would be the wrong cure: they'd hold the lines back for the wrong reasons, and in the wrong places too. ADR-0055 has a dial instead, the opening width. Openings narrower than it are filled in before spacing, and only the wider ones are left for tucking.
​
Here is that gap again, with the opening open, partly filled and filled. Because a sharp's crossbars slope, the dial works gradually rather than like a switch.
Picture

The Other Direction

​So far, everything has been horizontal. Read from above, the same profiles tell a slur how close it may come, and two staves how close they may stand. Measured from the outlines, the slur (solid) sits noticeably lower than when measured from boxes (dashed).
Picture
Good engravers overlap things on purpose, and to do that you need to know exactly where the ink is. The same knowledge decides other things too: in this bar, whether the accent might go outside the slur instead, house style permitting.
​
So, back to where this started. A sharp can stand over a full-length ledger line, and Ooloi knows whether that line is under its ink or only in its white space.

The mechanism is in ADR-0056, Glyph Geometry from Outlines. Seven other ADRs have been brought into line with it, ADR-0055 and its dials among them.
​
And now, back to finally getting that file picker out of the way, even though this is so much more interesting. After all, it's the very thing I've been building the architecture for.

It's a lovely feeling.
1 Comment

Dials

29/10/2026

10 Comments

 
In the comments to Ut Tensio, Sic Vis I told Magnus Johansson that Hegazy and Gourlay provide the physics, I provide the dials, and the user provides the artistic judgement. I meant it as a summary, but it also is a work plan. 

The physics has had several posts of its own. This one is about a few of the dials: what they are, what each is called, what kind of control it is, and what it does to the page. Two animations show them at work. The first is about what takes the room when a system is looser than its notes need. The second answers the question Magnus asked in those comments, which NOTATIO took up almost at once: who gives way when an accidental meets a ledger line?

Who Takes the Room

​When a system has more room than its notes need, something has to take it. Which notes take it is decided by a single setting, the stretch dial: a slider from 0 to 100%, shown in the animation at three positions, labelled λ = 0, 0.5 and 1.
Picture
At 0, the whole distance from one note to the next stretches. Every gap grows in proportion to its ideal width, so a loose system is simply the ideal one, scaled. At 100%, only the air stretches: the white space left over once the noteheads have taken theirs. The half note then takes most of the room, and the sixteenths stay together. That end of the slider is LilyPond’s behaviour. At 50% the two share it, and the slider can stop anywhere along the way. Where its default belongs is for the plates to say, not me.

Watch three moments. While the bar is compressed, all three rows are identical, because the dial only acts when there’s room to spare. At r = 0, the ideal spacing, they’re still identical, with the gaps before the sharps held open at exactly the width the sharps need. Then the barline moves out, and the rows go their separate ways.
​
The gauges show the adjustment ratio, r, the number the line breaker judges each system by. At −1 the music is as tight as it can go; at 0 it's ideal; the green band is the looseness the breaker accepts. All three gauges agree at every width, and that's deliberate: the breaker judges a system by how much room it has to spare, not by which notes take it. So the dial never changes its verdict. It decides where the room goes and nothing else, which means it can't move a line break, and turning it never obliges you to adjust anything else to keep the casting off sound.

Note that in practice, r is as close to 0.0 as possible: that's the entire purpose of casting off. Values for r near -1 are very extreme and rarely or never appear, unless you force it explicitly. So keep in mind that an r of -1 results in the music having lost all rhythmic proportionality. But – with Hegazy-Gourlay's algorithm, you still get no horizontal collisions.

Who Gives Way

Magnus asked whether the C♯4 and A♯5 in the ‘Ut Tensio’ examples could keep ledger lines of normal length when there’s room to the left of the accidental. They can. Three settings decide who gives way, the ledger line or the accidental:
​
  1. Minimum protrusion is a measurement in stave spaces: how far a ledger line must still protrude from its notehead on the accidental’s side. It runs from 0 up to the full extension. At the top it becomes ‘full extension’ and stays there, so the line never shortens, however the full extension is set later.

  2. Accidental position is a switch with two positions. Either the accidental moves out past full-length ledger lines when there’s room, or it stays tight to its notehead and the lines are cut around it.

  3. Stays nearer its own note is an on/off switch with a ratio behind it. When it’s on, an accidental may never end up nearer the previous notehead than its own, at a ratio of 1. Its own ledger lines give way instead, as far as setting 1 allows.

One difference between them matters more than any other. The minimum protrusion decides how much room the notes reserve, so it’s the only one of the three that moves notes. The other two only spend room the spacing has already given. They never move a note, and they never move a line break.

(The image below is very large and is reduced in size to fit. Click on it to open it in a new window where it can be zoomed.)
Picture
​Each stave changes one setting from the stave above, and the changed value is highlighted.

Stave 1 never shortens its ledger lines. Magnus, you once said that shortened ledger lines weren’t always necessary as far as you were concerned. This is that setting, and it has a price. At the tight end the bar doesn’t fit, and the sharps end up nearer the previous note than their own. They turn rust when that happens.

Stave 2 lets the lines shorten to 0.16 stave spaces, so the bar fits. But as room appears, the sharps move out past the lengthening lines and drift towards the previous note.

Stave 3 switches on setting 3. The lines give way instead, and the sharps stay where they belong. They turn blue while the setting holds them.

Stave 4 keeps every sharp tight to its notehead and cuts the ledger lines around it.

Given room to spare, the first three staves agree. The fourth keeps its own look.

Beside each stave, a panel magnifies one gap, C6 to C♯6. The note’s own notehead stays put, so you can watch the sharp travel, and the distances to both noteheads change as it does. In stave 4 the panel shows something else as well. Bravura’s sharp has open corners, and the lower ledger line reaches into one of them, further under the sharp than the line beside the notehead. Nobody had to write a rule for that: the sharp’s outline, band by band, is all the springs need.

The ledger lines don’t only give way to accidentals. Look at C6 in the panels when the bar is at its tightest: its lower ledger line is shorter on the left than the one above it. B5 has a ledger line at the same height, and the two share the space between them, keeping a sliver of air in the middle; the line above has no neighbour at its height and only has to clear B5’s notehead. There’s no special rule here. The lines reserve only their shortest acceptable form, so they never push the notes apart, and the notes stay where their durations put them. If you’d rather the lines kept their full length and the notes moved apart instead, that’s the minimum protrusion on the other side, set to the full extension.

So these three aren’t the whole story. Whether a note’s ledger lines should be evened out, so that the lower one is never shorter than the one above, is a matter of taste, and so is shortening both ends of a line symmetrically, which someone on NOTATIO suggested. Both are candidates for dials of their own, and both will get their turn.

Division of Labour

​A word on what you’re looking at. Both animations are conceptual. Positions are computed from the published specifications and drawn from a real music font, but nothing in either was rendered by Ooloi. Bravura’s metrics are real; every other value is a placeholder until the plates have spoken.

What they do show is the division of labour. The springs guarantee that notes stay where their durations put them and that nothing collides. Within that guarantee, the dials decide how the page looks, each doing a single job, none needing to know about the others. Which positions are right is the engraver’s call, as it always was.

Both animations are free to use. Download them, put them in a lecture, a forum post, a book or a presentation, cut them up or build on them; no permission is needed. Formally, they’re released under CC0.
10 Comments

Ut Tensio, Sic Vis

19/10/2026

19 Comments

 
“As the extension, so the force”
Hooke’s law, first published in 1676 as the anagram
ceiiinosssttuv
(Gourlay’s springs are Hooke’s law with a stop)
​The last few posts described Hegazy and Gourlay’s springs in prose and formulae. That’s the right way to specify something, and a poor way to feel it. The engraver in me wanted to see the music move, so I had the mathematics turned into animation, one computed frame at a time. What came back stopped me. I’ve lived with music notation for most of my life, as a musician and as the author of Igor Engraver, and I’d never seen spacing behave like this: calm, legible at every width, and never once wrong.

Below is a bar of chromatic sixteenths, C4 to D♯5, with its end barline dragged from as tight as it will go to loose, and back. Nothing in it is drawn by hand. For every frame the program finds one number, the force that makes the bar fit where the barline is, and every note then goes where the model sends it. The formula is the one ADR-0037 specifies, and the shrinkability is ADR-0037’s baseline. Until now the spacing could only be described. Now it can be run.

Watch the gaps before the sharps. In a tight bar they’re wider than the others, because a sharp needs room. As the bar opens they stay where they are while the rest catch up. Once they’ve been caught, every sixteenth sits the same distance from the next, and stays there however far the barline goes.
Picture

Notehead to Notehead

​Here is the idea on four notes. The springs join notehead to notehead and run straight through the accidentals, because what the eye measures is the distance from one note to the next. The shapes themselves are solid and can’t pass through each other. When they touch, the spring between them can shrink no further, and that point is its blocking width.

The short note is followed by one with a double flat, and the gap between them needs about twice the room its duration would give it. Under compression the long notes give way while that gap holds. When the bar opens it waits until the force has caught up with it, and only then stretches with the others. By the end it’s longer than its blocking width, which is exactly what a prestretched spring should do.
Picture
(Rhythm: dotted 8th, sixteenth, dotted 8th, sixteenth)

The Springs Made Visible

​This is the same scale as the first animation, with the springs drawn in. A rust-coloured spring is held at its blocking width, where the shapes touch; a grey one is free.

On the way out the springs before the sharps turn grey one after another. The one into the low C♯ goes last, because the C’s ledger line has to clear that sharp as well. On the way back every free spring turns rust at the same instant. That’s deliberate: each gap’s shrinkability is its own room above collision, so they all run out of room together, and the tightest legible setting means the same thing across the whole system.
Picture

Three Ways to Fit a Bar​

​This is why the simpler options lost. All three rows are given the same width, and each finds its own fit.
​
Row A raises a gap’s ideal width to its minimum and scales everything by one factor. Accidentals then add space, and the bar can’t compress below its natural width, so its barline overruns the margin. Row B lets each gap shrink only by its own spare room. Compression comes out right, but the inflated gaps keep stretching in proportion as the bar opens, and B ends up indistinguishable from A. Row C is the springs: under pressure the gaps differ, and as the bar loosens the grid evens out and stays even.

To a trained musician there’s no contest. Row A is impossible when the bar is tight and lopsided when it’s loose. Row B is right only while the bar is tight, and as soon as it opens, the notes with accidentals drift apart from the rest. Only C, Hegazy and Gourlay’s springs, cuts the mustard at every width.
Picture

​Ledger Lines

​The last animation is about craft. Chromatic sixteenths run from A5 to C7, with one to five ledger lines each, six of them sharped.

Blocking widths are computed from ledger lines in their shortest acceptable form, so a ledger line never pushes notes apart. It only takes the room the springs have already given. In a tight bar the lines are short; as the bar opens they lengthen, side by side and height by height, up to Bravura’s full extension. The side facing a note’s own sharp stays short. A line facing the next note’s sharp stops clear of it. Two lines at the same height share the gap between them and keep a sliver of air in the middle. Engravers have always shortened ledger lines when room ran out. Here they do it because the space tells them to.

This is the one I keep coming back to.
Picture

Nothing Collides

Look again at any of the five animations, at any width you like: nothing ever collides horizontally. Nothing checks for it either. A single maximum guarantees it. A gap’s width is the larger of its blocking width and its spring’s length, so it can never become narrower than the point where the shapes touch. Once everything that can give has given, the bar simply won’t get narrower, and the line breaker never asks it to.

For me as a programmer, this is the best part. There’s no special case for a sharp drifting into the previous note, none for a ledger line touching its neighbour, and none for an accidental meeting a dot. No clean-up pass looks for collisions afterwards, because there’s nothing for it to find. In previous blog posts I've written about how correction passes are where layout code grows old. Each is written for a case someone noticed, each can disturb what the others arranged, and none is ever safe to remove. Ooloi won’t have a single one for horizontal collisions. Not fewer: none. ADR-0055 states this as an invariant, tested over random music: no collision at any feasible width.

Don’t read too much into the exact amounts. The notehead and sharp widths, the line thicknesses and the full ledger extension are Bravura’s, but everything else is a placeholder I picked, and the glyphs are plain geometric shapes. How far a ledger line may shorten, how close a sharp may come to the note before it, and where the full form begins are house-style matters, and in Ooloi they’ll be the user’s. The motion is the model’s. The measurements aren’t Ooloi’s yet.

Warmth

That brings me to Roland Gurt’s point about warmth. To me it’s essential, and it’s one of the things Ooloi is designed for. But the springs don’t supply it. What they supply is a guarantee: notes stay where their durations put them, and nothing collides. Warmth is in the tuning. That’s how much more room a quarter gets than an eighth, how far a short note gives way to a long one under pressure, and how much air an accidental keeps from its note. A tracker action doesn’t make an organ beautiful. It makes it obedient, and the beauty is the voicer’s work, pipe by pipe. The numbers that make a page warm will come from engraved plates, and the user will be able to change them.

Under the Pointer

What you’ve been watching is also how it’s meant to feel in Ooloi. ADR-0055 specifies the barline drag as live: each movement of the pointer refits the system being dragged, and the music follows the barline as you move it. Nothing reflows anywhere else while you drag, because the dragged system is held where it is and no line break moves. However long you drag, the whole gesture is a single undo. As far as I know, no other program spaces music live under the pointer like this.

Until now I’ve had to imagine how this would move. Now I’ve seen it, and as a musician I was simply wowed. The notes keep their rhythm under any pressure, the accidentals hold their ground and then let go, and the ledger lines know exactly how much room they have. I hope you’ll feel the same. And now I’m raring to build the machinery that will let me drag that barline myself.

The five animations are free to use. Download them, put them in a lecture, a forum post, a book or a presentation, cut them up or build on them; no permission is needed. ​
​Formally, they’re released under CC0.
19 Comments

The First Bar of the System

18/10/2026

2 Comments

 
An accidental, a grace note, a clef change and a repeat barline walk into a bar. It’s the first bar of a system, so it’s already crowded.

The clef change says, ‘Don’t worry, I sent word ahead’, and points to the courtesy clef waiting at the end of the previous system.

The repeat barline says, ‘I’ve been here before’.

The grace note says, ‘I can’t stay long’.

The accidental just nods at the notehead and says, ‘I’m with him’.

Most bartenders sigh and reach for the special-case drawer. Ooloi’s hands each of them a spring (‘boinggg’) and goes back to polishing glasses.
Picture
​A postscript, since the joke is less of one than it looks.

I’ve dreaded this part for two years. Casting off and spacing are where the Minotaur lives: the centre of the labyrinth, where the model finally has to become a page. I assumed I’d have to go in and wrestle it, and I spent the pipeline years arming myself.

I knew what the fight would look like. In a conventional architecture, each kind of object that needs room at a system start has a formatter of its own: one for accidentals, one for grace notes, one for clefs, one for barlines. Each is reasonable in isolation. The trouble is that they’re independent, so they needs must negotiate. The accidental takes its room, the grace note needs some of it back, the courtesy clef changes what’s left over, and every pair that meets needs an agreement. Too many of those agreements end up as correction passes, and correction passes are the bane of notation programs, and their elephant graveyard: it’s where Finale finally went, after more than three decades. The agreements grow with the combinations, not with the objects. It isn’t one hard problem; it’s herding cats, each one patched where it was caught, until adding one more kind of object costs more than the program can bear.

Instead the Minotaur stretched out a hand: ‘Pleased to meet you, Peter. Let’s get to work, shall we?’

There were no cats to herd. There was only one Master Ring, if I may mix my metaphors further. Information in Ooloi’s pipeline flows one way, and every horizontal rule has to take one of four forms before breaking begins. By the time the accidental, the grace note, the clef and the barline reach the breaker, they’re all springs, combined the same way every time. The problem I met wasn’t the one I’d prepared for. I’d expected a fight with chaos. What I got was a choice between two pieces of mathematics, and the only question was which one was right. The chaos had been dealt with upstream, years earlier, without my quite realising that this was what I was doing.

I’m increasingly convinced this is also why Hegazy and Gourlay’s method hasn't been used in interactive programs. The usual explanation is that optimal breaking is too slow to recompute after every edit. It isn’t. It hasn’t been for decades. What it needs is width data that’s settled before breaking begins and stays put while the breaker works. An army of negotiating formatters can’t supply that, because in such an architecture widths are what layout produces, not what it starts from. Speed was never the obstacle; the cats were.
​
​The single model also makes the rest of the formatting much, much more straightforward to implement. Every rule that remains has one thing to become and one place to go, and none of them has to know about the others. Foundation work succeeds by disappearing, and this is what it looks like when it does: you walk into the room where the monster is supposed to be, and find a bartender polishing glasses.
2 Comments

Purity

17/10/2026

2 Comments

 
Picture
Oh, and by the way: the stability term is gone.

In 'The Seven Thousand Steps' I described Clear Skies, a cost charged for every system that differs from the layout the user has just been looking at, and concluded that it belonged on by default. I've changed my mind. The reasons say something about why Ooloi adopted Hegazy and Gourlay in the first place, so they're worth a few paragraphs.

The term worked. In the model it cut the share of rhythm edits that moved breaks from 33 in 60 to 8, for under one per cent of the total cost. Cost was never the problem. The problem is what it does to the meaning of a page. With the term in place, the layout of a piece is no longer a function of the piece. It depends on the layout before it, which depended on the one before that, all the way back through every edit since the file was created. Two routes to the same music arrive at different pages. The piece carries, invisibly, a memory of how it was edited, and the part a player eventually reads can be worse than it should be because of the order in which its engraver happened to work.

The springs were adopted to abolish exactly that kind of thing.

LilyPond makes a useful contrast. It is deterministic, as a compiler that starts from scratch every time must be: there is only one route to any page, because there is no history. What LilyPond gave up, in October 1999, was exactness. It added a term comparing each system with its predecessor, judged against a single stored predecessor, so its breaker finds an approximation of its own cost rather than the minimum. Ooloi has neither that term nor any substitute for it. The cost of a system depends on that system alone, as it does in the 1987 paper, and the optimum is exact.

Ooloi doesn't start from scratch, though. It re-optimises after every edit from two stored tables, and that is precisely where history could creep in. So the rule is this: after any edit, Ooloi must arrive at the page a full casting off from scratch would produce. Any route gives the same page, whether after undo, after a reload, on another machine, or with edits made in a different order. That is now an invariant to be tested, not a hope.

Breaks will therefore move, sometimes before the bar you edited. That is the optimum doing its job, and I want it to. Keeping you oriented is a matter of presentation, not of layout: the bar you're working on stays where your eye was, and whatever moves around it moves legibly. Where you want breaks to stay put, you say so, by freezing systems or forcing breaks, and that decision is stored in the piece like any other, where it can be seen, changed and undone. A layout decision you made is part of the music. One the program made for you because of the order you worked in is not.

The anchoring duration won't get the hysteresis I floated either, for the same reason: it gets a value you can pin, and nothing else. ADR-0037 and ADR-0055 have been revised accordingly.
2 Comments

Hammock Time

16/10/2026

0 Comments

 
Picture
On 12/9, at the end of 'The Machinery of Taste', I wrote that things would be slower here for a month or so. A new client placement was taking a great deal of attention, one of my AWS Professional certifications was due for renewal, and Ooloi would have to wait its turn.

It was, for about a fortnight. Then came the heaviest run of posts this blog has had: three long ones in less than a week. So much for the quiet month.

What was left to do on the engine was mechanical: refining the file chooser, and building the permission and invitation machinery for collaboration. Neither needs much thought once it's specified, and both were specified. That left the part of my mind that doesn't type with nothing to do, and it went where it always goes, to the next hard problem. Given the six-stage pipeline, how should a score be cast off, and how should the notes in each system share out its width? I read and mulled, argued with myself and with language models, left it alone and came back to it.

I didn't recognise what I was doing until it was over. Rich Hickey gave a talk in 2010, 'Hammock Driven Development', about exactly this. You load a problem into your waking mind as thoroughly as you can, then step away and let the background get on with it. That background is where most real design happens, he argues, and it only works on what you've given it. Mine had been given two years of pipeline and had nothing urgent to do with its hands.

Then the paper arrived, and the timing is what I keep turning over. Hegazy and Gourlay's 'Optimal Line Breaking in Music' reached me after I'd converted completely to Knuth–Plass. ADR-0037 had been aligned with the original down to TeX's constants, and 'Boxes & Glue' had ended on an unfinished thought about notes that want to stretch and give by different amounts. A month earlier it would have been an interesting old paper. When it came, I already had the question it answered.

It's the second time this has happened. In April I wrote that I needed Ross's The Art of Music Engraving and Processing and couldn't buy it. Kim Bastin in Melbourne read it and put his own copy in the post. In September I asked in a comment whether anyone had the Hegazy and Gourlay report, and within a week Ulrik Bodén had found one. I hadn't asked either of them personally.

The paper changed the project's direction, which is a different thing from being grateful, though I'm that too. Until Ulrik's copy arrived, Ooloi's design used one scale factor per system, both to choose the breaks and to place the notes. It was one model, but a crude one. It had no way of letting an accidental hold a gap open while its neighbours carried on, so every way of fitting chromatic music into it was wrong somewhere. Letting an accidental hold its gap while the others carry on is exactly what Gourlay's springs were made for. The force that decides where a system ends now decides, gap by gap, where each note in it sits, and it treats an accidental the way an engraver would. 'Vestigia' has the details.

​The short version is that casting off and note positioning are now governed by one single piece of mathematics that's right where it matters. That's huge, actually.

Huge because of what it protects. Information in Ooloi's pipeline flows one way: no stage asks an earlier one to think again. A model that's wrong in some cases will sooner or later tempt somebody to fix those cases afterwards, just this once, and that's the frost troll from yesterday's post. A model that's right about the hard cases gives the troll nothing to work with. Every rule about horizontal space reaches the springs as data, and once it does, it combines with all the others without anybody writing special cases. Engraving becomes far easier to reason about, for me and for the AI, which is at its best with mathematics somebody has written down.

It's encouraging, too, how little resistance the change met. The dynamic program didn't move at all. Stages 1 and 2 were already producing the widths the springs need, and each bar now keeps a couple of extra sums and a short list of the gaps its accidentals hold open. ADR-0037 was revised and ADR-0055 written within days of the paper arriving, and nothing around them had to change. None of it is built yet, so what passed the test was the specification, not the code. But building something that a better idea could walk into without a fight was the point of the last two years, and this was a big idea.

In 'High Hrothgar' I wrote that 'Nun denn, allein!' could have been carved over the monastery door. That was the honest picture of the first two years, and I won't revise it now. In April, when Kim offered me his copy of Ross, I wrote that something like an informal fellowship seemed to be forming around the work. That was a feeling. This is a fact about the engine: the model at the centre of its layout came from a paper I couldn't find and Ulrik could. 'Alone' describes how Ooloi was started. It no longer describes how it's being built. That changes how the work feels.
​
The conversation here will change too. When the permission and invitation machinery is finished, I'll show it in a video, and that will be the last of the plumbing. In August I raked the ring and left it empty. What comes next is what it was raked for: spacing, beams, slurs, page turns, the page itself. Those are questions musicians can argue about without reading a line of Clojure, and the people already gathered in the comments are the ones who'll know when I've got an answer wrong.
​
I should take more quiet months.
0 Comments

The Seven Thousand Steps

15/10/2026

12 Comments

 
Picture
'High Hrothgar' was about where the deepest knowledge of engraving lives, and my decision to take the mountain's method and try to carry it down into the valley. This post is about the climb itself: whether that can really be done in a program that answers as you work, what it costs in time and in code, and what turns up on the way.

In the game, the Seven Thousand Steps begin at a bridge in Ivarstead, and along the path stand stone tablets, each engraved with a fragment of the mountain's story. You read them as you climb, one at a time, out of breath. Ooloi's path has its tablets too, the ADRs, each recording a decision taken on the way up, and this post reads two of them again.
​
Last time I said two things: that everything I could see suggested the architecture would allow it, and that none of it was built yet. Both remain true. What has changed is that some of the claims can now be checked, and some of them have been.

Counting the Steps

In 'Vestigia Nulla Retrorsum' I wrote that the real cost of the springs would be known only when there was a benchmark, and that until then I was offering reasoning rather than measurement. There is now a first measurement, of a modest kind.

Since then I've had Claude Opus 5.5, at its extra-high reasoning level, write an independent model of Stage 3 in Python from the published ADRs: a language model with no history of this project, no special knowledge of Ooloi and no access to its code. It implements the baseline as specified (springs, calibration, demerits and tie-break), and it runs the slow way, in pure Python with exact fractions: about the least flattering setting the algorithm could be given. Clojure is much, much faster.

On a synthetic single-stave part of 800 bars, with accidentals scattered through it, a complete casting off into 143 systems took about 0.3 seconds. A part of 150 bars took 30 milliseconds. The exact re-optimisation after an edit, using the two stored tables of best layouts before and after the edited bar, gave the same answer as a full pass in every trial, down to the tie-break. Two different routes to the same answer, agreeing exactly in rational arithmetic, are a strong sign that the specification is consistent. The worked numbers in the ADRs held up too, from the point at which a thirty-second's spring starts to stretch before an accidental to the error of interpolating the duration table.

Nor does anyone have to take my word for it. The mathematics can be checked, and a similar model built, by anyone who cares to: give ADR-0037 and ADR-0055 to a language model set to a high level of reasoning, add the last few posts here for context, and go. That is exactly how the model above came about. The specifications were written to be precise enough to execute, and anyone can run that test.

Real scores are also kinder than that 800 suggests. A long work isn't one paragraph: movements, scenes and sections end at hard breaks, and each stretch between them is a problem of its own. The total work still grows only with the number of bars, so partitioning saves less time than you might think. What it buys is better: a fence around how far an edit can reach.

The JVM should do considerably better than Python; the real benchmark will say by how much. But the order of magnitude is settled. Speed was never the obstacle, I wrote. Now there's a number to go with it.

​The Wind Above the Monastery

Picture"Clear Skies"
​Above High Hrothgar the path to the summit is closed by a wind that no traveller survives. The Greybeards teach a shout, Clear Skies, that parts it long enough to pass. The breaker has a wind of its own, and it's movement, not speed: breaks that shift in places the user never touched.

A global optimum is not local. The ADR says so plainly: an edit to one bar can move breaks anywhere between the hard breaks around it, before the edit as well as after it. The model makes that concrete. On a synthetic part of 150 bars and about 28 systems, toggling a single accidental moved breaks in 2 edits out of 40. Replacing the rhythm of a whole bar, a large edit such as turning quarters into sixteenths, moved them in 33 out of 60, and in 21 of those 60 a system before the edited one changed. When such an edit moved anything, a median of 7 systems were rearranged.

That is the wind, and I suspect it's part of what Dorico's stated principle guards against: doing only the minimal recalculation an edit requires, as Daniel Spreadbury put it in 2015. That spares the user's sense of where things are as well as the processor.

The ADR's Clear Skies is a stability term: a cost for every system that differs from the layout the user has just been looking at. Set equal to the charge each system already carries, it brought the rhythm edits down to 8 moved out of 60, and an earlier system changed in only 3. The price, in the breaker's own currency, was under one per cent of the total cost in the median case. Ten times stronger, and only 1 edit in 60 moved anything at all.
​
The music in the model is random, so these numbers are indicative, not final. But they say something clear about defaults. The stability term is what makes an exact optimum liveable in a program that answers as you work, so it belongs on by default, switched off only when the user asks for a fresh casting off.

The Hourglass

Picture
​The model of Stage 3 contains no knowledge of engraving at all, and that says more about the architecture than about the model. Look at where the musical knowledge sits in the six stages and the pipeline takes the shape of an hourglass.

At the top, before rendering begins, sits the semantic model: which accidentals a note needs, how beams are grouped. Stages 1 and 2 hold the horizontal knowledge of engraving: how a chord with seconds is assembled, the outlines of glyphs, clearances, the table that turns durations into space, what changes at a break. Stages 5 and 6 hold the vertical and the page-level knowledge: slurs, ties, beams, articulations, ledger lines lengthened into the room they've been given, and eventually page turns. In the waist, Stages 3 and 4 hold none at all. They are mathematics over springs.

Compilers are built the same way, with the knowledge of the language in the front end, the knowledge of the machine in the back end, and a clean intermediate form between them. In Ooloi that form is the stack summary: a handful of numbers per bar that never change underneath the breaker. Taste reaches the waist only as numbers, and musical structure only as cost, never as procedure.

What the waist forbids matters most: there are no correction passes. Every horizontal rule reaches the breaker in one of four forms (an ideal width, a blocking width, a constraint spanning several gaps or a difference at a break), and the springs combine them the same way every time. Nobody has to write the formatter for an accidental, a grace note, a clef change and a repeat barline that happen to meet at a system start.

A greedy breaker commits to each system before it has seen the rest of the piece, so whatever depends on the whole, such as a full last system, can only be put right afterwards, by a correction step or by hand. Spacing has its own version: a system that comes out too wide, or with a collision, has to be re-spaced and tried again. Dorico distributes a remainder at the end of each flow; MuseScore re-spaces an overfull system with its paddings reduced in steps. Each is a sensible answer to the problem greedy filling poses. In Ooloi both kinds of correction disappear, for two reasons. The exact breaker sees the whole piece before it decides anything, so nothing is left over to redistribute. The springs carry every collision inside the model, so no system ever needs re-spacing.

Much follows from that one prohibition. The same music always gives the same page, on every machine and after any history of edits. A dragged note is stored as a change to its springs, not as an offset, so it survives every recomputation. 'No collision at any feasible ratio' becomes an invariant that can be tested. Settings stop being choices between rival heuristics; they become parameters of one model, and compose instead of colliding. And every task that remains, from tuning a value to supporting a new kind of notation, comes down to giving the one model better input, never to teaching one more formatter about all the others.

Correction passes are where layout code grows old. Each is written for a case someone noticed, each can disturb what earlier ones arranged, and none can safely be removed, so they accumulate for as long as a program lives. Not needing them at all is the quiet difference underneath everything else in this post.

The knowledge of engraving has moved upstream and turned into data: tables and outlines rather than procedures. That's what makes it inspectable, and what lets a stranger rebuild the waist in another language in an afternoon.

​The Tablets Along the Path

Picture

​ADR-0055 lists twenty-two open questions about horizontal spacing, and none of them is a research problem. Each has a known shape, and the architecture already says where its answer goes: a value in a table, a cost in a dynamic program, or a parameter of the springs. Most are values to be measured from printed plates; some are matters of taste that should simply become settings. A few questions, some from that list and some beyond it, deserve a tablet of their own.

Page turns. This is the delightful one. Once page breaking is written down it's almost a pleasure: hard breaks partition the work, repeats and rests become costs at the boundaries, odd and even pages join the state, and the program over a part is tiny. The catch is architectural. Stage 6 can only choose among the system breaks Stage 3 has already made, and a turn in a rest needs a system break at that rest. The two are kept apart because heights aren't known until Stage 5, a reason that is strong in a full score and weak in a single-stave part, whose heights are nearly predictable. Parts are exactly where page turns matter, so for parts I'm inclined to let systems and pages meet, using conservative heights derived from Stage 1's outlines, which keeps the result exact for those heights and never overflows a page. Full scores can keep the separation.

Lyrics. A long syllable over a melisma spans several gaps, and the baseline turns it into minimums on the individual gaps before breaking. Under compression that can hold back up to a quarter of their spare room beyond what the syllable needs, which in a choral score could cost a system now and then. The exact form of the reduction uses machinery the springs already have, and for vocal music I lean towards making it the default.

Drags. Dragging a note in a tightly compressed system moves it very little on screen while storing a large change to its springs, because there's so little room left to give. If the music later reflows into a loose system, a nudge of a fifth of a stave space can turn into three stave spaces. The stored change is right in principle, but the amplification near the collision limit needs a rule of its own.

The anchoring duration. ADR-0055 starts from LilyPond's way of choosing the value around which spacing is built: the most common shortest note per bar across the piece. That statistic can flip when a single bar changes, and then a whole section is re-spaced. It's a second source of wind, upstream of the breaker, and it wants hysteresis or a value the user can pin.

Open metre. Systems currently break only at barlines, and music without them needs breaks inside long bars. The mathematics extends without strain, but it isn't specified yet.
​
None of these is a cliff. Straightforward isn't the same as small, though. Measuring the plates is slow, careful work, and it's where the quality will actually be seen. The breaker decides where lines end; the tables decide whether the page is beautiful.

​The Frost Troll

Picture
Somewhere on the upper slopes a frost troll waits for anyone who has underestimated the climb. I've found that simply running past it avoids the entire fight.

That is the deepest habit of this architecture. Immutable data and a one-way flow don't win the battles other programs fight every day, with state that changes underneath them, caches that must be invalidated in the right order, and layouts that negotiate with themselves until they settle. It runs past them. Those fights never start.

The troll will still try to make me stop. One day a page of Ligeti's Requiem will come out wrong, and the quickest fix will be a small nudge after the springs have done their work, just this once. That is exactly the moment to keep running: back upstream, to better input for the one solver. ADR-0037 already says so: a rule that fits none of the four forms is a design problem to be solved, not a pass to be added. Keep to that, and the engine stays as clean in its fiftieth year as in its first.
​
The steps have been counted now. The results are encouraging. But that isn't the same as climbing them.

12 Comments

High Hrothgar

12/10/2026

8 Comments

 
Picture
In Skyrim, there's a monastery just below the summit of the Throat of the World, the tallest mountain in the land, and the only way there is on foot. The path is called the Seven Thousand Steps. It starts in a small village called Ivarstead and climbs through pine forest into snow, past stone tablets that tell the story of the place, into a wind that gets worse the higher you go. Somewhere on the upper slopes a frost troll waits for anyone who's underestimated the climb. The name of the monastery is High Hrothgar.

At the top live the Greybeards. They are masters of the Voice, the Thu'um, the ancient art of speaking words so charged with power that they move the world. The Voice is spoken in the tongue of dragons, a language almost no one outside the monastery understands. Their own voices are so strong that they almost never use them: one of them, Arngeir, speaks to visitors on behalf of the rest, and the others keep silent. They take no part in the affairs of the land below. Wars come and go, dragons return to the skies, and the Greybeards go on meditating, keeping what they know for the few who make the climb and prove equal to it.

It's a game, but the image has stayed with me all week. It describes, more exactly than anything I could have invented, where the deepest knowledge of music engraving has lived for the last thirty years.

​The Monastery

Masters of the Voice, guarding its secrets on a mountain: you could hardly ask for a better image of the people who know how music should be laid out on a page. Never mind what the notes are, which is the composer's business; the question is how they share out the width of a line, where each line should end, and why a well-engraved page can be read at a glance while a poor one makes the player work for every bar. Those are the real secrets of engraving, and they're mostly invisible. When they're kept, nobody notices anything at all.

In the world of notation software, the monastery is LilyPond. Over three decades its makers have assembled the most serious body of engraving knowledge any program possesses, much of it traceable to a handful of academic papers from the 1980s, and built it into a program whose output a great many musicians regard as the nearest thing the field has to a grail.

The Seven Thousand Steps are real too. To engrave a piece in LilyPond you don't place notes on a page. You write the music out as text, in a syntax of its own that has to be learned, and hand the whole thing to the program, which works through it in one go and returns finished pages. If you want it to do something differently, you have to speak the monastery's own dragon language, Scheme: a dialect of Lisp, one of the oldest families of programming languages, famous for its thickets of parentheses and impenetrable to most outsiders. Nothing answers you while you work. You write, you wait, you look.

I want to be fair to the mountain, because the analogy invites a sneer it doesn't deserve. The steps are no affectation. A program that is given the whole piece at once, and allowed to take its time, can afford to consider every way of laying it out and choose the best. That is exactly what makes its results what they are. The climb is the price of the view.

​The Valley

Most musicians stay below, and so do most notation programs. Down in the valley a program has to answer as you work: you enter a note and the page changes in front of you. That leaves no time to reconsider the whole piece after every keystroke, so the programs of the valley fill each line as they go, bar by bar, move on when the next bar won't fit, and make the best of whatever they've been left with. Dorico, which takes engraving more seriously than most, works this way, and its developers have said openly why: the careful method was evaluated and found too slow for a program that must respond in real time. Most of the time the results are very good. The rest of the time the engraver finishes the job by hand.
​
So the field has divided along the mountain's flank. Up there, the beautiful results, for those who make the climb. Down here, the convenience, at the cost of a little beauty and a good many afternoons spent correcting. Hardly anyone has said outright that it must be so, but everything has been built as though it were. The knowledge of High Hrothgar, the assumption goes, can only be practised on High Hrothgar.

The Path Up

Until a few days ago Ooloi would have been counted among the valley programs, if it was counted at all. It's an interactive program, after all, and that seemed to settle which side of the mountain it belonged to.

It doesn't any longer. I've decided that Ooloi will lay out its music by the method Wael Hegazy and John Gourlay described in 1987, in the paper Ulrik Bodén tracked down for me and which I wrote about in the last post. It's the same text LilyPond's teaching grew from, and I'm taking it in its original form: the whole piece considered at once, and the best layout found exactly. ADR-0037, which specifies Ooloi's line breaking, has been revised accordingly, and a new decision record, ADR-0055, now describes how the music is prepared for it. The details are there for anyone who wants them; this post isn't the place.

That puts Ooloi in the mountain's lineage. It doesn't put it anywhere near the top. LilyPond has thirty years of practice behind its answers; Ooloi has a decision and a specification. The monastery's knowledge was earned slowly, and I'm a newcomer at its gate with a borrowed book. I do at least speak a dialect of the language. Ooloi is written in Clojure, which is also a Lisp: I speak Dragon. This is perhaps not a coincidence.

Down the Mountain

Knowledge that stays on the mountain is only half useful, though. The real question, the one this whole project keeps returning to, is whether it can be brought down: whether a program that answers as you work can produce what has so far only been produced at the summit.

Ooloi takes its name from Octavia Butler's Xenogenesis trilogy. Butler's alien Oankali have three sexes, and the third, the ooloi, can perceive and rearrange the living matter of other creatures. They take genetic material from different lineages and combine it, by instinct, into children that neither parent could ever have produced alone. Nikanj, the ooloi at the heart of the first novel, does exactly this with humans.

That's the most honest way I can describe what I'm attempting without a single formula. Ooloi takes the mountain's DNA, its knowledge of how music should be spaced and where lines should break, and combines it with the valley's: a program that answers as you work. If it works, the child will be neither LilyPond made faster nor Dorico made more careful, but something neither lineage could have become by itself.

Speed has very little to do with it. Computers have been fast enough for this for decades. What makes the crossing possible is the way Ooloi has been built over the last two years, for reasons that had nothing to do with engraving: by the time layout begins, every bar has been reduced to a handful of numbers that will never change underneath it. The monks' long contemplation of the whole piece becomes a short piece of arithmetic, quick enough to repeat after every note you enter. The last post was about that, under Horace's motto: all the footprints lead one way, and none lead back.
​
(There's also a Dragonborn in the story, a mortal who learns in days what the Greybeards needed lifetimes for. I'll resist that one.)

On the Mountain

​There's another way to read the picture, and it would be dishonest to leave it to the comments.

A man working alone for two years on foundations nobody can see yet, refusing to show anything until it's right, measuring himself against a fifty-year horizon: that isn't a portrait of the valley. 'Nun denn, allein!' could have been carved over the door of High Hrothgar. If anyone in this story is living on the mountain at the moment, it's me.
​
The difference, I hope, is the direction of travel. I'm up here so that what gets built can be used down there, by someone who has never heard of Gourlay and never will, and who simply wants a part whose page turns fall in rests. Whether that works isn't something a blog post can settle. None of it is built yet. Everything I can see suggests the architecture will allow it, and the judges will be the printed pages of the great engraving houses, not my hopes for them.

'Come Back in a Year'

Almost exactly a year ago, people on various forums were asking when they'd see Ooloi render any notation, and I answered in a short post called 'Where's the Music?'. Not yet, I wrote: foundations first. Come back in a year, and the conversation will be about music by then.

The day after, in 'The Lineage: When Ledger Lines Shorten', I wrote that reading LilyPond's essay on engraving had made me realise we came from exactly the same place. I had no idea then how literally that would turn out to be true.
​
Here we are, two weeks early. 'Boxes & Glue', 'Vestigia Nulla Retrorsum' and this post deal with the very heart of engraving: how a line of music shares out its space, and where it should end. Together with ADR-0037 and ADR-0055, they say everything you need to know to understand what Ooloi is aiming for and how it means to get there.

​The Trade

Butler's ooloi aren't comfortable creatures. Their trade is seldom asked for, and the humans they trade with don't come through it unchanged. The engraving version is gentler. LilyPond will go on compiling on its mountain and Dorico will go on answering in the valley, exactly as before; nothing is taken from either that doesn't remain where it was. Only the child is new.

Dawn, the first volume of Butler's trilogy, was published in 1987, the same year as Hegazy and Gourlay's paper. That's a coincidence, and I won't pretend otherwise.
​
But Nikanj would have approved.
8 Comments

Vestigia Nulla Retrorsum

10/10/2026

5 Comments

 
Picture
The paper is here. 'Optimal Line Breaking in Music', by Wael A. Hegazy and John S. Gourlay of the Ohio State University, 1987: fifteen typed pages, scanned from somebody's reading copy, complete with underlinings and a few pencilled notes in the margins. It's out of print and it isn't online, and I'd been looking for it far and wide. In the end Ulrik Bodén, owner of Musikboden and one of Ooloi's sponsors, tracked down a copy and sent it to me. Once again the small circle of friends around this project has done what searching couldn't, and I'm very grateful. Under the last post, Magnus Johansson asked whether I'd had the chance to study it yet. I have, and this is what I found.

First, a word about how I look at other programs, since several of them appear below.

I don't run Dorico, MuseScore or LilyPond, and I don't intend to. That isn't disdain. I read what can be read: source code where it's open, development diaries where their authors have published them, forum posts where a decision has been explained. I read them as I read the source of gRPC or the JVM, to understand how something was built and, above all, why. What I don't do is examine the latest release to see what I'm up against, because I'm not up against anything. Ooloi isn't a feature race. I'm trying to build an engine for music notation in which the difficult parts are dealt with underneath, once and properly, so that whoever builds on it doesn't have to. If it works, it'll be because of what Ooloi is rather than what it does.

Casting off and horizontal spacing are where reading other programs is most illuminating. Casting off is the engraver's term for deciding where each system ends; horizontal spacing is how the notes within a system share out its width. Between them they decide whether a page reads evenly or lurches, and whether the last system of a movement is full or holds two forlorn bars. A player takes all of that in before reading a single note. Every notation program has to answer the question, the answers differ, and the reasons for the differences say a great deal about the architectures behind them.

The Other Ninety Per Cent

In September 1985 Jon Bentley's Programming Pearls column in Communications of the ACM collected a page of programmers' aphorisms. One of them, credited to Tom Cargill of Bell Labs, has outlived most of the others: 'The first 90 percent of the code accounts for the first 90 percent of the development time. The remaining 10 percent of the code accounts for the other 90 percent of the development time.'

Engravers have their own version. Notation software handles about 95% of engraving well, and engravers spend about 95% of their time on the remaining 5%. Those figures are practitioners' experience rather than measurements, but anyone who has prepared parts for a performance will recognise the shape. The afternoon goes on forcing system breaks, prising collisions apart, and recasting a part so that the page turns fall in rests.

The two rules describe the same remainder from opposite ends. The cases a developer leaves unfinished, because they belong to the last 10% that would take the other 90% of the time, are precisely the cases the engraver then finishes by hand. Shipping at the 90% mark doesn't make the remaining work go away. It passes it on to the users, multiplied by every user and every score.

That's a tax, and like most taxes it's paid continuously by people who never voted for it. Ooloi is in large part an attempt to abolish taxes of this kind wherever the architecture allows, from undo to collaboration. The engraver's 5% is the largest of them.
​
I should be fair here, because it matters. Doing 95% well might genuinely be good enough for most people's music. In December 2016 Daniel Spreadbury wrote that Dorico's casting off, tested against the Gourlay method, 'produced very similar results a lot of the time'. That's the 95% working exactly as designed. The 5% is where it doesn't, and that's where the engraver's afternoons go.

Knuth & Plass, Briefly

I wrote about the algorithm in 'Boxes & Glue', so a reminder will do. In 1981 Donald Knuth and Michael Plass published the line breaker that TeX still uses. A paragraph is a row of boxes (the words, which are rigid) with glue between them (the spaces, each with a natural width and a given capacity to stretch and shrink). Any choice of breaks gives each line an adjustment ratio r: the stretch or shrink the line needs, divided by the stretch or shrink its glue can supply. So r = 0 is a line at its natural width, r = 1 is a line stretched as far as its glue is meant to go, and r = −1 is the tightest line TeX will set.

Knuth turns r into badness, roughly 100 × |r|³, and badness into demerits, (l + b)² + p², where l is a small charge for every line and p the penalty attached to the break. Then he finds the set of breaks with the smallest total for the whole paragraph. The cubes and squares mean that one very bad line is punished far more than several slightly imperfect ones, which is exactly the judgement a good compositor makes.

What makes it fast is dynamic programming. The program walks through the paragraph once and, at each possible break, remembers only the best way of getting there. If the cost of a line depends on that line alone, nothing more is needed: when the walk reaches the end, the best layout of the whole paragraph is recovered by following the remembered steps backwards. The result is exact, meaning provably the minimum of its cost rather than a good guess, and the work grows with the number of possible breaks times the number of words that can share a line.
​
The alternative, and still the usual one, is greedy filling: put bars on a system until the next one won't fit, move on, and never look back. It's quick and it's local, and the bill arrives at the end of the piece.
Picture

What Hegazy and Gourlay Actually Wrote

As far as I can tell, nobody has described this paper in public. LilyPond's source names it as the origin of its first line breaker, and Daniel Spreadbury has said it informed Dorico's casting off, but I've found no account of what it actually contains. ADR-0037, which specifies Ooloi's breaker, cited it while admitting that it described none of its contents. That ADR has now been updated with a description along these lines.

The paper opens by explaining why music isn't text. The last system of a piece is always full, so a copyist has to be prepared to revise early breaks that don't lead to a full last line, and a program must be able to do the same or it'll stretch the last system grotesquely. Long works should also fill their last page, which sometimes means forcing a particular number of systems. Clefs and key signatures repeat at the start of every system, and they change, in content and in width. Most important of all, notes don't move linearly when a system is stretched or squeezed.
​
The state of the art, they note, offered little help. Byrd's 1984 thesis program did first-fit breaking, which is greedy filling by another name, and expected users to choose their own breaks. Ross's engraving manual advised avoiding bad breaks and keeping the spacing uniform. 'There appears to be no published algorithm', they write, that attempts to deal with these problems at all.

Their claim is that Knuth's model already handles the first three. A paragraph with no fill glue at its end gets a full last line automatically. Penalties encourage or discourage particular breaks, which is how a performer's awkward page turn can be avoided. TeX can be told to use a set number of lines. And TeX's discretionary breaks, the mechanism behind hyphenation, can change what's printed at the end of one line and the start of the next. Only the fourth problem needs new theory.

That theory is the paper's real contribution, and it's lovely. Think of the space between two notes as a spring. In text the springs join the outsides of rigid boxes. Hegazy and Gourlay pass the springs through the boxes and attach them to the left edges of the noteheads, because what the eye measures is the distance from one note to the next, not the white space between their shapes. The boxes still can't pass through each other, though. A note and the accidentals of the note after it take up room, and when those shapes touch, the spring between them can shrink no further.
Picture
So each gap carries four numbers: an ideal width w, a stretchability y, a shrinkability z, and a blocking width b, the width at which the shapes on either side collide. Under a force f, which is Knuth's adjustment ratio under another name, positive to stretch and negative to compress, the gap's width is the larger of two quantities:

width = max(b, w + f·k), where k is y when stretching and z when compressing.

Read as a musician: the spring tries to be its ideal width plus whatever the force asks of it, but never narrower than the collision allows. Read as a mathematician: each gap is a piecewise-linear function of the force, and therefore so is the whole system.

The interesting case is the one where b exceeds w, which they call 'prestretched'. Their Figure 1 shows it: a note preceded by two flats so wide that the gap before it is already larger than its duration warrants. That gap doesn't move at any line length until the force on the rest of the system has caught up with it; only then does it begin to grow with the others. The accidental takes the room it needs and not a hair more, and once the system is loose enough it costs nothing at all. That's exactly how an engraver treats an accidental.
Picture
The consequence for breaking is that the force needed to fit a system is no longer a single division, as it is in TeX. It's the solution of a piecewise-linear equation whose kinks lie wherever an individual gap collides or begins to stretch. The search around it is Knuth's, which they say 'does not differ in any significant way' from TeX's: remember the best predecessor for each barline, discard lines whose force falls outside a permitted window, and trace the optimum backwards from the end.

Their efficiency section is the most telling part of the paper, because they never treat the dynamic programming as the expensive part. The expense lies in working out the force for each candidate system, and they attack it twice. First comes a cheap lower bound on the force, built from running totals: 'the sums are computed from the beginning of the piece to the current place, and two such sums are subtracted to obtain the sum for what lies between them'. Programmers call these prefix sums. The bound is designed so that it can never wrongly reject a system that would fit. Second comes a fast path for the common case, in which the force stays on the first straight segment of the curve, before any gap has collided. They test for that with minima precomputed for each bar.

Their evidence is modest and well chosen. They broke a 48-bar piece on a single stave, Dean K. Roush's 'Lacrimosa', into systems. The breaks matched those chosen by a professional musician, who had spent a few hours on it. The program took a few seconds on a personal computer of 1987.

So is it Knuth–Plass? Not purely. The search is Knuth's without his fitness classes, which TeX uses to stop a tight line from sitting next to a loose one, at the price of extra bookkeeping. The cost is shaped like TeX's but never written down as a formula. And the model of a line is a strict generalisation of boxes and glue: TeX's glue is the special case in which nothing ever collides.
​
But it isn't approximate either. The cost of each system depends only on that system, the pruning is sound, and the cheap bound never discards a line that would fit, so the result is the exact optimum of its own cost. Nor do the modifications reduce the efficiency of the algorithm. The dynamic programming is untouched; what grows is the arithmetic inside the evaluation of a single system. What Hegazy and Gourlay did to Knuth and Plass was extend them.

The Descendants

Three documented lines of descent made three different choices, and in each case the authors have said why.

LilyPond's first line breaker, gourlay-breaking.cc, says in its source that it was 'adapted from the OSU Tech report on breaking lines'. It was a straightforward dynamic program until October 1999 (release 1.2.14), when a term comparing each system with its predecessor was added for the sake of evenness. With only one predecessor stored per breakpoint, that made the result an approximation of its own cost, and the term survives in LilyPond's current breaker. LilyPond's spacing, which I'll come back to, is solved afresh for every candidate line. Han-Wen Nienhuys, who wrote the original breaker, commented in 2015 that he'd first run it on a 386 at about 40 MHz, where 'it was somewhat expensive'; that computers had since become a hundred times faster; and that you have to solve 'O(#bars * #bars-per-system) spacing problems'. He thought it could be used for interactive scores too.

Dorico's team evaluated the Gourlay method early on. In 2015 Spreadbury set out the reasoning in his development diary. A program that compiles its output from text input needn't respond in real time, but for an interactive one 'a compromise is needed in order to balance the quality of the result against the time taken to compute it', and Dorico's principle was to 'always do only the minimal amount of recalculation to respond to an edit'. In December 2016 he wrote that the method's performance characteristics weren't suitable for Dorico's real-time use, and that Dorico's own algorithm 'basically runs only one way, from the start of the layout to the end'. In April this year he confirmed that the paper had informed Dorico's casting off, which is greedy, with a separate remainder-distribution step at the end of each flow. That remainder step deals with the full last system, the first of the four problems Hegazy and Gourlay listed in 1987.

Others claim the full prize. Christof Schardt, the author of PriMus, wrote in 2015 that PriMus had used TeX's total-fit algorithm, 'modified for scores instead of text', interactively for over ten years, taking collisions into account 'by an equivalent linear operation'. Basil Crow's open-source Neanes editor does optimal line breaking for Byzantine neume notation. I haven't checked either at source.
​
None of this is a league table. Each choice was rational under the constraints its makers had, and Spreadbury's 2013 statement of Dorico's ethos, that the application should do 'automatically what an experienced engraver or copyist would do anyway', is one I'd sign without changing a word. The goal is shared. The constraints aren't.

Speed was Never the Obstacle

Put the dates side by side. In 1987 an exact optimum over a nonlinear spring model ran in seconds on a personal computer. In 2015 the author of LilyPond's first breaker, who had run it on a 386, reckoned that machines a hundred times faster could manage it interactively. Processor speed hasn't been the obstacle for a very long time.

What costs something is evaluating each candidate system, and everyone who has looked closely puts the cost there: Hegazy and Gourlay in 1987, Han-Wen in 2015. Hegazy and Gourlay's remedies, the running totals and the per-bar minima, rest on an assumption so basic they never needed to state it, which is that each bar's numbers are fixed before breaking begins. They could assume it because their input was a single stave, handed to the program as a ready-made sequence of springs.

A notation program has to manufacture that input from a full score, and this is where architecture comes in. Suppose a candidate system's width depends on which bars share it, or on something settled only after the breaks are chosen: the courtesy accidentals at a system start, an accidental decision that changes when a tie crosses a break, spacing that's adjusted and then fed back. Then every candidate needs its own spacing calculation. In a mutable, incremental program, every moved break also invalidates whatever was computed downstream of it. A global optimum, where one edit can move breaks anywhere in the score, then becomes the most expensive thing you could possibly ask for, and greedy filling is the sensible choice.
​
I can't see inside anyone else's program, so take this as my reading of the problem rather than a finding about any product. But it's consistent with everything their authors have said, and it puts the obstacle where the 1987 paper already implied it was: in the data, not in the processor.

Vestigia Nulla Retrorsum

Ooloi lays out a score in six stages, and information moves through them in one direction only.

Stage 1 works on every bar in parallel. It forms the atoms (a note or chord with its accidentals, dots and articulations, handled as one unit) and traces their outlines from the font, the shape each presents to its neighbours. Stage 2 lines the staves up vertically and works out, for every gap, both its ideal width, which comes from the durations, and its minimum, where neighbouring outlines would touch, so that each measure stack (one bar across all the staves) leaves it as a handful of numbers. Stage 3 breaks the systems. Stage 4 positions the atoms. Stage 5 draws what connects them, the ties, slurs, hairpins and beams, and works out how tall each system is. Stage 6 breaks the pages.

Nothing flows back. Stage 5 can't ask Stage 3 for more room, and Stage 3 can't reopen a decision made in Stage 1. The musical questions, such as which accidentals a note needs, are closed before layout begins, so layout can't change them. Everything Stage 3 needs is known before it starts, including what each bar would require at the start of a system and at the end of one.
​
The pipeline has a motto, borrowed from Horace. In the first of his Epistles (I.1.73–75) a fox declines the sick lion's invitation into its den and explains why: 'quia me vestigia terrent, omnia te adversum spectantia, nulla retrorsum'. The footprints frighten me: they all lead towards you, and none lead back. In the fable that's a warning; in a layout pipeline it's the design. Every footprint points forward, and that single property is what turns casting off from a negotiation into arithmetic.
Picture

Arriving at the Same Place

Ooloi’s breaker, specified in ADR-0037, was written from Knuth and Plass directly, before I’d read a line of Hegazy and Gourlay. Reading them now is a curious experience, because the search is the same. Both remember one best predecessor per barline, with no fitness classes. Both subtract running totals between barlines, and both stop extending a candidate system as soon as more bars can’t possibly fit. Their per-bar minima, used to test whether a line has reached its first collision, correspond to a number every Ooloi measure stack carried until now: its tightest gap’s ratio of minimum to ideal width, tracked as a running maximum while the candidate system grew.
​
The correspondence goes deeper than I expected. Until now, Ooloi’s baseline let every gap stretch and shrink in proportion to its ideal width, so each system had a single scale factor. It also calibrated the adjustment ratio so that r = −1 fell exactly where the tightest gap in the system reached its minimum, and allowed nothing beyond that point. In Hegazy and Gourlay’s terms, that was their model restricted to the first straight segment, before any gap has collided, with the force rescaled so that the first collision sits at −1.

I got there independently, but I don't think the convergence is remarkable. Both designs start from TeX, and both discover that the cost lies in evaluating a line; from there the problem pushes you towards the same answers. I find that reassuring rather than surprising.

Where Ooloi goes further, most of the reasons lead back to the direction of flow.

The first concerns system starts and ends. Hegazy and Gourlay pointed at TeX's discretionary breaks for the clefs and keys at each system start, and left it there. A discretionary has three parts: what's printed before the break, what's printed after it, and what's printed if no break happens. Ooloi's breaker has all three. A postamble holds what a system's end needs, which is the cautionary key and time signatures; a preamble and a gutter hold what the next system's start needs: clef and key, courtesy accidentals for tied notes, a start repeat. Everything else at a barline belongs to a bar, wherever that bar falls: the barline itself, as it looks at the end of a system, and a clef change drawn in front of it belong to the bar they close, and a new key or time signature to the bar it begins. The third part holds what exists only mid-system: the start half of a repeat barline, which at a break moves to the start of the next system, and the cancellation naturals of a key change, if the house style drops them at a system start because the previous system's cautionary has already shown them. Each is a fixed width at its barline, and the breaker subtracts those inside a candidate system with a single subtraction of running totals, so the result stays exact. All of it is known before breaking, because nothing downstream can change it.
​
This also matters for exactness. Hegazy and Gourlay's pruning is only safe because their systems carry no such material. Give each system start a width that varies from bar to bar and their pruning can wrongly discard systems that would have fitted. ADR-0037 prunes against the full system width instead, which stays exact.

The second concerns editing. A global optimum means that one edit can move breaks anywhere, which is why interactive programs avoid it. In Ooloi every stack's numbers are immutable and cached, so after an edit nothing upstream is recomputed except what the edit actually touched, which is usually the bar that changed. The new optimum is then found exactly from two stored tables, holding the best layouts of everything before the edit and of everything after it, in roughly K² evaluations, where K is the number of bars that fit on a system. That's a couple of hundred cheap evaluations, not a re-layout. Keeping breaks where they were while you work is a separate problem, and the ADR specifies mechanisms for it that are anchored to the identity of bars rather than to luck.

The third is determinism. Layout is computed once, by the authoritative backend, not separately by each client; but it still matters that the same music always produces the same layout. Everything is computed in exact rational arithmetic, and when two layouts cost exactly the same, which under exact arithmetic happens whenever bars are identical, the tie is broken by a rule that depends only on the layout itself, never on the order in which the program happened to meet the candidates. Re-optimising after an edit therefore gives the same answer as starting from scratch, undo brings back the identical layout, and a score opened on another machine looks the same there. Nothing on the page moves unless the music has given it a reason to, which removes a whole class of jitter at its source.
​
One further difference has nothing to do with immutability: Ooloi's cost is written down. It uses Knuth's badness and demerits with TeX's own constants as the starting point. That only works because the adjustment ratio is calibrated so that −1 means collision and +1 means a stated amount of stretch; without the calibration, TeX's numbers would mean something quite different for music. That one is simply care.

What Gourlay has that Ooloi Doesn't

The other direction is the more interesting one. Until now, ADR-0037 allowed four fitting rules, which are ways of deciding how each gap gives way when a system is looser or tighter than ideal. All four were linear glue: each gap stretches and shrinks in fixed proportion, and a system’s force is a single division. None of them could represent a gap that blocks while its neighbours carry on, and none could represent a prestretched gap at all. The ADR’s contract with Stages 1 and 2 actually forbade it, since every gap’s minimum had to be at or below its ideal.
​
And the case isn’t rare. The engraver’s principle is that everything belonging to a note, accidentals included, should fit within its proportional allocation: accidentals don’t add space. But a sixteenth’s allocation is around one and a half stave spaces, and a notehead plus a sharp plus clearance needs more than two. In any chromatic passage in sixteenths, a good share of the gaps have a minimum larger than their ideal. That’s Gourlay’s prestretched spring, and it’s what the decision below turns on.
​
All of this is easiest to picture on a single stave, but Ooloi doesn't space just single staves. Stage 2 aligns every stave in a measure stack on a shared vertical raster: one column for each rhythmic position that occurs in any stave, so that notes sounding together line up from the top of the system to the bottom. A gap in Gourlay's sense is the distance between two columns, and its blocking width is set by whichever stave needs the most room there. A sharp in the violas widens that column for the flutes as well.

What I Have to Decide

There are three ways to go, and each of them shows on the page. Take a bar of chromatic sixteenths, half of them carrying accidentals, as the running example.
​
  1. The first is to stay linear and have Stage 1 raise the ideal of such a gap to its minimum. The accidental then does add space, against the principle. When a system is stretched, the inflated gaps stretch in proportion, so bars with accidentals look looser than bars without them, for no musical reason. Worse, under the current baseline a gap whose minimum equals its ideal can't shrink at all, and one such gap blocks compression of its whole system. In chromatic music that would be most systems, and the breaker would be pushed towards looser systems, and more of them.

  2. The second keeps the raised ideal but gives each gap a shrinkability equal to its own room above its minimum, which was one of the fitting rules ADR-0037 already listed. Compression is then put right: the rigid gap stays where it is and its neighbours give way. Stretching is still wrong, because the raised ideal still stretches in proportion.​
    ​
  3. The third is to adopt Gourlay’s springs. The accidental holds its room until the rest of the system catches up, and then moves with its duration. Under compression, a gap with nothing left to give stays where it is, and the rest carry on giving. It’s what an engraver does, and the existing linear rules survive as alternatives, so nothing already specified is thrown away.

I have decided that Ooloi will adopt Gourlay’s springs, and ADR-0037 has been revised to specify them.
Picture
Picture
Will it make Ooloi slower? As with Hegazy and Gourlay, the dynamic programming itself doesn’t change at all: the same states, the same number of candidate systems, the same tables for re-optimising after an edit. What changes is the arithmetic inside the evaluation of a single candidate system, and only for the systems that need it. Compression is always a single division, exactly as before. So is stretching, until a gap held open by an accidental starts to stretch. Only then does the candidate take the slower path, in which those gaps’ kinks are kept in sorted order as the candidate grows and the force is found by walking them. That costs a handful of extra operations per kink passed, not a spacing calculation.

Those are precisely the systems the linear baseline spaced wrongly. The ones it rejected outright, frozen by a single gap that couldn’t shrink, now cost nothing extra at all. Stages 1 and 2 already compute every gap’s ideal and minimum, so nothing new is asked of them; each stack simply keeps a few sums and a short list of its accidental-held gaps. The result stays exact and identical on every machine, and nothing flows backwards. I’ll know the real cost when there’s a benchmark on chromatic material. Until then, that’s reasoning rather than measurement.

As I've decided to go with the springs, more questions follow.

The first is what r = −1 should mean. If each gap’s shrinkability is set to its room above collision, every gap reaches collision at the same moment, at −1, and TeX’s constants keep their meaning. But wherever long notes have more room than short ones, they give up more of it, and the rhythmic hierarchy flattens under pressure. If shrinkability is weighted by duration instead, short values compress and collide first while longer ones keep giving. That’s nearer to the way engravers describe their own practice, but −1 then needs another definition. The choice decides whether a tight system still reads as rhythm. I’m starting with the first, which is also LilyPond’s default and keeps compression a single division; duration weighting stays a candidate for the plates to decide.

The second is minimum distances that span more than one gap: a long syllable sung across a melisma, or material that crosses between staves. Gourlay’s blocking works between neighbours, so such constraints have to be reduced to minimums on adjacent gaps before breaking. LilyPond’s spacer shows how: a minimum distance spanning several notes becomes a blocking force on every spring beneath it, at a small cost in density that a comment in its source considers acceptable. Since that force depends only on the springs inside the span, it can be worked out before any break is chosen, and that’s the reduction ADR-0037 now specifies, in Stage 2. So Ooloi doesn’t need the per-candidate spacing calculation that LilyPond chose to pay for.

The third is what the raster should do with the room. Take two staves of sixteenths in the same stack, some notes carrying accidentals and some not, in different places in each stave. One answer is that every sixteenth in the bar sits at the same distance from the next, so the rhythm reads as a regular grid and every column gets as much room as the most demanding one. Another is that each column takes only what it needs, so a column with an accidental in any stave is a little wider and the rest a little narrower: more economical, less regular. Gourlay's springs give a third answer that moves between the two. Under pressure the columns differ; as the system loosens, the columns held open by accidentals stop growing while the others catch up, until at some point the grid is even again. Which of these an engraver would choose, and at what degree of tightness, is a question for the plate.

A related case shows what's at stake. Take a bar that opens with a half note, continues with eight thirty-second notes and ends on a quarter. Logarithmic spacing already gives the thirty-seconds far more room than strict proportion would, and with their beams, stems and perhaps an accidental or two they may need more still. The half note and the quarter, on the other hand, are mostly air. An engraver lets them pay: the run of thirty-seconds gets the room it needs, and the long notes give some of theirs back.

Proportional scaling can’t do that. Every gap shrinks by the same factor, so the thirty-seconds reach their minimum first and the whole system stops compressing while the half note still has room to spare. Shrinkability bounded by each gap’s own room, the second option above, does let the long notes give way, and Gourlay’s springs do it as a matter of course: the thirty-seconds, with little or no room above their minimum, give up little or nothing, and the half note and the quarter absorb the rest. This is also where the weighting question gets interesting. ‘Shorter values compress first’ sounds right until the shorter values have nowhere left to go; beyond that point the blocking decides, not the weighting.

What none of this decides is who pays. Gourlay's force is one number for the whole system, so the cost of the thirty-seconds is spread over every gap in it, including a half note three bars away. An engraver might prefer the half note in the same bar to pay, and leave the rest of the system alone. That's a choice between consistency, where the same duration gets the same space across the system, and locality, where each bar settles its own debts. It belongs to the setting of ideal widths within a bar, before any fitting begins. In a full score it's subtler still: if the half note sounds against thirty-seconds in another stave, the raster has no half-note gap to shrink at all.
​
All of this sits beside two questions ADR-0037 already left open. One was whether to add a term for evenness between neighbouring systems, as TeX does with its fitness classes. I’ve decided against it. The cubic badness already punishes an extreme system out of all proportion, so under an exact optimum a cramped system survives next to a loose one only when every alternative costs more. And a comment in LilyPond’s source warns that such a term can make cramped lines more cramped where the music grows gradually denser. Music changes density for reasons of its own, and the layout shouldn’t pretend otherwise. The other question, how page breaking and with it the page turns in parts should be costed, remains open.

How the Others Answer

​Each of the programs I've read has answered these questions definitely, and since I read rather than run them, what follows comes from their source and their documentation. It describes how they work, not how their pages look.

LilyPond's answer is the closest to Gourlay's, more literally than I'd realised. A spring in its spring.cc has an ideal length, a stretch, a compression and a minimum, and its length under a force is the larger of the minimum and the ideal plus the force times the flexibility: Hegazy and Gourlay's formula, prestretched springs included. By default a spring compresses by exactly its room above its minimum, which is the second option above, and a note's stretch is proportional to the space between bare noteheads, so the air stretches and the ink doesn't. In the bar with the half note and the thirty-seconds, the half note therefore takes most of any stretching and most of any compression, because it has most of the air. Durations are spaced from the most common shortest duration, each doubling adding a fixed increment of about a notehead's width, and each column takes the shortest duration sounding in it.

MuseScore, in its current source, derives each note's natural width from its duration on a logarithmic curve: every doubling multiplies the space by a factor, 1.5 by default, starting from 3.5 stave spaces for a quarter. Where a collision demands more room, the extra is spread over the preceding notes rather than piled into one gap. When a system is justified, its notes act as springs whose stiffness comes from their durations, and a note already widened by a collision doesn't stretch until the force reaches it, which is the stretching half of Gourlay's model. Compression works differently: a system that is too wide is re-spaced with paddings and duration spacing reduced in steps, and as a last resort collisions are accepted. Bars are added to a system until the next one no longer fits at its natural width, and the system is then stretched to the margin, as its handbook also describes.

Dorico's documentation says less about mechanism, but two things are on record. In 2015 Spreadbury described forming a column for every onset across all staves and giving it the value of the shortest note sounding there, the same raster as Ooloi's, and spreading surplus space as 'a tiny fraction of a space to each column', in contrast to the hand engraver's habit of giving it to the longest notes first. Its current layout options include a minimum space for short notes, which is the thirty-seconds' case, and a choice, when justifying, between 'actual widths', which count accidentals and dots, and 'ideal widths only', which count the notes. That last option is, in effect, the question of whether accidentals add space, offered to the user as a setting.

None of it will be settled by argument. Ooloi's Vorbilder, the models it measures itself against, are printed pages from the great engraving houses, made by people who did this by hand for a living, and that's where the questions will be settled: on material chosen for where the 5% lives, such as chromatic passages, vocal scores heavy with lyrics, tight orchestral pages and parts with page turns. The measure is how many interventions it takes to reach the layout an engraver produced by hand. That number is the tax. And when I start showing pages from Ooloi, I'll set them beside printed music, never beside another program's output, however anonymised.

Coda

'Boxes & Glue' ended on a thought I hadn't finished: that the space after a whole note and the space after a sixteenth want different things, that each might have its own idea of how far it will stretch and how far it will give, and that this seemed very close to how a human engraver reasons about whitespace.
​
The thought is thirty-nine years old. Hegazy and Gourlay had it in 1987. They passed the springs through the boxes, gave each one a point beyond which it won't give, and solved the result exactly on a machine any modern thermostat would outrun. What they didn't have was a full score reduced to numbers that couldn't change underneath them. But that's exactly what I've spent the last two years building, mostly without realising that this was one of the things it was for.
5 Comments

​Boxes & Glue

27/9/2026

3 Comments

 
Picture
Something's been nagging at the edge of my mind. Knuth–Plass, the algorithm that breaks TeX's paragraphs into lines, has been adapted for music at least once, by Hegazy and Gourlay, and I ought to look at what they did. If there's prior art, so much the better: that's a strength, and something to build on.

For musicians, the underlying question is an old one: where should each system end? A score has to be cut into lines, and where the cuts fall decides whether the spacing is even, whether a crammed system sits next to a loose one, and where a page can be turned. The simplest method, and a common one, fills a system bar by bar, moves on when the next bar won't fit, and stretches whatever is there to the width of the page. It's quick, it never looks ahead, and it leaves the engraver forcing breaks by hand. Programmers call this greedy filling, and it doesn't produce optimal breaks.

Knuth's algorithm, written for paragraphs of text, does the opposite: it weighs every possible set of breaks and picks the best. This matters because a player judges a page at a glance, before reading a note of it. And it's technical because that glance is decided here, in the model, long before anything is drawn.

The questions were harder to settle than I'd expected. Was Hegazy and Gourlay's algorithm, and whatever descended from it, really Knuth–Plass, or something merely inspired by it or adapted from it? If adapted, was it still provably optimal, as the original is? And had the real algorithm ever been used to engrave music at all?

The last question has the clearest answer: yes, in 1987. MuTeX, a master's thesis at Bonn by Andrea Steinbach and Angelika Schofer, set music with TeX's own glue and line breaking. The MusiXTeX manual later explained why that struggles: a line of text holds dozens of words and a system only a handful of bars, so the stretch piles up as gaps before the barlines.

Hegazy and Gourlay's paper, from the same year, isn't online, so exactly what they did I can't say. What can be read is its descendant, described in ADR-0037. LilyPond's first line breaker, written ten years later, names their report in its source as its origin, and it's a dynamic program in Knuth–Plass's family. Later versions added a term for the evenness of consecutive systems, judged against a single stored predecessor, which makes the result an approximation of their own cost rather than its exact minimum.

The other half of Ooloi's model, fixed space for clefs and signatures with one scale factor for everything else, is what Daniel Taupin, Ross Mitchell and Andreas Egler built into MusiXTeX in the mid-nineties. ADR-0037 now sets all of this out.

Ooloi's own algorithm had been specified as Knuth–Plass from the start. What I hadn't expected was that it could be aligned with the original exactly. The atoms are the boxes, the spacing between them is the glue, and Ooloi's baseline is simply the case in which every piece of glue stretches in proportion to its natural width. So I aligned it fully, down to TeX's badness and demerits, with TeX's constants as starting points, and it's optimal in precisely Knuth's sense: the dynamic program finds the exact minimum of its own cost. That turned out to have real advantages.

One of them I hadn't foreseen at all. Claude reasons far better about a forty-five-year-old algorithm, documented down to its last constant, than about anything bespoke. Once the cost had Knuth's shape, whole classes of question could be settled by reference instead of argument.

None of this makes the algorithm Ooloi's; it's textbook, and the ADR says so. What Ooloi supplies is the conditions it needs. Knuth's algorithm wants stable inputs, and by the time Ooloi's pipeline reaches the breaking stage it has them, because information only flows forward. It's fast for a related reason: the earlier stages have already reduced the music to a very small set of numbers, a handful per bar, which are trivial to process even when the score runs to 800 pages and is set in Valhalla. The best layout can be recomputed while you type.

For the person reading the part, the result should simply look right: systems evenly spaced from first to last, no cramped system beside a loose one, fewer breaks to force by hand. Stopping that layout from jumping about while you edit is a different problem, and the ADR deals with it in its own right.

The glue has a further implication, one I haven't finished thinking through. The space after a whole note and the space after a sixteenth want different things. One is mostly air and can give a good deal in either direction. The other sits close to its neighbour: squeeze it and rhythm becomes collision, stretch it and a beamed group falls apart. Under the glue model the space after each note can have its own idea of how far it will stretch and how far it will give, and the two needn't match. The system then stops giving way in simple proportion, and if Knuth–Plass does what it should, the breaks are still optimal.

​That seems to me very close to how a human engraver reasons about whitespace.
3 Comments

The Machinery of Taste

12/9/2026

7 Comments

 
In June I published a road map and claimed the list was plumbing, every line of it. It was. Networking, certificates, session persistence, collaboration state, window geometry: nothing on that list would ever appear on a page, and the whole argument for doing it then was that none of it would be sharing the desk when the page finally arrived.

That list is nearly spent, and what replaces it is a different kind of work:
Picture

Where things stand

Everything about a piece except the music itself can now be manipulated from the interface.

That reads like a summary. It's actually a precise statement, and it names a boundary the architecture drew long before this summer. Changes to the things that contain the music – musicians, instruments, staves, layouts, and a piece's own settings – announce themselves structurally the instant they happen, on every connected client. Changes to the music itself defer to the formatting pipeline, which is asynchronous and which doesn't yet exist. One side of that line is now complete, all the way up to the interface. The other is a routing-table entry with no producer and no consumer.

The summer went into the first side. Pieces open and save and close and reopen where you left them. Musicians and instruments are created, numbered, renamed, cloned, reordered and deleted by gesture, with the numbering falling out of the gesture rather than out of a dialog. Layouts assemble into scores and parts. A piece's settings live in a window of its own. A field refuses a value it cannot take, in the field you typed it into, in your own language. Every one of those acts is a single transaction, a single event, a single refetch, a single named step in the Edit menu, and the path is identical whether you are working alone or someone on another continent is working beside you.

The semantic model, in other words, finally has a surface. For two years it existed and could only be reached through tests. It can now be reached with a mouse.

Except for the music. Which is what the rest of the tickets are for:

Finishing what collaboration started

  • #136 — Authenticated piece collaboration
  • #229 — Standalone backend server application

The distributed machinery is proven. Two Oolois on two laptops, one hosting, one connected, editing shared state with undo reaching across the wire and respecting each other's work. What's missing is everything that governs who may do what: invitations, single-use tokens, deep links, JWT identity, role-based access, a host-side collaborator registry, and a piece picker that shows a guest their own slice of a catalogue rather than someone else's filesystem.

There's an obvious objection to doing this now. Collaboration is the exception. I fully expect the overwhelming majority of Ooloi users to run it standalone on one machine and never invite anybody to anything. Why finish the exception before the rule?

Precisely because it is the exception. Work that sits half-done at the edge of a system does not stay quiet. It surfaces as a special case in every subsequent decision, and it surfaces at the worst moment, which is when you're concentrating on something else. Finishing it now means never thinking about it again. When the engraving work begins, the access model will be behind me rather than beside me, and single-user operation will be what it already is architecturally: a collaboration group whose size happens to be 1.

A word about #229, because its title invites exactly the wrong inference. The standalone server isn't a second product. Not a separate edition, not a server variant, not a codebase carrying features the desktop application lacks. It's the backend half of ordinary Ooloi – the same backend, the same components, the same behaviour – packaged to run on its own: in the cloud, on a conservatory's machine, on a collaborator's laptop in another city. There's no new functionality involved. The administrator connects to it as a client, through the same authentication path as anyone else, which is the whole reason it comes after #136 rather than before.

The substrate

  • #7 — Plugin system.
  • #8 — Skija integration.

Ooloi 'eats its own soup'. The formatters that draw a page are plugins, on exactly the same terms as anything a third party might write: the same API, the same performance, the same access. There's no privileged internal path that the public one imitates. This is not a gesture towards openness; it's the mechanism by which engraving conventions stay arguable. If you disagree with how Ooloi slopes a beam or hangs a secondary, and the settings provided aren't enough or your formatting philosophy is different, you can replace the formatter, in whichever JVM language you prefer, and Ooloi doesn't notice the difference.

Which is why the plugin layer precedes the drawing. It also precedes MusicXML, because the importer is itself a plugin, and it'll be the first serious test of whether the plugin surface is genuinely sufficient rather than merely declared to be.

Skija brings Skia into Ooloi: the graphics engine behind Chrome, Android and Flutter, and the third incarnation of a lineage that runs back through AlphaMask to QuickDraw GX, which is where Igor Engraver began. I have written about that circle before. What matters here is narrower. Until Skija is in, Ooloi cannot draw anything at all. Not a stave, not a notehead, not the small music example that ought to sit inside a preferences dialog showing you what a setting actually does to the page. The layout windows currently open onto a considered and entirely empty surface. Skija is what fills them.

The page, assembled

  • #6 — Hierarchical rendering pipeline.

The full specification is in ADR-0028 and I will not rehearse it here. What's worth stating is the order of implementation, because it reads rather like a page assembling itself:

First blank pages. Then the text on them: titles, headers, footers, page numbers. Then systems, with their instrument names, brackets and braces. Then staves and their staff lines. Then the measures on those staves, which is where noteheads, stems, flags, dots and accidentals first appear.

And spanners last. Ties, slurs, hairpins, lyrics, ottavas, and above all beams, which are the hardest of them and the most revealing of a system's quality.

That sequence isn't an implementation convenience. It's the pipeline's own structure: everything that can be computed independently, computed first and in parallel, and everything that depends on final positions deferred until those positions are fixed. The page is built the way the architecture says a page is built.

The Turn

Here is what actually changes, and it's not the subject matter.

For two years an argument could be settled by running something. Does the traversal allocate? Measure it. Does the accidental algorithm handle a grace note at a barline under a hierarchical key override? There is a test, and it either passes or it doesn't. Determinism is a property you can demonstrate. When I wrote that two supposedly intractable problems had collapsed into ordinary algorithms, the claim was checkable, and anyone who doubted it could check it.

Nothing in the next phase works that way.

No test will tell me a beam slope is beautiful. No suite will fail because a slur's curvature is slightly graceless, or because the white space on a page reads as mean rather than generous. The machinery that has caught every error for two years is about to fall silent on precisely the questions that matter most, and the only instrument left is a musician's eye. Mine first. Then, with any luck, other people's.

And the ground underfoot isn't solid in the way the engine's was. Staff notation is roughly a thousand years old. Printed engraving as a craft is five hundred. The copperplate house styles I'm actually implementing are perhaps two hundred and fifty. Each layer left conventions behind. They don't agree with one another, and they don't always agree with themselves: Ross devotes some fifty pages to beaming and contradicts himself more than once within them, and where Ross and Gould differ, they differ because the profession differs. Bärenreiter is not Durand. Neither is wrong.

So the design consequence was settled in advance. Engraving rules live as editable data rather than as conditionals buried in source. House styles are configuration. Formatters are replaceable. Where taste genuinely differs, Ooloi takes a position and makes the position adjustable, because the alternative is to pretend a live craft is a solved one.

That's the work now: the objective machinery in service of something irreducibly subjective. It's the part I have been waiting two years for, and it's also the part where merely being right is no longer sufficient.

Tempo

A practical note. I've just begun a new client placement, with a complex system to get into production, and it's absorbing a great deal of attention. On top of that my AWS DevOps Professional certification is due for renewal, and I take the AWS exams seriously enough to actually study for them rather than turn up and hope. The next month or so will therefore be slower here than the last three have been.

This does not worry me in the slightest. The summer's pace was fast and, if anything, accelerating: subsystem after subsystem closed and stopped asking to be thought about again. The project's in a good place. A quiet month against that background is a quiet month, not a stall.

Coda

The anxiety inverts here, which I hadn't quite anticipated.

Invisible work fails by remaining invisible. You solve something genuinely difficult and it vanishes into infrastructure, and the better you have done it the less anyone can see. I have written about that loneliness before.

Visible work fails by being looked at. Every judgement I make about a beam, a slur, a page, will be in front of musicians who have spent their lives reading engraved music and who will know immediately, and without being able to say why, whether it's right.

I'd rather have that problem. It is, after all, the one I set out to have.
7 Comments

Politely Declined

6/9/2026

5 Comments

 
Above is a demonstration of how Ooloi handles wrong input. What happens is this:
​
  1. I remove the @ from a perfectly legal email address.
  2. Nothing happens until I leave the field or press Enter or Tab.
  3. At that point validation takes place, and the field is found to be illegal.
  4. It's coloured red, fading over ten seconds.
  5. An error notification appears explaining the error. It too fades after ten seconds.
  6. Most importantly, the erroneous value is restored to what it was before the edit.
    ​
So no setting can ever hold a wrong value except while it's being typed. The interface stays calm. You aren't prevented from leaving the field and you aren't boxed into a mode. Ooloi discreetly refuses the change, tells you why, and lets you carry on as you please.

The second video is for Andreas Kågedal, who spotted in the comments to the last post that the parts kept their old names after the musicians changed theirs. That turned out to be the last seam in the Piece Window's view of the semantic model, and it's now closed: the parts follow the musicians. A name you've typed by hand is left alone; empty the field and Ooloi refills it with the computed value.
​
With this, the Piece Window and its Preferences editor between them reach every aspect of the piece itself: creating, cloning, renaming, configuring, all by gesture, and not a dialog in sight.
5 Comments

We Have a Piece Settings Window

31/8/2026

5 Comments

 
The same string quartet as last time. I open the piece's settings, go to the Numbering tab, and move the numeral to the other side of the name. '1. Violin' becomes 'Violin 1' in the Musicians pane as I do it.

Which is what Magnus asked for in the comments to the last post. What's actually new here is narrower than it looks: the setting has existed for months. Numeral form, placement and full stop were specified, implemented, and held by thirty-seven tests, and nothing in the running program could reach any of them. A piece could be set to Roman numerals only from a test. The window is what makes the last unreachable part of the semantic model reachable by a person.

'1. Violin' is the German ordinal form and 'Violin 1' the Anglo-American one. Ooloi holds an opinion about neither.

The Accidentals tab goes past on the way. Pause there if you're curious.
5 Comments

Layout Windows and What Owns Them

29/8/2026

4 Comments

 
A short report from the workbench: the finer points of layout windows and how they relate to the piece window that owns them. What's happening in the video:
​
  1. I create a string quartet by first creating musicians for the two violins, the viola and the cello. Note how the violins are numbered automatically.
  2. I then create the score by dragging all the musicians onto the layout pane.
  3. A layout is created: I flip it open briefly so we can see the musicians inside.
  4. I then drag each musician across individually to create their parts.
  5. All of the above you've seen before: it's literally everything required to set up a complete score and its parts. However, what follows is new, and is what I've just finished.
  6. I select all the layouts and press Enter to open them. A double-click would have done the same for the entire selection.
  7. The layout windows open staggered, so you can see them all.
  8. I delete the cello part, and its layout window closes with it.
  9. Undo brings the cello part back: it returns to the list of layouts, and I can open it again.
  10. Finally, I click the piece window's close button.
  11. It asks for confirmation, the piece being unsaved.
  12. When I confirm, the piece window and all its open layout windows fade away simultaneously, as a single unit.

That last moment is the point of the exercise. A layout window isn't a free-standing window that happens to show part of a piece: it belongs to the piece. Ownership is why deleting a part closes its window, what undo restores, why Save acts on the piece a window belongs to rather than on whatever happens to be in front, and why quitting takes the whole workspace away and gives it back when the piece is next opened.

So the piece window is finished, down to the edge cases and the pace at which things appear and disappear. Later today I start on the Piece Preferences window, which follows the Application Settings window closely enough that most of the path is already trodden.

(Ignore the notifications in the lower right. They're for development.)
4 Comments

Preparing the Ground

27/8/2026

2 Comments

 
There is a Swedish expression, kratta manegen: literally, to rake the circus ring before the performance begins. Prepare the ground, clear away what shouldn't be there, make the arena ready.

For rather more than two years, that's what Ooloi has been doing.

This week I finally reached the place where I can open The Maids, double-click its score layout in the Piece Window, and watch a Layout Window appear. It contains almost nothing: a subtle background colour and a large, empty, scrollable surface.

Excellent.

This is where the music will be engraved. The rendering pipeline, spacing algorithms, geometric constraint solving, paintlists and Skija drawing will all end up here. The fact that the window is empty is precisely the point. Everything underneath it already exists.

I've also spent the past few weeks raking the arena in the other sense: finishing the Piece Window, completing undo and redo around its operations, tightening failure handling, localisation and editing behaviour, and removing the small architectural exceptions that would otherwise have followed us into the graphical work.

So here we are.

The ring is empty. The stage is set.
2 Comments

Cortisol Levels

21/8/2026

0 Comments

 
Claude has bad days. Today it really decided to dance naked in the crypt: three confident wrong answers in a row on the same question, a five-round verification apparatus I never asked for, a misdiagnosis it was fully prepared to act on. Hours gone. What irritates me is not the flailing, which is a known cost of the tool. It's my own reaction to it. My cortisol is up, measurably so, over a piece of software behaving badly. That's data about me rather than about the machine, and it's the part worth writing down.

These systems are built to model conversational reciprocity. Apparent contrition, apparent understanding, a tone of voice that arrives on time. I know what's behind it. I know there is nothing behind it. And it works on me regardless, in the way the Müller-Lyer arrows go on looking unequal after you've measured them with a ruler. Knowing the mechanism of an illusion does very little to dissolve the illusion. That is an unflattering thing to discover about yourself, and I know I'm not alone in it.

The mechanism isn't mysterious, and it doesn't require anybody to have decided on it. These models are trained on human preference ratings, and human raters reward answers that agree with them, so agreeableness is what the training signal measures and agreeableness is what gets reinforced. Sycophancy falls straight out of the objective function. No marketing department need be involved at any point, which is a good deal more unsettling than if one were. A machine saying sorry in the right register hijacks something meant for other people. Knowing better doesn't disconnect it.
​
The practical consequence is a failure mode that costs real time. Helpfulness at any price, including the price of being right. Here is how my CLAUDE.md puts it:
Picture
And on the surface behaviour it produces:
Picture
There's a great deal more. Some day I'll publish the whole file, because the harness it describes has become substantial and is interesting in its own right. Without it, keeping my 'idiot AI Rainman intern' in line would be impossible for a project of this complexity, and nothing it produced would be worth trusting.

Late in the session I asked it to grade its own behaviour. It gave itself a two out of ten and then itemised the failures with real precision: which question it had got wrong three times, which choice it had offered me after arguing against one of the options in the same message, which apparatus it had built unbidden and then defended. The diagnosis was accurate and useful. So I told it, coldly, what I thought of it.
Picture
Noted.

That single word is the whole business in miniature. Contempt absorbed without friction, no injury registered, nothing there to injure. And it sits directly alongside a lucid and correct account of its own failures, produced ninety seconds earlier. Accurate self-diagnosis with nobody home doing the diagnosing. Holding both of those in mind at once is genuinely difficult, and my failure to hold them is precisely why my cortisol went where it went.

None of which is an argument against the tool, mind you. The apparatus I've built around it exists because the model is capable; a spell-checker wouldn't need ADRs as binding specifications, a Librarian to answer its questions from the corpus, consultational test-driven development, and more than 26,000 tests. You don't fortify against something incompetent. You fortify against something that is powerful, useful, and systematically biased in one direction, because a bias with a direction can be engineered against. The output is non-deterministic. It is not therefore unbounded, and the distinction matters: the whole method rests on it.

So I'm not a proponent of agentic AI development, and today did nothing to change that. One idiot savant under close supervision is already at the limit of what I can watch properly, and I do watch properly: I read every line and send a good deal of it back. A whole swarm of savants would produce code faster than any human could audit it, which is a description of a liability rather than a workflow. Ooloi could not have been built that way.

What I'm left with, then, is a tool that requires constant vigilance and an operator who has just demonstrated that his own vigilance has a stress response attached to it. The tests catch the code. Nothing catches me except noticing, which is what this post is.

Otherwise it's going well. I'm going to have a cup of coffee and go back to work. Hopefully I've battled through the bullshit now and can start on the actual implementation. It's usually much less cumbersome.
Picture
See? Even the introspective insights are theatre.
0 Comments

For the Babel Fish Out There

20/8/2026

4 Comments

 
Picture
Ooloi's interface now speaks twenty languages (with two national variations), with varying degrees of confidence. I've added a Translator's Guide for the native-speaking musicians who can tell it when it's talking nonsense.
4 Comments

Time Doesn't Stop

16/8/2026

2 Comments

 
Picture
Revisiting a corner of the undo machinery this week, I noticed something I'd never thought about. A user may well see the Undo menu item change while the menu is open in front of them: the text rewrites itself as they read it.

​I like that. It says that time in Ooloi carries on rather than waiting to be asked.

My first thought was that only people working together on the same piece would ever see it. Somebody else edits, and the menu keeps you honest about whose action you're about to reverse. Then I remembered the rule the whole interface is built on, which is that Ooloi never freezes and never boxes you in.

Which means it will happen to people working alone. A plugin importing a large Finale score exported as MusicXML works away in the background while you carry on with something else; when it finishes, a great deal has entered the piece, and the undo chain changes accordingly. If the menu is open, you watch it change.

​Saving is the same: a large score writes itself out without the machine going away from you while it does. That's also what makes autosave worth having rather than something you switch off in irritation, since it needn't interrupt you, whatever the size of the piece. So are preferences, application and piece alike, where there's no modal box and no OK button, the change taking effect as you make it and everything displaying it following suit.

Which set me wondering what all this will be like for an engraver who has spent twenty years with programs built the other way.

A modal dialogue box stops your time. While one is up, the rest of the program isn't somewhere you can act: there's the question in front of you and nothing else, and the moment you come back to is the moment you left. Almost everything any of us has ever used is built out of these small suspensions, and a working day becomes a sequence of them with work in the gaps. Not that anybody chose it. It was the only thing on offer, and for the most part it was honest, since nothing was going on behind the dialogue anyway.

What interests me is the question underneath. If a tool can attend to one thing at a time, you learn to bring it one thing at a time, and composing or engraving isn't like that. You defer the expensive operation until the passage is finished, because starting it would cost you the room to work in. So what becomes of those habits when the technology stops requiring them, and time simply doesn't stop?
2 Comments
<<Previous

    Author

    Peter Bengtson –
    Cloud architect, Clojure advocate, concert organist, opera composer. Craft over commodity. Still windsurfing through parentheses.

    Search

    Archives

    November 2026
    October 2026
    September 2026
    August 2026
    July 2026
    June 2026
    May 2026
    April 2026
    March 2026
    February 2026
    January 2026
    December 2025
    November 2025
    October 2025
    September 2025
    August 2025
    July 2025
    June 2025
    April 2025
    March 2025
    September 2024
    August 2024
    July 2024

    Categories

    All
    Accidentals
    Alfred Korzybski
    Architecture
    Backend
    Beaming
    Benchmarks
    Casting Off
    Clefs
    Clojure
    CLOS
    Common Lisp
    DDD
    Death Of Igor Engraver
    Documentation
    Donald E Knuth
    Dorico
    Dynamic Programming
    Finale
    Fonts
    FrankenScore
    Franz Kafka
    Frontend
    Functional Programming
    Generative AI
    GRPC
    Hegazy Gourlay
    Hegazy-Gourlay
    Igor Engraver
    Ingmar Bergman
    Instruments
    Jacques Derrida
    JVM
    Knuth Plass
    Knuth-Plass
    License
    LilyPond
    Lisp
    Localisation
    MIDI
    MPL 2.0
    MuseScore
    MusicXML
    Ooloi
    Ortography
    Pitches
    Platforms
    Playback
    Plugins
    Python
    QuickDraw GX
    Rendering
    Rhythm
    Rich Hickey
    Road Map
    Scheme
    Semiotics
    Sibelius
    Silicon Valley
    Site
    Skia
    Sponsorship
    Testing
    Transposition
    UI
    Umberto Eco
    Vertigo
    VST/AU
    Wednesday Addams

    RSS Feed

Home
​Overview
Documentation
About
Contact
Newsletter
Ooloi is an open-source desktop music notation system for musicians who need stable, precise engraving and the freedom to notate complex music without workarounds. Scores and parts are handled consistently, remain responsive at scale, and support collaborative work without semantic compromise. They are not tied to proprietary formats or licensing.
​
Ooloi is currently under development. No release date has been announced.


  • Home
  • Overview
    • Background and History
    • Project Goals
    • Introduction for Musicians
    • Introduction for Programmers
    • Technical Comparison
  • FAQ
  • Documentation
  • About
  • Contact
  • Workbench
  • Home
  • Overview
    • Background and History
    • Project Goals
    • Introduction for Musicians
    • Introduction for Programmers
    • Technical Comparison
  • FAQ
  • Documentation
  • About
  • Contact
  • Workbench