OOLOI.ORG
Menu

OOLOI

An Organism Evolved.

OVERVIEW

DOCUMENTATION

NEWSLETTER

The Belly of an Architect

5/12/2025

0 Comments

 
Picture
And my heart yearns baffled and blind, moved vainly toward thee, and moving  
As the refluent seaweed moves in the languid exuberant stream


— Algernon Charles Swinburne, 'Hesperia' (1866)
​Oh dear. Here's another quasi-philosophical blog post from the developer who still hasn't put anything on screen. You know the genre: intricate justifications for why invisible work matters, peppered with references to Victorian poets to make the whole enterprise seem less like procrastination and more like... what? Research? Vision? Architectural discipline?

I get it. A year and a half in, I want to see five lines and a treble clef. Instead, I get Swinburne and ruminations about streams. Fair enough. But something actually happened in the last few weeks that might explain why there's still nothing to look at — and more importantly, what that absence created space for.

After completing the backend infrastructure, I could have drawn the staff. Five lines, treble clef, a few notes on screen — visual feedback that would make the work feel real, tangible, moving forward. Every instinct pointed that direction. Show something. Prove it works. Keep momentum.

I chose accidentals instead.

The Architect's Hunch

​Why? Because after decades of building systems, you develop a sense for what needs to happen when. Not through conscious analysis, but through pattern recognition too deep to articulate. The commercial world calls this procrastination: 'Show something now. Validate with users. Iterate visibly'. But architectural intuition operates on different timescales. Sometimes the right move is to resist visibility until foundations are provably correct.

I felt compelled — and I mean that seriously, as in compelled — to solve accidental calculation before implementing rendering. Not for rational reasons I could enumerate in a planning document, but because something about the architecture whispered that accidentals would either validate everything or expose problems that couldn't be patched later.

Scary stuff, that. Betting 18 months of invisible work on a hunch.

​What Accidentals Actually Are

PictureThe usual suspects
​If you're not a musician, accidentals are the sharps, flats, and naturals that modify pitches within a measure. Simple enough in principle: once you write a sharp on a note, subsequent notes at that pitch remain sharp until cancelled or the measure ends.

​In practice, however, it's fiendishly complex.


Every notation program faces having to handle this complexity. Most handle it through special cases, heuristics, and lots of user-facing options for 'accidental behaviour in situation X'. The complexity emerges not from incompetent developers — the best commercial systems are built by brilliant people — but from architectural constraints where mutable state and rendering-first design make comprehensive solutions intractable.

I wanted to know if Ooloi's architecture could do better. Not through cleverness, but through correctness. If you find the word 'correctness' problematic, as in 'hyper-focused proto-Aspie obsession', bear with me for a paragraph or two so I can explain.

The Languid, Exuberant Stream

​Swinburne's metaphor turns out to be architecturally precise. The 'languid exuberant stream' operates on two dimensions simultaneously.

There's the mechanical dimension: Ooloi's timewalker is exuberant, powerful, a computational firehose processing enormous amounts of musical data. The machinery underneath is doing extraordinary work — coordinating temporal sequences, managing state across hierarchies, maintaining correctness through thousands of simultaneous operations.

And there's the conceptual dimension: languid, unhurried, effortless. When I actually write code, I'm asking simple questions: 'Does this note's accidental equal what we remember at this pitch and octave?' No wrestling with complexity, no thinking about coordination, no managing the machinery. Just natural musical questions that flow without effort.

The division is absolute. The architecture provides the exuberant power. I provide the languid purpose. They meet somewhere in the middle, and problems that should be hard simply... aren't.

The Great Contrast

​Commercial development forecloses this path. When visual pressure exists, you cannot separate these dimensions. You're forced to think about rendering whilst solving semantics, to optimise display whilst establishing correctness, to show something whilst building everything.

The result isn't wrong exactly — it's approximate. When architecture makes comprehensive solutions intractable, you end up with many options that tune approximations. The settings don't control behaviour; they compensate for architectural constraints.

This isn't criticism of commercial developers. They're working under pressure that makes this separation structurally impossible. Ship something. Show progress. Iterate based on user feedback. Entirely rational within commercial constraints; completely incompatible with certain architectural possibilities.

Working 'in the dark' created space for pure separation. The semantic foundation could reach mathematical correctness without visual compromise. When those dimensions finally unite, capabilities emerge that mixed approaches cannot achieve.

Not different in degree. Different in kind.

The Achievement

​The real achievement isn't solving accidentals. It's proving that separation of concerns works. That languid conceptual flow on exuberant mechanical power enables solutions that mixed approaches cannot reach. That working in the dark creates space for architectural correctness that commercial pressure forecloses.

The accidentals solution is evidence, but he architecture is the achievement.

The stream is languid and exuberant simultaneously. The mechanical power flows abundantly underneath. The conceptual purpose moves effortlessly above. They meet where music becomes mathematics and mathematics becomes music, and problems that should be hard turn out not to exist at all.

Because the architecture is right.

And now I can begin to trust it in earnest.
0 Comments

When Four Systems Align

20/11/2025

5 Comments

 
Picture
I've just completed ADR-0035 on remembered alterations: the system determining when accidentals print in music notation. The client's first window won't open for yet a few weeks, so there's no technical pressure for this work. But conceptually, it felt necessary. Pitch representation, time signatures, key signatures: all complete. Before proceeding to visualization, I needed to see these systems work together. I needed conceptual closure.

The result surprised me. Not because it works (of course it works), but because of how naturally the pieces fit.

The Actual Problem

Accidental rendering isn't 'print a sharp when the note differs from the key signature'. Accidentals have memory. Once F♯ appears in a measure, subsequent F notes remember that sharp until the barline. This memory flows left-to-right through musical time, independent of visual layout.

The complexity emerges in multi-staff instruments. Piano, harp, organ, even choirs: all staves share accidental memory. A sharp in the treble affects naturals in the bass. Multiple voices complicate further; temporal sequence follows rhythmic position, not staff order or voice structure. You need a model where musical time is explicit and independent of how things appear on the page.

This is precisely the problem that four separate architectural decisions, made for entirely different reasons, were built to solve.

What Was Already There

Pitch representation (ADR-0026): Letter names, octaves, accidental keywords. Built for memory efficiency and canonical identity. No thought given to accidental rendering at the time.

Time signatures (ADR-0033): Metric positions as rationals (1/4, 3/8, 5/16) providing exact temporal coordinates for every event. Built to handle irrational and additive meters correctly. Again, no consideration of accidental logic.

Key signatures (ADR-0034): Define which accidentals are 'normal' for a given context. Standard keys, keyless modes for keyless music, per-octave microtonal signatures for contemporary notation. Built as baseline, not as accidental memory.

Timewalk (ADR-0014): Traverses music in strict temporal order. Built for efficient general-purpose traversal. The musical timeline made explicit as implementation detail.

Four systems, four separate problems, no coordination between them.

The Single Comparison Rule

With those foundations in place, remembered alterations became straightforward. The algorithm is a wave pattern flowing left to right:
  1. Start of measure: Initialize to key signature baseline
  2. Process each note: Compare against current remembered state
  3. Update after each note: This accidental becomes new remembered state  
  4. Measure boundary: Reset to baseline

Decision rule: A note requires a printed accidental when its accidental differs from the current remembered state for that letter and octave.

That's it. This single rule handles both required accidentals (contradicting key signature) and courtesy accidentals (restating after alteration). No special cases. No heuristics. The data structure stores only deviations from baseline; eight entries typical versus seventy for full representation.

Grace notes participate fully in the memory system. Tied notes bypass conditionally with position-based French tie distinction. Simultaneities detect conflicts where the same letter has different accidentals at the same moment. Cross-octave courtesy accidentals work through letter-first grouping that makes the lookup O(m) where m equals octaves for that letter, not O(k) for all octaves globally.

All of this through the same mechanism. The complexity isn't in the algorithm; it's in having the right foundations.
Picture

The Mental Shift

Timewalk changed how I think about notation problems. Instead of 'iterate over notes and check context', the remembered alterations pipeline is stream transformation:
Picture
​Each stage is pure transformation. Grace notes are repositioned to exact temporal locations based on tempo-dependent duration (85ms default, compressed on collision). Simultaneities group by rhythmic position. Conflicts detect same-letter different-accidentals at the same moment. The reducer threads remembered state through the stream, accumulating decisions.

This pattern will handle dynamics, articulations, phrase marks: any notation requiring temporal context. The abstraction scales because the foundations were right to begin with.

What This Actually Reveals

​The algorithm produces semantic decisions about accidental requirements, independent of layout. These decisions are deterministic: same music, same decisions, always. They're layout-independent: work identically across all visual representations. They're configurable: house style settings modify behaviour without code changes. They're correct: edge cases handled through the same mechanism as common cases.

But here's what matters: I didn't design these four systems to work together. I designed each to solve its own problem correctly. The alignment emerged because correct solutions in related domains tend to compose naturally.

This is evidence. Either the domain model reflects musical reality accurately, or I've successfully imposed coherent structure on chaos. Those are different conclusions with different implications, but both suggest the foundations can carry what comes next.

The Timing Question

​Why now? Why remembered alterations before any visualisation exists?

Because I needed to know whether the foundations were actually complete. Pitch, rhythm, key signatures, temporal traversal: individually validated, but never tested as a system. Remembered alterations forced that test. If they didn't align naturally, I'd have learned something important about what was missing.

They aligned. Beautifully. With no compromises in existing architecture, no special cases, no friction. Four systems built independently composed into a solution more elegant than any I'd planned.

That's conceptual closure. That's knowing the foundations are right before proceeding to build on them. That's why this work happened now, before technical necessity demanded it.

The next phases (windowing, rendering, note entry) will build on these same primitives. But now I know they're sound. Not because I believe they should be, but because I've seen them work together when they had no reason to unless the underlying model was correct.

The window opens soon. But first, this needed to be right. Now I know that when notes appear on screen, there will be no special cases left to fix, no rules-of-thumb to implement. Accidentals are now correct regardless of staff, voice, cross-staff, or cross-measure situation or house rule preferences.

​Es ist alles eins, as Marie sings in Wozzeck. But in a good way.
Picture
5 Comments

    Author

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

    Search

    Archives

    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
    Architecture
    Benchmarks
    Clojure
    CLOS
    Common Lisp
    Death Of Igor Engraver
    Documentation
    Donald E Knuth
    Dorico
    Finale
    FrankenScore
    Franz Kafka
    Functional Programming
    Generative AI
    GPL V2
    GRPC
    Igor Engraver
    Jacques Derrida
    JVM
    License
    LilyPond
    Lisp
    MIDI
    MuseScore
    Ooloi
    Ortography
    Pitches
    Plugins
    Python
    QuickDraw GX
    Rhythm
    Rich Hickey
    Road Map
    Scheme
    Sibelius
    Site
    Skia
    Sponsorship
    UI
    Vertigo
    VST/AU
    Wednesday Addams

    RSS Feed

Home
​Overview
Documentation
About
Contact
Newsletter
Ooloi is a modern, open-source desktop music notation software designed to produce professional-quality engraved scores, with responsive performance even for the largest, most complex scores. The core functionality includes inputting music notation, formatting scores and their parts, and printing them. Additional features can be added as plugins, allowing for a modular and customizable user experience.

​Ooloi is currently under development. No release date has been announced.​


  • Home
  • Overview
    • Background and History
    • Project Goals
    • Introduction for Musicians
    • Introduction for Programmers
    • Introduction for Anti-Capitalists
    • Technical Comparison
  • Documentation
  • About
  • Contact
  • Home
  • Overview
    • Background and History
    • Project Goals
    • Introduction for Musicians
    • Introduction for Programmers
    • Introduction for Anti-Capitalists
    • Technical Comparison
  • Documentation
  • About
  • Contact