OpenSheetMusicDisplay
    Preparing search index...

    Class BrailleBarOverBarLayout

    Bar-over-bar layout engine for keyboard/piano braille music.

    Implements BANA Music Braille Code 2015, Chapter 28 + Par. 29.3. Produces vertically aligned parallels where RH and LH measures appear on adjacent lines with aligned measure starts.

    This class handles layout only — note rendering is delegated to BrailleMeasureRenderer.

    Index

    Constructors

    Methods

    • Format a multi-staff score in bar-over-bar layout.

      Parameters

      • musicSheet: MusicSheet

        The parsed MusicSheet

      • config: BarOverBarConfig

        Layout configuration

      • debugMode: boolean

        Whether to generate debug entries

      • facsimile: boolean

        Whether facsimile mode is active

      • computeSlurLengthsFn: (measures: SourceMeasure[], staffIndex: number) => Map<Slur, number>

        Function to compute slur lengths per staff

      Returns BrailleOutput

      BrailleOutput with formatted bar-over-bar text

    • Convert a measure number to bare braille digits (NO number sign). Par. 29.3(b): measure numbers at the margin use no numeric indicator, in upper-cell digits (Example 29.3-1: measure 15 → ⠁⠑).

      Parameters

      • n: number

        The measure number (0 for anacrusis, 1+ for regular measures)

      Returns string

      Braille digit string without number sign prefix

    • Generate padding to fill a gap for vertical alignment.

      If the gap is large enough (≥ guideDotThreshold), fills with guide dots (dot 3, minimum guideDotMinCount). Guide dots are separated from music by one blank cell on each side (Par. 28.1.3).

      If the gap is too small for guide dots, fills with plain spaces.

      Parameters

      • gap: number

        Number of cells to fill

      • config: BarOverBarConfig

        Layout configuration with guide dot thresholds

      Returns string

      Padding string of exactly gap cells

    • Render an instrument list table (Par. 33.2). Two-column table: full instrument names + abbreviations. Abbreviations start 2 cells beyond the longest name. Guide dots (dot 5) fill gaps of 3+ cells between name and abbreviation column.

      Parameters

      • instruments: { abbreviation: string; name: string }[]

        Array of { name, abbreviation } in braille literary characters

      Returns { debugEntries: BrailleDebugEntry[]; lines: string[] }

      Lines of the table, one per instrument

    • Split a formatted staff line into run-over lines when it exceeds lineWidth (Par. 28.1.2).

      Splits occur only at blank-cell separators (between measures) — never mid-measure, since breaking within a measure would corrupt braille semantics (octave marks, interval signs, etc. are tightly coupled to adjacent notes).

      Run-over (continuation) lines are indented 2 cells beyond the alignment point (where music starts on the primary line, i.e., right after the prefix).

      Parameters

      • line: string

        The full formatted line (prefix + music content)

      • prefixLen: number

        The cell length of the prefix (music alignment point)

      • lineWidth: number

        Maximum cells allowed per line

      Returns string[]

      Array of lines. If input fits, returns [line]. Otherwise, primary line plus one or more continuation lines with run-over indent.