Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IOSMDOptions

Possible options for the OpenSheetMusicDisplay constructor and osmd.setOptions(). None are mandatory. Note that after using setOptions(), you have to call osmd.render() again to make changes visible. Example: osmd.setOptions({defaultColorRest: "#AAAAAA", drawSubtitle: false}); osmd.render();

Hierarchy

  • IOSMDOptions

Index

Properties

Optional alignRests

alignRests: AlignRestOption | number

Whether to let Vexflow align rests to preceding or following notes (Vexflow option). Default false (0). This can naturally reduce collisions of rest notes with other notes. Auto mode (2) only aligns rests when there are multiple voices in a measure, and at least once at the same x-coordinate. Auto is the recommended setting, and would be default, if it couldn't in rare cases deteriorate rest placement for existing users. The on mode (1) always aligns rests, also changing their position when there is no simultaneous note at the same x-coordinate, which is nonstandard.

Optional autoBeam

autoBeam: boolean

Whether to automatically create beams for notes that don't have beams set in XML.

Optional autoBeamOptions

autoBeamOptions: AutoBeamOptions

Options for autoBeaming like whether to beam over rests. See AutoBeamOptions interface.

Optional autoResize

autoResize: boolean

Automatically resize score with canvas size. Default is true.

Optional backend

backend: string

Render Backend, will be SVG if given undefined, SVG or svg, otherwise Canvas.

Optional colorStemsLikeNoteheads

colorStemsLikeNoteheads: boolean

Whether to color the stems of notes the same as their noteheads

Optional coloringEnabled

coloringEnabled: boolean

Whether to enable coloring noteheads and stems, depending on coloringMode.

Optional coloringMode

coloringMode: ColoringModes

Defines the mode that is used for coloring: XML (0), Boomwhacker(1), CustomColorSet (2). Default XML. If coloringMode.CustomColorSet (2) is chosen, a coloringSetCustom parameter must be added.

Optional coloringSetCustom

coloringSetCustom: string[]

Set of 8 colors for automatic coloring of 7 notes from C to B + rest note in HTML form (e.g. "#00ff00" for green).

Optional defaultColorLabel

defaultColorLabel: string

Default color for Labels like title or lyrics. Default black (undefined).

Optional defaultColorNotehead

defaultColorNotehead: string

Default color for a note head (without stem). Default black (undefined). Only considered before loading a sample, not before render. To change the color after loading a sample and before render, use note(.sourceNote).NoteheadColor. The format is Vexflow format, either "#rrggbb" or "#rrggbbtt" where is transparency. All hex values. E.g., a half-transparent red would be "#FF000080", invisible would be "#00000000" or "#12345600".

Optional defaultColorRest

defaultColorRest: string

Default color for rests. Default black (undefined).

Optional defaultColorStem

defaultColorStem: string

Default color for a note stem. Default black (undefined).

Optional defaultColorTitle

defaultColorTitle: string

Default color for labels in the title. Overrides defaultColorLabel for title labels like composer. Default black (undefined).

Optional defaultFontFamily

defaultFontFamily: string

Default font used for text and labels, e.g. title or lyrics. Default Times New Roman Note that OSMD originally always used Times New Roman, so things like layout and spacing may still be optimized for it. Valid options are CSS font families available in the browser used for rendering, e.g. Times New Roman, Helvetica.

Optional disableCursor

disableCursor: boolean

Don't show/load cursor. Will override disableCursor in drawingParameters.

Optional drawComposer

drawComposer: boolean

Whether to draw the composer name (top right of the score).

Optional drawCredits

drawCredits: boolean

Whether to draw credits (title, subtitle, composer, lyricist) (in future: copyright etc., see ).

Optional drawFingerings

drawFingerings: boolean

Whether to draw fingerings (only left to the note for now). Default true (unless solo part).

Optional drawFromMeasureNumber

drawFromMeasureNumber: number

Only draw measure n to m, where n is the number you specify.

Optional drawHiddenNotes

drawHiddenNotes: boolean

Whether to draw hidden/invisible notes (print-object="no" in XML). Default false. Not yet supported.

Optional drawLyricist

drawLyricist: boolean

Whether to draw the lyricist's name, if given (top left of the score).

Optional drawLyrics

drawLyrics: boolean

Whether to draw lyrics (and their extensions and dashes).

Optional drawMeasureNumbers

drawMeasureNumbers: boolean

Whether to draw measure numbers (labels). Default true. Draws a measure number label at first measure, system start measure, and every [measureNumberInterval] measures. See the [measureNumberInterval] option, default is 2.

Optional drawPartAbbreviations

drawPartAbbreviations: boolean

Whether to draw part (instrument) name abbreviations each system after the first. Only draws if drawPartNames. Default true.

Optional drawPartNames

drawPartNames: boolean

Whether to draw part (instrument) names.

Optional drawSlurs

drawSlurs: boolean

Whether to calculate extra slurs with bezier curves not covered by Vexflow slurs. Default true.

Optional drawSubtitle

drawSubtitle: boolean

Whether to draw the subtitle of the piece. If true, enables drawing Title as well.

Optional drawTitle

drawTitle: boolean

Whether to draw the title of the piece. If false, disables drawing Subtitle as well.

Optional drawUpToMeasureNumber

drawUpToMeasureNumber: number

Only draw measure n to m, where m is the number you specify.

Optional drawingParameters

drawingParameters: string | DrawingParametersEnum

Broad Parameters like compact or preview mode.

Optional fillEmptyMeasuresWithWholeRest

fillEmptyMeasuresWithWholeRest: FillEmptyMeasuresWithWholeRests | number

Whether to fill measures that don't have notes given in the XML with whole rests (visible = 1, invisible = 2, for layouting). Default No (0).

Optional fingeringInsideStafflines

fingeringInsideStafflines: boolean

For above/below fingerings, whether to draw them directly above/below notes (default), or above/below staffline.

Optional fingeringPosition

fingeringPosition: string

Where to draw fingerings (left, right, above, below, auto). Default left. Auto, above, below experimental (potential collisions because bounding box not correct)

Optional followCursor

followCursor: boolean

Follow Cursor: Scroll the page when cursor.next() is called and the cursor moves into a new system outside of the current view frame.

Optional measureNumberInterval

measureNumberInterval: number

The interval of measure numbers to draw, i.e. it draws the measure number above the beginning label every x measures. Default 2.

Optional setWantedStemDirectionByXml

setWantedStemDirectionByXml: boolean

Whether to set the wanted stem direction by xml (default) or automatically.

Optional tripletsBracketed

tripletsBracketed: boolean

Whether all triplets should be bracketed. Overrides tupletsBracketed for triplets. If false, only triplets given as bracketed in XML (bracket="yes") will be bracketed. (Bracketing all triplets can be cluttering)

Optional tupletsBracketed

tupletsBracketed: boolean

Whether all tuplets should be bracketed (e.g. |--5--| instead of 5). Default false. If false, only tuplets given as bracketed in XML (bracket="yes") will be bracketed.

Optional tupletsRatioed

tupletsRatioed: boolean

Whether tuplets are labeled with ratio (e.g. 5:2 instead of 5 for quintuplets). Default false.

Generated using TypeDoc