OpenSheetMusicDisplay
    Preparing search index...

    Class MusicSystemBuilder

    Index
    activeClefs: ClefInstruction[]
    activeKeys: KeyInstruction[]
    activeRhythm: RhythmInstruction[]
    currentSystemParams: SystemBuildParameters
    globalSystemIndex: number = 0
    graphicalMusicSheet: GraphicalMusicSheet
    leadSheet: boolean = false
    measureList: GraphicalMeasure[][]
    measureListIndex: number
    musicSystems: MusicSystem[] = []
    numberOfVisibleStaffLines: number
    visibleStaffIndices: number[]

    Does the mapping from the currently visible staves to the global staff-list of the music sheet.

    • If a line repetition is ending and a new line repetition is starting at the end of the system, the double repetition line has to be split into two: one at the currently ending system and one at the next system. (this should be refactored at some point to not use a combined end/start line but always separated lines)

      Returns void

    • Calculate the width needed for Instructions (Key, Clef, Rhythm, Repetition) for the measure.

      Parameters

      • measures: GraphicalMeasure[]
      • isSystemFirstMeasure: boolean
      • isFirstSourceMeasure: boolean

      Returns number

    • Calculate the X ScalingFactor in order to strech the whole System.

      Parameters

      • systemFixWidth: number
      • systemVarWidth: number

      Returns number

    • Check if an extra Instruction [[Measure]] is needed: courtesy key or rhythm instructions at the end of the system for a change at the start of the next system. If so, every staff of the system gets one, so that all staves end at the same x, and the courtesy time signatures align.

      Parameters

      Returns void

    • If the last [[MusicSystem]] doesn't need stretching, then this method decreases the System's Width, the [[StaffLine]]'s Width and the 5 [[StaffLine]]s length.

      Returns void

    • When the actual source measure doesn't fit any more, this method finalizes the current system and opens up a new empty system, where the actual measure will be added in the next iteration (if a measure is left, see hasMeasuresLeft()).

      Parameters

      • measures: GraphicalMeasure[]
      • systemEndsPart: boolean = false
      • checkExtraInstructionMeasure: boolean = true
      • startNewPage: boolean = false

      Returns void

    • Replaces the current system's labels when they leave its measures too little room (EngravingRules.FitPartLabelsToMeasures), e.g. in a narrow container, where the part names pushed the first measure past the staff end: the first system then shows the part names on two lines, else the part abbreviations, else no labels, and later systems no abbreviations. Labels leave too little room when the notes get less than their minimum width and less than 3/4 of the room they would have without labels. So labels may take up to a quarter of the room of a measure wider than the system anyway, e.g. a dense measure alone in a system.

      Parameters

      • fixWidth: number

        the width of the measures that isn't stretched: clefs, key and time signatures, barlines

      • varWidth: number

        the minimum width of the measures' notes, which is stretched to fill the system

      Returns void

    • Whether the measureList has a measure left to add to a system, at the measureListIndex or after it. The later measures of a multiple rest measure have no graphical measures there (see getLastMeasureOfMultiRest()), so none is left after a multiple rest measure that ends the measureList (the piece, or e.g. a batch of renderNext()), though the measureListIndex is within the measureList.

      Returns boolean

    • The top border of a page's first system (from its skyline), by which all systems of the page are moved down after the page layout, see MusicSheetCalculator.calculateMusicSystems(). The page layout includes this move when checking whether a system still fits above the bottom margin. Rounded to whole pixels to keep the staff line positions snapped by snapSystemYToCrispStaffLines(), or to the half-pixel grid if not snapping.

      Parameters

      Returns number

    • Snaps a system's y position (in units) so that its staff lines render as crisp single pixel rows: the lines are 1px wide (at zoom 1), so their centers need to lie at half-pixel positions (a line centered between two pixel rows is anti-aliased over both at half opacity instead). The stafflines within the system share the same sub-pixel phase (see optimizeDistanceBetweenStaffLines), so snapping the system y aligns all of them. Shifts the system by at most half a pixel. No-op if EngravingRules.SnapStafflinesToCrispPixels is off.

      Parameters

      Returns number