Lily# About — lineage, licence, architecture

01

What Lily# owes LilyPond

LilyPond has set the standard for computer-engraved music for decades. Lily# does not try to out-engrave it. It carries LilyPond's engraving decisions across — with attribution, and under the same licence.

The engine is a port, not an imitation

Beam quanting, slur and tie scoring, skylines, springs and page breaking are modified translations of LilyPond's own C++ and Scheme. Every ported file carries the copyright notice of the LilyPond file it came from, and LILYPOND-ATTRIBUTION.md lists all of them.

The house rule is that layout code is transliterated from LilyPond's source rather than reverse-engineered from its pictures — and that nothing may be tuned merely to make the output match byte for byte. Elsewhere, most LILYPOND-REF comments are citations rather than ports: they mark where LilyPond decides something, so this code can be checked against it.

It is an independent project

Lily# is not affiliated with, endorsed by, or a release of the LilyPond project. The name is a nod, not a badge. If something here engraves badly, that is Lily#'s bug — please don't take it to the LilyPond maintainers.

The language is deliberately not LilyPond's: \relative, \new Staff, \version and << … \\ … >> are rejected outright, and a chord symbol is typed the way it prints. What the two share is engraving knowledge, not syntax — see Coming from LilyPond.

02

Licence and fonts

Lily# is free software under the GNU General Public License v3.0 or later. It contains modified code from LilyPond, which is under that same licence; the modifications are Lily#'s own and are marked in the files that carry them.

The fonts ship with it too. Emmentaler, the default music face, comes from LilyPond (GPL-3.0-or-later / SIL OFL dual licensed, redistributed here under the GPL). Bravura, Petaluma (with its text face Petaluma Script) and Leland, the music fonts a score can name instead, are under the SIL Open Font License 1.1. TeX Gyre Schola and TeX Gyre Heros set the text by default — and provide the metrics it is spaced by — under the GUST Font Licence (LPPL 1.3c). They are the same faces LilyPond sets text in.

The extension keeps no account or key of its own and sends no telemetry; its AI features use the language models VS Code offers you (AI in the editor).

03

Why the preview keeps up

The compiler keeps a Roslyn-style red-green tree, so a keystroke reparses only the part you touched; the renderer then reuses every system whose width did not change. The parse is the cheap half — the time is in layout, and layout is what gets skipped. That is what lets the score redraw as you type rather than when you save.

Typing in the middle of a long score: only the system you touched is laid out again.

04

How it is put together

The same diagram as in README.md.

flowchart TD
    src["score.lys"] --> Core

    subgraph Core["LilySharp.Core"]
        direction TB
        A["<b>Parser · Syntax</b><br/>lexer, recursive-descent parser,<br/>red-green tree"]
        B["<b>Semantics · Music · Harmony</b><br/>durations, measure validation,<br/>keys, chords"]
        C["<b>Svg · Rendering</b><br/>beam quanting, slur and tie scoring,<br/>skylines, springs, page breaking<br/><i>— ported from LilyPond</i>"]
        D["<b>Back ends</b><br/>Pdf · Png · Midi · MusicXml ·<br/>LilyPond · Vocaloid · Tablature"]
        A --> B --> C --> D
    end

    Core --> Cli["<b>LilySharp.Cli</b><br/>the lysc command"]
    Core --> Lsp["<b>LilySharp.Lsp</b><br/>language server"]
    Lsp --> Ext["<b>editors/vscode</b><br/>extension — bundles the server"]

    Tests["<b>LilySharp.Tests</b><br/>unit + SVG snapshots"] -.->|guards| Core
    Audit["<b>audit/</b><br/>LilyPond-fidelity ledger<br/>+ regression corpus"] -.->|measures| Core
    Bench["<b>LilySharp.Benchmarks</b><br/>layout and parse timing"] -.->|times| Core