|
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 NotesHere'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. 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 StavesThe 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. 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 SpareWhen 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. 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 SideSo 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. 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 HerdedNone 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 perdusSo, 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. Exeunt, pursued by a stave
6 Comments
Magnus Johansson
4/11/2026 15:18:41
This all looks very solid. Thank you, Peter, for this account and congratulations! I believe the cats were never really there although they likely have wanted to.
Reply
Peter Bengtson
4/11/2026 16:10:12
Thank you, Magnus. Coming from you, 'very solid' means a great deal.
Reply
Roland Gurt
4/11/2026 23:47:50
Nice to see this mathematical model being so flexible and effective! You’re working on music engraving’s "Weltformel" ("theory of everything") ;-)
Reply
Peter Bengtson
5/11/2026 10:52:45
Thank you, Roland. I really like ‘Weltformel’! I’d better be honest about authorship, though: I didn’t write the formula. Hegazy and Gourlay published it in 1987, and what I’m doing is finding out what it can do. So far that’s a great deal more than I expected.
Reply
Roland Gurt
6/11/2026 18:34:31
Fascinating. Yes, which elements worsen the impression of the digital version compared to the original engraving?... I would say: the janky spacing is what makes it look stiff and unelegant.
Reply
Peter Bengtson
7/11/2026 13:17:02
‘Vintage-mockery’ is exactly the word, Roland, and ‘janky spacing’ is exactly the diagnosis. That’s why I want to get the basic spacing just so first. Once it’s right it stops masking everything else, and the intangibles we’re discussing here can be investigated on their own.
Reply
Leave a Reply. |
AuthorPeter Bengtson – SearchArchives
November 2026
Categories
All
|
|
|
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.
|
RSS Feed