AbstractProtecteddynamicProtectedgraphicalProtectedgraphicalProtectedmusicProtectedrulesProtectedskyLazy 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.
ProtectedstaffProtectedstaffProtectedstaffProtectedstafflineTracks the pitches on each percussion staff, to put them on one line if there are few of them (PercussionOneLineCutoff).
ProtectedstaffProtectedcalcThe main method for the Calculator.
ProtectedcalculateReturns 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.
The staff entries whose chord symbols to align, e.g. of a staffline or measure (ChordSymbolYAlignmentScope).
The sky and bottom line calculator of the staffline of the staff entries.
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).
ProtectedcalculateProtectedcalculateSets 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.
The measure whose chord symbols to position.
The index of the measure in its staffline, to find the measures of the other staves in 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.
ProtectedcalculateProtectedcalculateCalculates the dashed lines after texts (MusicXML <dashes>, e.g. "cresc. - - - -" or "rit. - - - -", see Dashes) for
the texts placed so far, unless their line is calculated already. Called after each kind of text is placed (verbal
dynamics, words, tempo words), so that what is placed later stays clear of the lines (they update the sky/bottom line).
The line starts after its text, on the text's baseline (ExpressionDashesYOffsetFromTextCenter), and ends before its stop position.
In the systems after its text's, it goes on from the start of the staffline, placed by the sky/bottom line there,
with the text again in brackets if RenderExpressionDashesContinuationText is set.
ProtectedcalculateCalculates the dashed line after a placed text (see calculateDashedLinesAfterTexts()): its part in the text's staffline and the parts in the stafflines of the following systems up to its end, and updates the sky/bottom lines with them.
the line
the placed label of the text
the staffline of the label
ProtectedcalculateProtectedcalculateRe-adjust the x positioning of expressions.
Creates the labels of the fingerings above or below the notes (GraphicalStaffEntry.FingeringEntries), or removes the ones of the layout before when they aren't drawn anymore (EngravingRules.RenderFingerings off, e.g. by osmd.setOptions({drawFingerings: false}) after a render), or are drawn left or right of the notes instead.
ProtectedcalculateThis method calculates the RelativePosition of a single GraphicalContinuousDynamic.
Graphical continous dynamic to be calculated
Starting point in staff line
ProtectedcalculateThis method calculates the RelativePosition of a single GraphicalInstantaneousDynamicExpression.
Dynamic expression to be calculated
Starting point in staff line
ProtectedcalculateThis method calculates the RelativePosition of a single verbal GraphicalContinuousDynamic.
Graphical continous dynamic to be calculated
Starting point in staff line
ProtectedcalculateProtectedcalculatecalculates the dashes of lyric words and the extending underscore lines of syllables sung on more than one note.
ProtectedcalculateProtectedcalculateIterate through all Measures and calculates the MeasureNumberLabels.
ProtectedcalculateCalculates 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.
The minimum required x width of the source measure
ProtectedcalculateCalculate all the Mood and Unknown Expressions for a single [[MultiExpression]]: its words, drawn together in one label. A verbal crescendo or diminuendo at the same position (e.g. "cresc.") is not part of the label: it's drawn as a dynamic of its own (see calculateDynamicExpressions()).
ProtectedcalculateStore the newly computed [[Measure]]s in newly created [[MusicSystem]]s.
ProtectedcalculateProtectedcalculateProtectedcalculateProtectedcalculateProtectedcalculateCalculate a single OctaveShift for a [[MultiExpression]].
Protected AbstractcalculateCalculate a single Pedal for a [[MultiExpression]].
ProtectedcalculateCalculate the Lyrics YPositions for a single [[StaffLine]].
Protected AbstractcalculateCalculate a single Wavy Line for a [[MultiExpression]].
ProtectedcalculateProtectedcalculateProtectedcalculateProtectedcalculateProtectedcalculateCalculates a wedge that starts before the drawing range and ends in it or after it, see calculateWedgesStartingBeforeDrawingRange().
ProtectedcalculateCalculate all the textual [[RepetitionInstruction]]s (e.g. dal segno) for a single [[SourceMeasure]].
ProtectedcheckProtectedclearDelete 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...
Drop the lazy sky/bottom-line reuse cache (call when starting a fresh lazy session).
ProtectedclearProtectedcreateCreates the label of an expression's text (words, a tempo text ...) with its margins, not yet positioned: for calculateLabel(), which places it by the sky/bottom line, and placeWordsBesideSameTimeDynamic().
ProtectedcreateProtectedcreateProtectedcreateProtectedformatProtectedgetReturns where a dashed line after a text (see Dashes) ends: the last measure it reaches and the x position of its end relative to that measure's staffline, ExpressionDashesEndPadding before the notes at its stop position or before the barline. A line that stops in a measure that isn't drawn ends with the last measure drawn before it. Undefined if the line has no stop or none of its measures is drawn.
the line
the index of the staff in the sheet
ProtectedgetReturns the x position (relative to the staffline) up to which a dashed line after a text (see Dashes) runs in the staffline of its text: its end, or the end of the staffline if it goes on in a later system. Undefined if no line is drawn (RenderExpressionDashes, a line without a stop).
ProtectedgetProtectedgetProtectedgraphicalProtectedhandleProtectedhandleThis method handles a [[StaffEntryLink]].
ProtectedhandleCheck if the tied graphical note belongs to any beams or tuplets and react accordingly.
ProtectedhandleProtectedhandleProtectedhandleProtectedhandleCreates the graphical lyrics of the voice entry at the staff entry.
true to leave out the verses that the staff entry has lyrics of already, e.g. for the lyrics of a hidden voice under the visible notes, see handleLyricsOfLeftOutVoices()
ProtectedhandleProtectedhandleAdds a technical instruction at the given staff entry.
ProtectedinitCalled for every source measure when generating the list of staff measures for it.
ProtectedisWhether two metronome marks print the same: note equations by their notes rather than their playback tempo, other marks by beat unit and bpm.
ProtectedisWhether tempo text has already been placed at this position, typically from another part.
ProtectedlayoutProtectedlayoutProtectedlayoutCalculate the shape (Bézier curve) for this tie.
ProtectedlayoutDo layout on staff measures which only consist of a full rest.
ProtectedlayoutProtectedlayoutProtectedlayoutCalculate a single GraphicalRepetition.
ProtectedlayoutProtectedlayoutLays out a tie into a note that ends a tie without a start note (see Note.TieStopWithoutStartDirection).
The note the tie ends at.
ProtectedlayoutProtectedlayoutProtectedmaxWhether the multiple rest measures fit the draw range from the first to the last measure to draw (source measure indices, see EngravingRules.MinMeasureToDrawIndex and MaxMeasureToDrawIndex): they begin and end with the measures to draw they were made for (see prepareGraphicalMusicSheet()), so they have to be made again (osmd.render() creates the graphic again) for a draw range that begins or ends inside one, or after one was divided for the previous draw range.
ProtectedoptimizeProtectedplaceWords and an instantaneous dynamic of the same staff, placement and time are one phrase, engraved on one line, e.g.
"più f" or "p dolce": the words go on the dynamic's line, next to it, in the order of the file: the order of the
<direction-type>s in a <direction>, which MusicXML defines as their visual order, or of two <direction>s.
Before, the words were placed at the bottom (sky) line, which the dynamic had raised there, and went under (over) it,
e.g. "f" with "piu" below it (#1913).
The dynamic stays at its note. Words before the dynamic reach to the left of it, also across the barline (Gould,
Behind Bars, p. 103), words after it to the right. Where the notes, slurs etc. of the measure reach into the words
on that line, the words and the dynamic move away from the staff together.
The words keep the current placement (under or over the dynamic) where there's no room on the line: at the start of
the staff or beyond its end, where the words would run into another expression (a dynamic, wedge or words placed
before them), and where the move away from the staff would take the dynamic off the line of words placed beside it
before (a second words at the dynamic). Words that the file puts more than a staff space from the dynamic
(default-y and relative-y, e.g. a fingering written as words under the dynamic) and words of several lines stay on
their own line.
the words' MultiExpression
the words' measure on staffLine
the text of the words
the first words' expression (its position in the file)
the words' label, positioned, or undefined if the words aren't placed beside a dynamic
Build the 2D [[GraphicalMeasure]] list needed for the [[MusicSheetCalculator]]. Internally it creates [[GraphicalMeasure]]s, [[GraphicalStaffEntry]]'s and [[GraphicalNote]]s.
ProtectedreserveReserves the room of the beams between staves in the sky and bottom lines (see VexFlowMeasure.reserveCrossStaffBeamSpace()).
ProtectedreserveProtectedresetProtectedskyStable 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). The measures are named by their index in SourceMeasures, not their number, which can repeat (e.g. it starts again at 1 after a final barline with EngravingRules.NewPartAndSystemAfterFinalBarline: a system of the second part got the lines of the first part's system with the same measure numbers), an extra measure at the system end (a key or time signature of the next system) by the index of the measure it follows and an "x", as in its SVG group's id.
Protected AbstractupdateUpdates the bottom lines with the space the pedals take, after all of them are placed by calculateSinglePedal().
ProtectedupdateStaticlabelWhere the baseline of a label's first line of text is, relative to the label's position: the drawer puts the text's top at the position, shifted up for a bottom or center alignment so that the text is in the label's box, with 0.2 font heights under the last baseline for the descenders (see MusicSheetDrawer.drawLabel()), and draws the text with its baseline a font height below its top.
Protected Staticset
Class used to do all the calculations in a MusicSheet, which in the end populates a GraphicalMusicSheet.