Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MusicSheetCalculator

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

Hierarchy

Index

Properties

Accessors

Methods

Properties

Protected graphicalLyricWords

graphicalLyricWords: GraphicalLyricWord[] = []

Protected graphicalMusicSheet

graphicalMusicSheet: GraphicalMusicSheet

Protected rules

Protected staffEntriesWithChordSymbols

staffEntriesWithChordSymbols: GraphicalStaffEntry[] = []

Protected staffEntriesWithGraphicalTies

staffEntriesWithGraphicalTies: GraphicalStaffEntry[] = []

Protected staffEntriesWithOrnaments

staffEntriesWithOrnaments: GraphicalStaffEntry[] = []

Protected staffLinesWithLyricWords

staffLinesWithLyricWords: StaffLine[] = []

Static symbolFactory

Static Protected textMeasurer

textMeasurer: ITextMeasurer

Static transposeCalculator

transposeCalculator: ITransposeCalculator

Accessors

Protected leadSheet

  • get leadSheet(): boolean

Static TextMeasurer

Methods

Protected calcGraphicalRepetitionEndingsRecursively

  • calcGraphicalRepetitionEndingsRecursively(repetition: Repetition): void

calculate

  • calculate(): void

Private calculateBeams

  • calculateBeams(): void

Protected calculateChordSymbols

  • calculateChordSymbols(): void

Protected calculateComments

  • calculateComments(): void

Private calculateDashes

  • calculateDashes(staffLine: StaffLine, startX: number, endX: number, y: number): void

Private calculateDynamicExpressions

  • calculateDynamicExpressions(): void

Protected calculateDynamicExpressionsForMultiExpression

  • calculateDynamicExpressionsForMultiExpression(multiExpression: MultiExpression, measureIndex: number, staffIndex: number): void

Protected calculateExpressionAlignements

  • calculateExpressionAlignements(): void

calculateGraphicalContinuousDynamic

Protected calculateGraphicalInstantaneousDynamicExpression

Protected calculateGraphicalVerbalContinuousDynamic

Protected calculateLabel

Private calculateLyricExtend

Protected calculateLyricsExtendsAndDashes

Private calculateLyricsPosition

  • calculateLyricsPosition(): void

Protected calculateMarkedAreas

  • calculateMarkedAreas(): void

Protected calculateMeasureNumberPlacement

  • calculateMeasureNumberPlacement(musicSystem: MusicSystem): void

calculateMeasureWidthFromLyrics

  • calculateMeasureWidthFromLyrics(measuresVertical: GraphicalMeasure[], oldMinimumStaffEntriesWidth: number): number

Protected calculateMeasureXLayout

  • Calculates the x layout of the staff entries within the staff measures belonging to one source measure. All staff entries are x-aligned throughout all the measures.

    Parameters

    • measures: GraphicalMeasure[]

      The minimum required x width of the source measure

    Returns number

Protected calculateMoodAndUnknownExpression

  • calculateMoodAndUnknownExpression(multiExpression: MultiExpression, measureIndex: number, staffIndex: number): void

Private calculateMoodAndUnknownExpressions

  • calculateMoodAndUnknownExpressions(): void

Protected calculateMusicSystems

  • calculateMusicSystems(): void

Protected calculateMusicSystemsRelativePositions

Private calculateOctaveShifts

  • calculateOctaveShifts(): void

Private calculateOrnaments

  • calculateOrnaments(): void

Protected calculatePageLabels

Private calculateRepetitionEndings

  • calculateRepetitionEndings(): void

Private calculateRestNotePlacementWithCollisionDetectionFromGraphicalNote

  • calculateRestNotePlacementWithCollisionDetectionFromGraphicalNote(graphicalStaffEntry: GraphicalStaffEntry): void

Protected calculateRestNotePlacementWithinGraphicalBeam

Private calculateRightAndLeftDashesForLyricWord

  • calculateRightAndLeftDashesForLyricWord(staffLine: StaffLine, startX: number, endX: number, y: number): number

Protected calculateSheetLabelBoundingBoxes

  • calculateSheetLabelBoundingBoxes(): void

Private calculateSingleDashForLyricWord

  • calculateSingleDashForLyricWord(staffLine: StaffLine, startX: number, endX: number, y: number): void

Private calculateSingleLyricWord

Private calculateSingleLyricWordWithUnderscore

  • calculateSingleLyricWordWithUnderscore(staffLine: StaffLine, startX: number, endX: number, y: number): void

Private calculateSingleMeasureNumberPlacement

Protected calculateSingleOctaveShift

  • calculateSingleOctaveShift(sourceMeasure: SourceMeasure, multiExpression: MultiExpression, measureIndex: number, staffIndex: number): void

Protected calculateSingleStaffLineLyricsPosition

Private calculateSkyBottomLines

  • calculateSkyBottomLines(): void

Protected calculateSlurs

  • calculateSlurs(): void

Private calculateStaffEntryArticulationMarks

  • calculateStaffEntryArticulationMarks(): void

Private calculateStemDirectionFromVoices

  • calculateStemDirectionFromVoices(voiceEntry: VoiceEntry): void
  • Calculates the desired stem direction depending on the number (or type) of voices. If more than one voice is there, the main voice (typically the first or upper voice) will get stem up direction. The others get stem down direction.

    Parameters

    • voiceEntry: VoiceEntry

      the voiceEntry for which the stem direction has to be calculated

    Returns void

Protected calculateSystemYLayout

  • calculateSystemYLayout(): void

Private calculateTempoExpressions

  • calculateTempoExpressions(): void

Protected calculateTempoExpressionsForMultiTempoExpression

Private calculateTieCurves

  • calculateTieCurves(): void

Protected calculateTupletNumbers

  • calculateTupletNumbers(): void

Private calculateTwoRestNotesPlacementWithCollisionDetection

  • calculateTwoRestNotesPlacementWithCollisionDetection(graphicalStaffEntry: GraphicalStaffEntry): void

Private calculateVerticalContainersList

  • calculateVerticalContainersList(): void

Protected calculateWordRepetitionInstruction

  • calculateWordRepetitionInstruction(repetitionInstruction: RepetitionInstruction, measureIndex: number): void

Private calculateWordRepetitionInstructions

  • calculateWordRepetitionInstructions(): void

calculateXLayout

  • calculateXLayout(graphicalMusicSheet: GraphicalMusicSheet, maxInstrNameLabelLength: number): void

Protected checkMeasuresForWholeRestNotes

  • checkMeasuresForWholeRestNotes(): void

Private checkNoteForAccidental

Protected clearRecreatedObjects

  • clearRecreatedObjects(): 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

Protected clearSystemsAndMeasures

  • clearSystemsAndMeasures(): void

Private createAccidentalCalculators

Private createGraphicalMeasure

Private createGraphicalMeasuresForSourceMeasure

Protected createGraphicalTie

Protected createGraphicalTies

  • createGraphicalTies(): void

Protected createMetronomeMark

Protected formatMeasures

  • formatMeasures(): void

Private getFirstLeftNotNullStaffEntryFromContainer

  • getFirstLeftNotNullStaffEntryFromContainer(horizontalIndex: number, verticalIndex: number, multiStaffInstrument: boolean): GraphicalStaffEntry

Private getFirstRightNotNullStaffEntryFromContainer

  • getFirstRightNotNullStaffEntryFromContainer(horizontalIndex: number, verticalIndex: number, multiStaffInstrument: boolean): GraphicalStaffEntry

Protected getRelativePositionInStaffLineFromTimestamp

  • getRelativePositionInStaffLineFromTimestamp(timestamp: Fraction, verticalIndex: number, staffLine: StaffLine, multiStaffInstrument: boolean, firstVisibleMeasureRelativeX?: number): PointF2D

Protected getRelativeXPositionFromTimestamp

  • getRelativeXPositionFromTimestamp(timestamp: Fraction): number

Protected graphicalMeasureCreatedCalculations

Protected handleBeam

Private handleStaffEntries

  • handleStaffEntries(): void

Protected handleStaffEntryLink

Private handleTie

  • handleTie(tie: Tie, startGraphicalStaffEntry: GraphicalStaffEntry, staffIndex: number, measureIndex: number): void

Protected handleTiedGraphicalNote

Protected handleTuplet

Protected handleVoiceEntry

Protected handleVoiceEntryArticulations

Protected handleVoiceEntryLyrics

Protected handleVoiceEntryOrnaments

Protected handleVoiceEntryTechnicalInstructions

Protected initGraphicalMeasuresCreation

  • initGraphicalMeasuresCreation(): void

initialize

Protected layoutArticulationMarks

Protected layoutBeams

Protected layoutGraphicalTie

  • layoutGraphicalTie(tie: GraphicalTie, tieIsAtSystemBreak: boolean): void

Protected layoutMeasureWithWholeRest

Protected layoutOrnament

Protected layoutSingleRepetitionEnding

Protected layoutStaffEntry

Protected layoutVoiceEntries

Protected layoutVoiceEntry

Protected maxInstrNameLabelLength

  • maxInstrNameLabelLength(): number

Protected optimizeDistanceBetweenStaffLines

  • optimizeDistanceBetweenStaffLines(musicSystem: MusicSystem): void

Protected optimizeRestNotePlacement

Private optimizeRestPlacement

  • optimizeRestPlacement(): void

prepareGraphicalMusicSheet

  • prepareGraphicalMusicSheet(): void

Protected resetYPositionForLeadSheet

Private setBeamNotesWantedStemDirections

  • setBeamNotesWantedStemDirections(voiceEntry: VoiceEntry): void

Private setIndicesToVerticalGraphicalContainers

  • setIndicesToVerticalGraphicalContainers(): void

Protected updateStaffLineBorders

  • updateStaffLineBorders(staffLine: StaffLine): void

Protected updateStaffLinesRelativePosition

  • updateStaffLinesRelativePosition(musicSystem: MusicSystem, index: number, value: number): void

Static Protected setMeasuresMinStaffEntriesWidth

  • setMeasuresMinStaffEntriesWidth(measures: GraphicalMeasure[], minimumStaffEntriesWidth: number): void

Generated using TypeDoc