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)
An object for rendering options like the backend (svg/canvas) or autoResize.
For defaults see the OSMDOptionsStandard method in the OSMDOptions class.
A function that is executed when the XML has been read.
The return value will be used as the actual XML OSMD parses,
so you can make modifications to the xml that OSMD will use.
Note that this is (re-)set on osmd.setOptions as {return xml}
, unless you specify the function in the options.
Options from which OSMD creates cursors in enableOrDisableCursors().
Timeout in milliseconds used in osmd.load(string) when string is a URL.
Standard page format options like A4 or Letter, in portrait and landscape. E.g. PageFormatStandards["A4_P"] or PageFormatStandards["Letter_L"].
Returns the version of OSMD this object is built from (the version you are using).
States whether the render() function can be safely called.
Attach the appropriate handler to the window.onResize event
Clears what OSMD has drawn on its canvas.
Enable or disable (hide) the cursor.
whether to enable (true) or disable (false) the cursor
Helper function for managing window's onResize events
is the function called when resizing starts
is the function called when resizing (kind-of) ends
Load a MusicXML file
is either the url of a file, or the root node of a MusicXML document, or the string content of a .xml/.mxl file
is used as the title for the piece if there is no title in the XML.
Render the loaded music sheet to the container.
Initialize this object to default values FIXME: Probably unnecessary
Sets the logging level for this OSMD instance. By default, this is set to warn
.
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.
Sets page format by string. Used by setOptions({pageFormat: "A4_P"}) for example.
(Re-)creates the graphic sheet from the music sheet
Generated using TypeDoc
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.