Loading…
Loading…
Rule
Gradus GE-176 · cite this code — it is permanent. Rule id spacing-required-width-master-formula
This is the capstone rule the others feed into: engraving spacing is not one number (Gradus's current `beatW`) but the sum of a sub-linear duration term, a hard per-note floor, and additive costs for every attachment actually present, evaluated per note, summed per bar, and packed into systems by a solver that treats barline/beam/tuplet boundaries as hard constraints. Every other rule in this chapter that says 'add a term to the shared accumulator' is describing a piece of THIS function.
Synthesis of Ross (spacing tables + last-resort size reduction), Gould (density-driven bars-per-system, non-justified last system), LilyPond (log2 proportional spacing engine, public formula), SMuFL/Bravura (exact glyph-advance-width source of truth for every additive constant below, verified against Gradus's own bundled font at `node_modules/vexflow/src/fonts/bravura_glyphs.ts`), and TeX/Knuth-Plass (global-badness line-breaking, the correct family of algorithm for the bin-packing half of this spec).
This rule can be decided from pitches, durations and voices — no layout required. A validator can check it before anything is drawn.
Gradus GE-176 — THE SPEC: a single pure function computes every note's required width from duration + all attachments + furniture, and a bin-packer decides system breaks against it — BEFORE VexFlow ever runs. Gradus Engraving Rulebook v1.0. https://gradusmusic.com/engraving/rule/spacing-required-width-master-formula
Rulebook v1.0 · text licensed CC-BY-4.0 · machine-readable at /api/v1/engraving/rules/spacing-required-width-master-formula