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.
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.
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)
Optionaloptions: IOSMDOptions
An object for rendering options like the backend (svg/canvas) or autoResize.
For defaults see the OSMDOptionsStandard method in the [[OSMDOptions]] class.
Initialize this object to default values
FIXME: Probably unnecessary
Returns void
setColoringMode
setColoringMode(options): void
Parameters
options: IOSMDOptions
Returns void
setCustomPageFormat
setCustomPageFormat(width, height): void
Parameters
width: number
height: number
Returns void
setDrawBoundingBox
setDrawBoundingBox(value, render?): void
Parameters
value: string
Optionalrender: boolean
Returns void
setLogLevel
setLogLevel(level): void
Sets the logging level for this OSMD instance. By default, this is set to warn.
@param: content can be trace, debug, info, warn or error.
Parameters
level: string
Returns void
setOptions
setOptions(options): void
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
options: IOSMDOptions
Returns void
setPageFormat
setPageFormat(formatId): void
Sets page format by string. Used by setOptions({pageFormat: "A4_P"}) for example.
Parameters
formatId: string
Returns void
updateGraphic
updateGraphic(): void
(Re-)creates the graphic sheet from the music sheet
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.