Options
All
  • Public
  • Public/Protected
  • All
Menu

Class OpenSheetMusicDisplay

The main class and control point of OpenSheetMusicDisplay.
It can display MusicXML sheet music files in an HTML element container.
After the constructor, use load() and render() to load and render a MusicXML file.

Hierarchy

  • OpenSheetMusicDisplay

Index

Constructors

constructor

  • Creates and attaches an OpenSheetMusicDisplay object to an HTML element container.
    After the constructor, use load() and render() to load and render a MusicXML file.

    Parameters

    • container: string | HTMLElement

      The container element OSMD will be rendered into.
      Either a string specifying the ID of an HTML container element,
      or a reference to the HTML element itself (e.g. div)

    • Default value options: IOSMDOptions = OSMDOptions.OSMDOptionsStandard()

      An object for rendering options like the backend (svg/canvas) or autoResize.
      For defaults see the OSMDOptionsStandard method in the OSMDOptions class.

    Returns OpenSheetMusicDisplay

Properties

Private autoResizeEnabled

autoResizeEnabled: boolean

Private backend

Private canvas

canvas: HTMLElement

Private container

container: HTMLElement

cursor

cursor: Cursor

Private drawer

Private drawingParameters

drawingParameters: DrawingParameters

Private followCursor

followCursor: boolean

Private graphic

Private innerElement

innerElement: HTMLElement

Private resizeHandlerAttached

resizeHandlerAttached: boolean

Private sheet

sheet: MusicSheet

Private version

version: string = "0.7.3-release"

zoom

zoom: number = 1

Accessors

AutoResizeEnabled

  • get AutoResizeEnabled(): boolean
  • set AutoResizeEnabled(value: boolean): void

DrawBottomLine

  • get DrawBottomLine(): boolean
  • set DrawBottomLine(value: boolean): void

DrawBoundingBox

  • get DrawBoundingBox(): string
  • set DrawBoundingBox(value: string): void

DrawSkyLine

  • get DrawSkyLine(): boolean
  • set DrawSkyLine(value: boolean): void

Drawer

DrawingParameters

EngravingRules

FollowCursor

  • get FollowCursor(): boolean
  • set FollowCursor(value: boolean): void

GraphicSheet

Sheet

Version

  • get Version(): string

Methods

IsReadyToRender

  • IsReadyToRender(): boolean

Private autoResize

  • autoResize(): void

clear

  • clear(): void

enableOrDisableCursor

  • enableOrDisableCursor(enable: boolean): void

getLogLevel

  • getLogLevel(): number

Private handleResize

  • handleResize(startCallback: () => void, endCallback: () => void): void
  • Helper function for managing window's onResize events

    Parameters

    • startCallback: () => void

      is the function called when resizing starts

        • (): void
        • Returns void

    • endCallback: () => void

      is the function called when resizing (kind-of) ends

        • (): void
        • Returns void

    Returns void

load

  • load(content: string | Document): Promise<__type>

render

  • render(): void

Private reset

  • reset(): void

setColoringMode

setLogLevel

  • setLogLevel(level: string): void

setOptions

  • Set OSMD rendering options using an IOSMDOptions object. Can be called during runtime. Also called by constructor. For example, setOptions({autoResize: false}) will disable autoResize even during runtime.

    Parameters

    Returns void

updateGraphic

  • updateGraphic(): void

Generated using TypeDoc