Options
All
  • Public
  • Public/Protected
  • All
Menu

Class OSMD

Hierarchy

  • OSMD

Index

Constructors

constructor

  • new OSMD(container: string | HTMLElement, autoResize?: boolean): OSMD
  • The easy way of displaying a MusicXML sheet music file

    autoresize

    automatically resize the sheet to full page width on window resize

    Parameters

    • container: string | HTMLElement

      is either the ID, or the actual "div" element which will host the music sheet

    • Default value autoResize: boolean = false

    Returns OSMD

Properties

Private canvas

canvas: HTMLCanvasElement

Private container

container: HTMLElement

cursor

cursor: Cursor

Private drawer

Private graphic

Private sheet

sheet: MusicSheet

zoom

zoom: number = 1

Methods

Private autoResize

  • autoResize(): void
  • Attach the appropriate handler to the window.onResize event

    Returns void

Private handleResize

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

    Parameters

    • startCallback: function

      is the function called when resizing starts

        • (): void
        • Returns void

    • endCallback: function

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

        • (): void
        • Returns void

    Returns void

load

  • load(content: string | Document): Promise<__type>
  • Load a MusicXML file

    Parameters

    • content: string | Document

      is either the url of a file, or the root node of a MusicXML document, or the string content of a .xml/.mxl file

    Returns Promise<__type>

render

  • render(): void

Private reset

  • reset(): void
  • Initialize this object to default values FIXME: Probably unnecessary

    Returns void

setLogLevel

  • setLogLevel(level: string): void
  • Sets the logging level for this OSMD instance. By default, this is set to warn.

    Parameters

    • level: string

    Returns void

Generated using TypeDoc