OpenSheetMusicDisplay
    Preparing search index...

    Class MusicSheetCalculatorAbstract

    Class used to do all the calculations in a MusicSheet, which in the end populates a GraphicalMusicSheet.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    Accessors

    Methods

    calcGraphicalRepetitionEndingsRecursively calculate calculateAlignedChordSymbolsOffset calculateChordSymbols calculateComments calculateDynamicExpressionsForMultiExpression calculateExpressionAlignements calculateFingerings calculateGlissandi calculateGraphicalContinuousDynamic calculateGraphicalInstantaneousDynamicExpression calculateGraphicalVerbalContinuousDynamic calculateLabel calculateLyricsExtendsAndDashes calculateMarkedAreas calculateMeasureNumberPlacement calculateMeasureWidthFromStaffEntries calculateMeasureXLayout calculateMoodAndUnknownExpression calculateMusicSystems calculatePageLabels calculateRehearsalMark calculateRestNotePlacementWithinGraphicalBeam calculateSheetLabelBoundingBoxes calculateSingleOctaveShift calculateSinglePedal calculateSingleStaffLineLyricsPosition calculateSingleWavyLine calculateSkyBottomLines calculateSlurs calculateTempoExpressionsForMultiTempoExpression calculateTupletNumbers calculateWordRepetitionInstruction calculateXLayout checkMeasuresForWholeRestNotes clearRecreatedObjects clearSkyBottomLineCache clearSystemsAndMeasures createGraphicalTie createGraphicalTies createMetronomeMark formatMeasures getRelativePositionInStaffLineFromTimestamp getRelativeXPositionFromTimestamp graphicalMeasureCreatedCalculations handleBeam handleStaffEntryLink handleTiedGraphicalNote handleTuplet handleVoiceEntry handleVoiceEntryArticulations handleVoiceEntryLyrics handleVoiceEntryOrnaments handleVoiceEntryTechnicalInstructions initGraphicalMeasuresCreation initialize layoutArticulationMarks layoutBeams layoutGraphicalTie layoutMeasureWithWholeRest layoutOrnament layoutSingleRepetitionEnding layoutStaffEntry layoutVoiceEntries layoutVoiceEntry maxInstrNameLabelLength optimizeRestNotePlacement prepareGraphicalMusicSheet resetYPositionForLeadSheet skyBottomLineCacheKey updateStaffLineBorders setMeasuresMinStaffEntriesWidth

    Constructors

    Properties

    dynamicExpressionMap: Map<number, BoundingBox> = ...
    graphicalLyricWords: GraphicalLyricWord[] = []
    graphicalMusicSheet: GraphicalMusicSheet
    musicSystems: MusicSystem[]
    skyBottomLineCache: Map<string, { bottom: number[]; sky: number[] }> = ...

    Lazy rendering: cache of computed sky/bottom lines, keyed per staff line by its system's measure range + staff index. A growing-prefix batch re-runs the (expensive) skyline pass over the whole prefix; this lets stable interior systems reuse the lines computed in an earlier batch instead of re-measuring them. Only used when EngravingRules.LazyConsistentGraphic; cleared per lazy session.

    staffEntriesWithChordSymbols: GraphicalStaffEntry[] = []
    staffEntriesWithGraphicalTies: GraphicalStaffEntry[] = []
    staffEntriesWithOrnaments: GraphicalStaffEntry[] = []
    staffLinesWithLyricWords: StaffLine[] = []
    stafflineNoteCalculator: IStafflineNoteCalculator
    textMeasurer: ITextMeasurer
    transposeCalculator: ITransposeCalculator

    Accessors

    Methods

    • Parameters

      • multiExpression: MultiExpression
      • measureIndex: number
      • staffIndex: number

      Returns void

    • Calculate all the Mood and Unknown Expressions for a single [[MultiExpression]].

      Parameters

      • multiExpression: MultiExpression
      • measureIndex: number
      • staffIndex: number

      Returns void

    • Calculate a single OctaveShift for a [[MultiExpression]].

      Parameters

      • sourceMeasure: SourceMeasure
      • multiExpression: MultiExpression
      • measureIndex: number
      • staffIndex: number

      Returns void

    • Calculate a single Pedal for a [[MultiExpression]].

      Parameters

      • sourceMeasure: SourceMeasure
      • multiExpression: MultiExpression
      • measureIndex: number
      • staffIndex: number

      Returns void

    • Calculate a single Wavy Line for a [[MultiExpression]].

      Parameters

      • sourceMeasure: SourceMeasure
      • multiExpression: MultiExpression
      • measureIndex: number
      • staffIndex: number

      Returns void

    • Delete all Objects that must be recalculated. If graphicalMusicSheet.reCalculate has been called, then this method will be called to reset or remove all flexible graphical music symbols (e.g. Ornaments, Lyrics, Slurs) graphicalMusicSheet will have MusicPages, they will have MusicSystems etc...

      Returns void

    • Parameters

      • timestamp: Fraction
      • verticalIndex: number
      • staffLine: StaffLine
      • multiStaffInstrument: boolean
      • firstVisibleMeasureRelativeX: number = 0.0
      • useLeftStaffEntryBorder: boolean = false

      Returns PointF2D

    • Build the 2D [[GraphicalMeasure]] list needed for the [[MusicSheetCalculator]]. Internally it creates [[GraphicalMeasure]]s, [[GraphicalStaffEntry]]'s and [[GraphicalNote]]s.

      Returns void

    • Stable per-staff-line key for the lazy sky/bottom-line cache: the system's measure range pins the system (systems partition the measures), the staff index picks the line within it. Returns undefined for a staff line with no usable measures (so it is never cached/reused).

      Parameters

      • staffLine: StaffLine
      • staffIndexInSystem: number

      Returns string