ProtecteddynamicProtectedgraphicalProtectedgraphicalProtectedmusicProtectedrulesProtectedskyLazy 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).
ProtectedstaffProtectedcalcCalculates the layout, with this instance's VexFlow settings (see VexFlowConverter.applyRulesToVexFlow()): another OSMD instance on the page may have set its own since this one's last layout.
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
ProtectedcalculateOptionalpreviousLyricOverflows: number[]
Per-verse-index array ([verseIndex]) holding how far the
previous measure's last lyric extends past its bar line into this measure (in pre-elongation
units, +dashSpace if mid-word). Used to seed lastLyricEntryDict so the first lyric in this
measure is forced to leave clearance from the overhang.
OptionalpreviousChordOverflows: number[]
Same as previousLyricOverflows but for chord symbols.
factor: regular elongation factor from within-measure spacing constraints (subject to
MaximumLyricsElongationFactor cap by the caller).
lastLyricEntryDict / lastChordEntryDict: final state of the per-verse last-entry
dicts after processing. The caller uses these (with the post-cap measure width) to
compute the overflows passed into the next measure's call.ProtectedcalculateRe-adjust the x positioning of expressions. Update the skyline afterwards
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.
This 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 vertically aligned staff measures. This method is called within calculateXLayout. The staff entries are aligned with minimum needed x distances. The MinimumStaffEntriesWidth of every measure will be set - needed for system building. Prepares the VexFlow formatter for later formatting Does not calculate measure width from lyrics (which is called from MusicSheetCalculator)
the minimum required x width of the source measure (=list of staff measures)
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]].
ProtectedcalculateCalculate a single Pedal for a [[MultiExpression]].
ProtectedcalculateCalculate the Lyrics YPositions for a single [[StaffLine]].
ProtectedcalculateCalculate a single Wavy Line for a [[MultiExpression]].
ProtectedcalculateProtectedcalculateProtectedcalculateProtectedcalculateProtectedcalculateCalculates a wedge that starts before the drawing range (EngravingRules.MinMeasureToDrawIndex, e.g. drawFromMeasureNumber) and ends in it or after it: from the start of the first measure drawn on, like after a system break (see MusicSheetCalculator.calculateGraphicalContinuousDynamic()). The dynamic at its start isn't drawn.
the wedge (not a verbal one like "cresc.")
the index of the first measure drawn
the index of the wedge's staff
ProtectedcalculateCalculate all the textual and symbolic [[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().
ProtectedcreateProtectedcreateProtectedcreateProtectedfindFinds the first staffline measure with a note that can anchor an expression.
Find the Index of the item of the array of all VexFlow Slurs that holds a specified slur
ProtectedfindFinds the last staffline measure with a note that can anchor an expression.
ProtectedformatProtectedgetReturns 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).
ProtectedgetProtectedgetProtectedgraphicalProtectedhandleIs called if a note is part of a beam.
a list of all currently open beams
ProtectedhandleThis method handles a [[StaffEntryLink]].
ProtectedhandleCheck if the tied graphical note belongs to any beams or tuplets and react accordingly.
ProtectedhandleIs called if a note is part of a tuplet.
a list of all currently open tuplets
ProtectedhandleProtectedhandleAdd articulations to the given vexflow staff entry.
ProtectedhandleCreates 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()
ProtectedhandleProtectedhandleAdd technical instructions to the given vexflow staff entry.
ProtectedinitIs called at the begin of the method for creating the vertically aligned staff measures belonging to one source measure.
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.
Protectedlayoutadd here all given articulations to the VexFlowGraphicalStaffEntry and prepare them for rendering.
ProtectedlayoutProtectedlayoutCalculate the shape (Bezier curve) for this tie.
Whether this tie is for a tab note (guitar tabulature)
ProtectedlayoutDo layout on staff measures which only consist of a full rest.
ProtectedlayoutProtectedlayoutProtectedlayoutCalculate a single GraphicalRepetition.
ProtectedlayoutDo all layout calculations that have to be done per staff entry, like dots, ornaments, arpeggios.... This method is called after the voice entries are handled by layoutVoiceEntry().
ProtectedlayoutLays out a tie into a note that ends a tie without a start note: from the start of the measure, like the part of a tie continued in the next system (see layoutGraphicalTie()).
The note the tie ends at.
ProtectedlayoutProtectedlayoutCan be used to calculate articulations, stem directions, helper(ledger) lines, and overlapping note x-displacement. Is Excecuted per voice entry of a staff entry. After that layoutStaffEntry is called.
ProtectedmaxWhether 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.
ProtectedoptimizeProtectedplaceShifts a repetition instruction (VF.Repetition, e.g. Coda sign or "D.S. al Fine" text) above other objects in its range, e.g. chord symbols, which are calculated before the repetition instructions, or previously placed repetition instructions (see #1689). Shifted instructions reserve their space in the skyline, so that the staffline borders account for them. The horizontal and default vertical position replicate the drawing code in VexFlowPatch/src/staverepetition.js (drawSymbolText() etc).
the (uppermost) measure the repetition instruction was added to
the VexFlow repetition (stave modifier) to place, created by addWordRepetition()
ProtectedplaceWords 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
Creates the graphical measures, staff entries and notes, with this instance's VexFlow settings (see VexFlowConverter.applyRulesToVexFlow()): the VexFlow notes get their glyph scale when they are created.
ProtectedreserveReserve after calculateSkyBottomLines() replaces the skyline and before measure numbers are placed above it.
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.
ProtectedupdateUpdates the bottom lines with the space the pedals take, once all of them are placed (see calculatePedalSkyBottomLine()): under a sign down to a unit below it, under a line down to the line.
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.