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 calculateChordSymbolsXPositions 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 isSameMetronomeMark isTempoMarkingAlreadyRendered layoutArticulationMarks layoutBeams layoutGraphicalTie layoutMeasureWithWholeRest layoutMetronomeMarks layoutOrnament layoutSingleRepetitionEnding layoutStaffEntry layoutVoiceEntries layoutVoiceEntry maxInstrNameLabelLength optimizeRestNotePlacement prepareGraphicalMusicSheet reserveSkylineForMeasureRepeats 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

    • Returns the highest (minimum) skyline and lowest (maximum) bottom line value under the chord symbols of the given staff entries, where they are drawn (see calculateChordSymbolsXPositions(), called before), to place them at one y position.

      Parameters

      • staffEntries: GraphicalStaffEntry[]

        The staff entries whose chord symbols to align, e.g. of a staffline or measure (ChordSymbolYAlignmentScope).

      • sbc: SkyBottomLineCalculator

        The sky and bottom line calculator of the staffline of the staff entries.

      Returns { maxOffset: number; minOffset: number }

      The minimum skyline value under chord symbols placed above, and the maximum bottom line value under chord symbols placed below (Number.MAX_SAFE_INTEGER and Number.MIN_SAFE_INTEGER if there are none).

    • Sets the x positions of the chord symbols of a measure (relative to their parent bounding boxes), before their y positions: a chord symbol not over a note goes from its staff entry (which has no x position without notes) to the measure, at an x proportional to its timestamp in the measure, and a chord symbol over a whole measure rest after the begin instructions.

      Parameters

      • measure: GraphicalMeasure

        The measure whose chord symbols to position.

      • measureStafflineIndex: number

        The index of the measure in its staffline, to find the measures of the other staves in musicSystem.

      • musicSystem: MusicSystem

        The system of the measure: chord symbols without a staff entry x position take the x position of a staff entry with the same timestamp in the other staves.

      Returns void

    • 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

    • Whether two metronome marks print the same: note equations by their notes rather than their playback tempo, other marks by beat unit and bpm.

      Parameters

      • first: InstantaneousTempoExpression
      • second: InstantaneousTempoExpression

      Returns boolean

    • 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