OpenSheetMusicDisplay
    Preparing search index...

    Class VexFlowMusicSheetDrawer

    Draw a [[GraphicalMusicSheet]] (through the .drawSheet method)

    The drawing is implemented with a top-down approach, starting from a music sheet, going through pages, systems, staffs... ... and ending in notes, beams, accidentals and other symbols. It's worth to say, that this class just draws the symbols and graphical elements, using the positions that have been computed before. But in any case, some of these previous positioning algorithms need the sizes of the concrete symbols (NoteHeads, sharps, flats, keys...). Therefore, there are some static functions on the 'Bounding Boxes' section used to compute these symbol boxes at the beginning for the later use in positioning algorithms.

    This class also includes the resizing and positioning of the symbols due to user interaction like zooming or panning.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    bottomLineVisible: boolean = false
    drawableBoundingBoxElement: string = "None"
    drawingParameters: DrawingParameters
    graphicalMusicSheet: GraphicalMusicSheet
    LazyDrawFromXUnits: number = Number.NEGATIVE_INFINITY

    Lazy horizontal rendering (RenderSingleHorizontalStaffline): draw only graphical objects whose right edge x (in OSMD units) lies in (LazyDrawFromXUnits, LazyDrawToXUnits] -- the measures and spanning elements that first entered the drawn frontier this batch. ±Infinity (default) draws everything. Set by OpenSheetMusicDisplay.renderAppendGrowingHorizontal() per batch; reset after.

    LazyDrawSystemsFromIndex: number = -1

    Lazy rendering: when >= 0, drawPage() draws only the systems of (the first) page whose index is within [LazyDrawSystemsFromIndex, LazyDrawSystemsToIndexExcl), leaving the already-drawn systems above untouched in the shared backend. -1 (default) draws every system. Set by OpenSheetMusicDisplay.renderAppend() before each appended batch; reset to -1 after.

    LazyDrawSystemsToIndexExcl: number = Number.POSITIVE_INFINITY
    LazyDrawToXUnits: number = Number.POSITIVE_INFINITY
    LazyForcePageLabels: boolean = false

    Lazy horizontal rendering: when true, drawLabel() ignores the x-window gate. Scoped (set/restored) to the page-label loop in drawPage(), since those labels span the full page width and must all be drawn even though their left edges lie behind the final batch's frontier.

    LazySkipPageLabels: boolean = false

    Lazy horizontal rendering: when true, drawPage() skips the page-level labels (title/credits). They are drawn once, on the final batch, when the page has reached its full width and they sit at their final (re-centered) positions -- drawing them earlier would place them under a still-growing page.

    midiPlaybackAvailable: boolean
    skyLineVisible: boolean = false
    splitScreenLineColor: number
    textMeasurer: ITextMeasurer

    Accessors

    Methods

    • Lets a user/developer draw an overlay line on the score. Use this instead of drawLine, which is for OSMD internally only. The MusicPage has to be specified, because each page and Vexflow backend has its own relative coordinates. (the AbsolutePosition of a GraphicalNote is relative to its backend) To get a MusicPage, use GraphicalNote.ParentMusicPage.

      Parameters

      Returns Node

    • Draws the strokes ("tremolo beams") of tremolos between two notes in this measure, e.g. two alternating half notes with 3 strokes between them, often seen in orchestral string parts. (Vexflow doesn't support these tremolos, so we draw them ourselves here.) Also updates the SkyLine/BottomLine where the strokes exceed it.

      Parameters

      Returns void

    • Lazy horizontal rendering: whether an object with this bounding box falls in the current draw x-window (its right edge first entered the drawn frontier this batch). True when not lazy-horizontal.

      Parameters

      • rightXUnits: number

      Returns boolean

    • Lazy horizontal rendering: whether to draw the once-only left-edge system elements (instrument braces and group brackets). True for non-lazy and for the first lazy-horizontal batch, which owns the left edge (LazyDrawFromXUnits is -Infinity); false for continuation batches, so a single-system score's brace isn't redrawn on top of itself every batch. (Vertical lazy keeps the x-window at ±Infinity and draws each system's brace once via the per-system gate, so this stays true there.)

      Returns boolean

    • Renders a Label to the screen (e.g. Title, composer..)

      Parameters

      • graphicalLabel: GraphicalLabel

        holds the label string, the text height in units and the font parameters

      • layer: number

        is the current rendering layer. There are many layers on top of each other to which can be rendered. Not needed for now.

      • bitmapWidth: number

        Not needed for now.

      • bitmapHeight: number

        Not needed for now.

      • fontHeightInPixel: number
      • screenPosition: PointF2D

        the position of the lower left corner of the text in screen coordinates

      Returns Node

    • Renders a rectangle with the given style to the screen. It is given in screen coordinates.

      Parameters

      • rectangle: RectangleF2D

        the rect in screen coordinates

      • layer: number

        is the current rendering layer. There are many layers on top of each other to which can be rendered. Not needed for now.

      • styleId: number

        the style id

      • colorHex: string
      • alpha: number

        alpha value between 0 and 1

      Returns Node