Options
All
  • Public
  • Public/Protected
  • All
Menu

Rendering and Engraving options, more fine-grained than IOSMDOptions. Not all of these options are meant to be modified by users of the library, full support is only given for IOSMDOptions. Nevertheless, there are many useful options here, like Render* to (not) render certain elements (e.g. osmd.rules.RenderRehearsalMarks = false)

Hierarchy

  • EngravingRules

Index

Constructors

Properties

Methods

Constructors

Properties

AlignRests: AlignRestOption

Whether to align rests. 0 = Never, 1 = Always, 2 = Auto. Currently not recommended because rests are now positioned to avoid collisions with notes.

AlwaysSetPreferredSkyBottomLineBackendAutomatically: boolean

Whether to always set preferred backend (WebGL or Plain) automatically, depending on browser and number of measures.

ArpeggioDistance: number
ArpeggiosGoAcrossVoices: boolean
ArticulationPlacementFromXML: boolean
AutoBeamNotes: boolean

Whether to automatically beam notes that don't already have beams in XML.

AutoBeamOptions: AutoBeamOptions

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

AutoBeamTabs: boolean

Whether to automatically generate new beams for tabs. Also see TabBeamsRendered for existing XML beams.

AutoGenerateMultipleRestMeasuresFromRestMeasures: boolean
BeamForwardLength: number
BeamSlopeMaxAngle: number
BeamSpaceWidth: number
BeamWidth: number
BetweenDotsDistance: number
BetweenKeySymbolsDistance: number
BetweenStaffDistance: number
BetweenStaffLinesDistance: number
BetweenSyllableMaximumDistance: number
BetweenSyllableMinimumDistance: number
BezierCurveStepSize: number
BreathMarkDistance: number

Percent distance of breath marks to next note or end of staff, e.g. 0.8 = 80%.

ChordAccidentalTexts: default<AccidentalEnum, string>
ChordOverlapAllowedIntoNextMeasure: number
ChordSymbolExtraXShiftForShortChordSymbols: number

Additional x-shift for short chord symbols (e.g. C, but not Eb/7), to appear more centered.

ChordSymbolExtraXShiftWidthThreshold: number

Threshold width below which to apply ChordSymbolExtraXShiftForShortChordSymbols.

ChordSymbolLabelTexts: default<ChordSymbolEnum, string>
ChordSymbolRelativeXOffset: number
ChordSymbolTextAlignment: TextAlignmentEnum
ChordSymbolTextHeight: number
ChordSymbolWholeMeasureRestXOffset: number

Offset to start of measure (barline) when chord symbol is on whole measure rest. An offset of 0 would place the chord symbol directly above the barline, so the default is ~1.2.

ChordSymbolWholeMeasureRestXOffsetMeasure1: number
ChordSymbolXSpacing: number
ChordSymbolYAlignment: boolean
ChordSymbolYAlignmentScope: string
ChordSymbolYOffset: number
ChordSymbolYPadding: number
ClefLeftMargin: number
ClefRightMargin: number
ColorBeams: boolean
ColorFlags: boolean
ColorStemsLikeNoteheads: boolean
ColoringEnabled: boolean
ColoringMode: ColoringModes
ColoringSetCurrent: default<number, string>
CompactMode: boolean
ContinuousDynamicTextHeight: number
ContinuousTempoTextHeight: number
CustomChords: CustomChord[]
DefaultColorChordSymbol: string
DefaultColorCursor: string
DefaultColorLabel: string
DefaultColorLyrics: string
DefaultColorMusic: string

Default color for all musical elements including key signature etc. Default undefined.

DefaultColorNotehead: string
DefaultColorRest: string
DefaultColorStem: string
DefaultColorTitle: string
DefaultFontFamily: string
DefaultFontStyle: FontStyles
DefaultVexFlowNoteFont: string
DisableWebGLInFirefox: boolean

Whether to consider using WebGL in Firefox in EngravingRules.setPreferredSkyBottomLineBackendAutomatically()

DisableWebGLInSafariAndIOS: boolean

Whether to consider using WebGL in Safari/iOS in EngravingRules.setPreferredSkyBottomLineBackendAutomatically()

DisplacedNoteMargin: number
DistanceBetweenAdjacentDynamics: number
DistanceBetweenDotAndLine: number
DistanceBetweenLastInstructionAndRepetitionBarline: number
DistanceBetweenNaturalAndSymbolWhenCancelling: number
DistanceBetweenVerticalSystemLines: number
DistanceOffsetBetweenTwoHorizontallyCrossedWedges: number
DurationDistanceDict: {} = {}

Type declaration

  • [_: number]: number
DurationScalingDistanceDict: {} = {}

Type declaration

  • [_: number]: number
DynamicExpressionMaxDistance: number
DynamicExpressionSpacer: number
ExpressionsUseXMLColor: boolean
FactorOne: number[]
FactorTwo: number[]
FillEmptyMeasuresWithWholeRest: number
FingeringInsideStafflines: boolean
FingeringLabelFontHeight: number
FingeringOffsetX: number
FingeringOffsetY: number
FingeringPaddingY: number
FingeringPosition: PlacementEnum

Where to draw fingerings (Above, Below, AboveOrBelow, Left, Right, or Auto). Default AboveOrBelow. Auto experimental.

FingeringPositionFromXML: boolean
FingeringPositionGrace: PlacementEnum
FingeringTextSize: number
FixedMeasureWidth: boolean

Use the same measure width for all measures (experimental). Note that this will use the largest width of all measures, as Vexflow will mess up the layout with overlays if using less than minimum width. See formatter.preCalculateMinTotalWidth()

FixedMeasureWidthFixedValue: number

Use a fixed width for all measures (experimental). This is mostly for debugging or for when you already know how big the measures in the target score are, because using a too low width will cause overlaps in Vexflow.

FixedMeasureWidthUseForPickupMeasures: boolean
FlatBeamOffset: number
FlatBeamOffsetPerBeam: number
FlatBeams: boolean
GlissandoDefaultWidth: number
GlissandoNoteOffset: number
GlissandoStafflineEndOffset: number
GlissandoStafflineStartMinimumWidth: number
GlissandoStafflineStartYDistanceToNote: number
GraceLineWidth: number
GraceNoteGroupXMargin: number
GraceNoteScalingFactor: number
GraceNoteXOffset: number
HorizontalBetweenLyricsDistance: number
IdealStemLength: number
IgnoreBracketsWords: boolean

Ignore brackets - e.g. ( ) - that were supposed to be around a note, but were inserted as a words element in the MusicXML, which can't be matched to the note anymore, and would otherwise just be placed somewhere else. See OSMD Issue 1251.

IgnoreRepeatedDynamics: boolean
InStaffClefScalingFactor: number
InstantaneousTempoTextHeight: number
InstrumentLabelTextHeight: number
KeyRightMargin: number
LabelMarginBorderFactor: number
LastSystemMaxScalingFactor: number
LedgerLineColorDefault: string
LedgerLineStrokeStyle: string
LedgerLineWidth: number
LyricOverlapAllowedIntoNextMeasure: number
LyricUnderscoreLineWidth: number
LyricsAlignmentStandard: TextAlignmentEnum

Default alignment of lyrics. Left alignments will extend text to the right of the bounding box, which facilitates spacing by extending measure width.

LyricsExtraXShiftForShortLyrics: number

Extra x-shift (to the right) for short lyrics to be better vertically aligned. Also see ChordSymbolExtraXShiftForShortChordSymbols, same principle, same default value.

LyricsExtraXShiftForShortLyricsWidthThreshold: number

Threshold of the lyric entry's width below which the x-shift is applied. Default 1.4.

LyricsHeight: number
LyricsUseXPaddingForLongLyrics: boolean

Whether to enable x padding (to the right) for notes with long lyrics, see LyricsXPaddingFactorForLongLyrics for the degree. This helps avoid overlaps and shorten measures, because otherwise the whole measure needs to be stretched to avoid overlaps, see MaximumLyricsElongationFactor

LyricsXPaddingFactorForLongLyrics: number

How much spacing/padding should be added after notes with long lyrics on short notes (>4 characters on <8th note), so that the measure doesn't need to be elongated too much to avoid lyrics collisions. Default 1 = 10 pixels

LyricsXPaddingForLastNoteInMeasure: boolean
LyricsXPaddingReductionForLastNoteInMeasure: number

Last note in measure needs less padding because of measure bar and bar start/end padding.

LyricsXPaddingReductionForLongNotes: number

Long notes need less padding than short ones, by default we use 0.7 less padding.

LyricsXPaddingWidthThreshold: number

How wide a text needs to be to trigger lyrics padding for short notes. This is visual width, not number of characters, as e.g. 'zzz' is wider than 'iii'. Default 3.3.

LyricsYMarginToBottomLine: number
LyricsYOffsetToStaffHeight: number
MaxInstructionsConstValue: number
MaxMeasureToDrawIndex: number
MaxMeasureToDrawNumber: number

The setting given in osmd.setOptions(), which may lead to a different index if there's a pickup measure.

MaxPageToDrawNumber: number
MaxSystemToDrawNumber: number
MaximumLyricsElongationFactor: number
MeasureDynamicsMaxScalingFactor: number
MeasureLeftMargin: number
MeasureNumberLabelHeight: number
MeasureNumberLabelOffset: number
MeasureNumberLabelXOffset: number
MeasureRightMargin: number
MetronomeMarkXShift: number
MetronomeMarkYShift: number
MetronomeMarksDrawn: boolean
MinMeasureToDrawIndex: number
MinMeasureToDrawNumber: number

The setting given in osmd.setOptions(), which may lead to a different index if there's a pickup measure. If there's a pickup measure (measure 0), and we want to draw from measure number 2, we need to skip measure index 0 (the pickup measure).

MinNoteDistance: number
MinSkyBottomDistBetweenStaves: number
MinSkyBottomDistBetweenSystems: number
MinimumCrossedBeamDifferenceMargin: number
MinimumDistanceBetweenDashes: number
MinimumDistanceBetweenSystems: number
MinimumNeededXspaceForTieGhostObject: number
MinimumStaffLineDistance: number
MoodTextHeight: number
MultipleRestMeasureAddKeySignature: boolean
MultipleRestMeasureDefaultWidth: number
NewPageAtXMLNewPageAttribute: boolean
NewPartAndSystemAfterFinalBarline: boolean
NewSystemAtXMLNewPageAttribute: boolean

Whether to begin a new system when a page break is given in XML ('new-page="yes"'), but newPageFromXML is false. Default false, because it can lead to nonsensical system breaks after a single measure, as OSMD does a different layout than the original music program exported from.

NewSystemAtXMLNewSystemAttribute: boolean
NoteDistances: number[] = ...
NoteDistancesScalingFactors: number[] = ...
NoteHelperLinesOffset: number
NoteToGraphicalNoteMap: default<number, GraphicalNote>
NoteToGraphicalNoteMapObjectCount: number = 0
OctaveShiftLineWidth: number
OctaveShiftOnWholeMeasureNoteUntilEndOfMeasure: boolean
OctaveShiftVerticalLineLength: number
OneMinusTPower3: number[]
OrnamentAccidentalScalingFactor: number
PageBackgroundColor: string
PageBottomMargin: number
PageFormat: PageFormat
PageHeight: number
PageLeftMargin: number
PagePlacementEnum: PagePlacementEnum
PageRightMargin: number
PageTopMargin: number
PageTopMarginNarrow: number
PercussionForceVoicesOneLineCutoff: number
PercussionOneLineCutoff: number

How many unique note positions a percussion score needs to have to not be rendered on one line. To always use 5 lines for percussion, set this to 0. (works unless the XML says 1)

PercussionOneLineXMLDisplayStepOctaveOffset: number
PercussionUseCajon2NoteSystem: boolean

Makes the score position notes on the 2 cajon stafflines, and use 2 stafflines even if PercussionOneLineCutoff set. Should only be set for cajon scores, as this will disable the PercussionOneLineCutoff.

PercussionUseXMLDisplayStep: boolean
PercussionXMLDisplayStepNoteValueShift: number
PickupMeasureRepetitionSpacing: number

The spacing between a repetition that is followed by an implicit/pickup/incomplete measure. (E.g. in a 4/4 time signature, a measure that repeats after the 3rd beat, continuing with a pickup measure)

PickupMeasureSpacingSingleNoteAddend: number

Multiplier for PickupMeasureRepetitionSpacing if there is only one note in the pickup measure. This usually needs a lot more space.

PickupMeasureWidthMultiplier: number
PlaceWordsInsideStafflineFromXml: boolean
PlaceWordsInsideStafflineYOffset: number
PreferredSkyBottomLineBatchCalculatorBackend: SkyBottomLineBatchCalculatorBackendType

The skyline and bottom-line batch calculation algorithm to use. Note that this can be overridden if AlwaysSetPreferredSkyBottomLineBackendAutomatically is true (which is the default).

RehearsalMarkFontSize: number
RehearsalMarkXOffset: number
RehearsalMarkXOffsetDefault: number
RehearsalMarkXOffsetSystemStartMeasure: number
RehearsalMarkYOffset: number
RehearsalMarkYOffsetDefault: number
RenderArpeggios: boolean
RenderChordSymbols: boolean
RenderClefsAtBeginningOfStaffline: boolean
RenderComposer: boolean

Whether to render a label for the composer of the piece at the top of the sheet.

RenderCopyright: boolean
RenderCount: number = 0

How many times osmd.render() was already called on the currently loaded score. Resets after osmd.load() (via osmd.reset()). Can be relevant for transposition or generally informative.

RenderFingerings: boolean
RenderGlissandi: boolean
RenderKeySignatures: boolean
RenderLyricist: boolean
RenderLyrics: boolean
RenderMeasureNumbers: boolean
RenderMeasureNumbersOnlyAtSystemStart: boolean
RenderMultipleRestMeasures: boolean
RenderPartAbbreviations: boolean
RenderPartNames: boolean
RenderPedals: boolean
RenderRehearsalMarks: boolean
RenderSingleHorizontalStaffline: boolean
RenderSlurs: boolean
RenderStringNumbersClassical: boolean

Whether to render string numbers in classical scores, i.e. not the string numbers in tabs, but e.g. for violin.

RenderSubtitle: boolean
RenderSystemLabelsAfterFirstPage: boolean

Whether two render system labels on page 2+. This doesn't affect the default endless PageFormat.

RenderTimeSignatures: boolean
RenderTitle: boolean
RepeatEndStartPadding: number
RepetitionAllowFirstMeasureBeginningRepeatBarline: boolean
RepetitionEndInstructionXShiftAsPercentOfStaveWidth: number

Adds a percent of the stave's width (e.g. 0.4 = 40%) to the x position of end instructions like Fine or D.C. al fine

RepetitionEndingLabelHeight: number
RepetitionEndingLabelXOffset: number
RepetitionEndingLabelYOffset: number
RepetitionEndingLineYLowerOffset: number
RepetitionEndingLineYUpperOffset: number
RepetitionSymbolsYOffset: number

Not always a symbol, can also be text (RepetitionInstruction). Keeping the name for backwards compatibility.

RestCollisionYPadding: number
RestoreCursorAfterRerender: boolean
RhythmRightMargin: number
SamplingUnit: number
SetWantedStemDirectionByXml: boolean
SheetAuthorHeight: number
SheetComposerHeight: number
SheetComposerSubtitleUseLegacyParsing: boolean

Whether to use the (deprecated) OSMD < 1.8.6 way of parsing and displaying subtitles and composer, which did not read multiple lines from XML credit-words tags. Option will probably be removed soon.

deprecated
SheetCopyrightHeight: number
SheetCopyrightMargin: number
SheetMaximumWidth: number

Maximum width of sheet / HTMLElement containing the score. Canvas is limited to 32767 in current browsers, though SVG isn't. Setting this to > 32767 will break the canvas backend (no problem if you only use SVG).

SheetMinimumDistanceBetweenTitleAndSubtitle: number
SheetSubtitleHeight: number
SheetTitleHeight: number

Height (size) of the sheet title.

ShowRhythmAgainAfterPartEndOrFinalBarline: boolean
SkyBottomLineBatchMinMeasures: number

The minimum number of measures in the sheet where the skyline and bottom-line batch calculation is enabled. Batch is faster for medium to large size scores, but slower for very short scores.

SkyBottomLineWebGLMinMeasures: number

The minimum number of measures in the sheet where WebGL will be used. WebGL is slower for short scores, but much faster for large ones. Note that WebGL is currently never used in Safari and Firefox, because it's always slower there.

SlurEndArticulationYOffset: number
SlurHeightFactor: number
SlurHeightFlattenLongSlursCutoffAngle: number
SlurHeightFlattenLongSlursCutoffWidth: number
SlurHeightFlattenLongSlursFactorByAngle: number
SlurHeightFlattenLongSlursFactorByWidth: number
SlurMaximumYControlPointDistance: number
SlurNoteHeadYOffset: number
SlurPlacementAtStems: boolean
SlurPlacementFromXML: boolean
SlurPlacementUseSkyBottomLine: boolean
SlurSlopeMaxAngle: number
SlurStartArticulationYOffsetOfArticulation: number
SlurStemXOffset: number
SlurTangentMaxAngle: number
SlurTangentMinAngle: number
SlursStartingAtSameStaffEntryYOffset: number
SoftAccentSizeFactor: number
SoftAccentWedgePadding: number
SoftmaxFactorVexFlow: number
SpacingBetweenTextLines: number
StaccatoScalingFactor: number
StaccatoShorteningFactor: number
StaffDistance: number
StaffHeight: number
StaffLineColor: string
StaffLineWidth: number
StaggerSameWholeNotes: boolean

Stagger (x-shift) whole notes that are the same note, but in different voices (show 2 instead of 1).

StemMargin: number
StemMaxLength: number
StemMinAllowedDistanceBetweenNoteHeadAndBeamLine: number
StemMinLength: number
StemNoteHeadBorderYOffset: number
StemWidth: number
StretchLastSystemLine: boolean
StringNumberOffsetY: number

This is not for tabs, but for classical scores, especially violin.

SubMeasureXSpacingThreshold: number
SystemBoldLineWidth: number
SystemComposerDistance: number
SystemDotWidth: number
SystemLabelsRightMargin: number
SystemLeftMargin: number
SystemLyricistDistance: number
SystemRepetitionEndingLineWidth: number
SystemRightMargin: number
SystemThinLineWidth: number
TPower3: number[]
TabBeamsRendered: boolean
TabFingeringsRendered: boolean
TabKeySignatureRendered: boolean
TabKeySignatureSpacingAdded: boolean

Whether space should be reserved as if there was a key signature. False basically only works for tab-only scores, as it prevents vertical x-alignment with other staves. False is more compact for tab-only scores.

TabStaffInterlineHeight: number
TabTimeSignatureRendered: boolean
TabTimeSignatureSpacingAdded: boolean

Whether space should be reserved as if there was a key signature. False basically only works for tab-only scores, as it prevents vertical x-alignment with other staves. False is more compact for tab-only scores.

TabTupletYOffsetBottom: number
TabTupletYOffsetEffects: number
TabTupletYOffsetTop: number

Additional offset applied to top tuplets (added to TabTupletYOffset). You could apply a negative offset if the piece doesn't have effects like bends, which often take some vertical space.

TabTupletsBracketed: boolean

Whether to show brackets in tab tuplets. To not render tab tuplets entirely, set TupletNumbersInTabs = false.

TempoChangeMeasureValidity: number
TempoContinousFactor: number
TempoYSpacing: number
TieGhostObjectWidth: number
TieHeightInterpolationD: number
TieHeightInterpolationK: number
TieHeightMaximum: number
TieHeightMinimum: number
TieYPositionOffsetFactor: number
TitleBottomDistance: number
TitleTopDistance: number
TremoloBuzzRollThickness: number
TremoloStrokeScale: number
TremoloYSpacingScale: number
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)

TupletLineWidth: number
TupletNumberAlwaysDisableAfterFirstMax: boolean
TupletNumberLabelHeight: number
TupletNumberLimitConsecutiveRepetitions: boolean
TupletNumberMaxConsecutiveRepetitions: number
TupletNumberUseShowNoneXMLValue: boolean

Whether to use the value or to ignore it.

TupletNumberYOffset: number
TupletNumbersInTabs: boolean

Whether to show tuplet numbers (and brackets) in tabs. Brackets can be disabled via TabTupletsBracketed.

TupletVerticalLineLength: number
TupletsBracketed: boolean

Whether tuplets (except triplets) should be bracketed (e.g. |--5--| instead of 5). Default false. Note that this doesn't affect triplets (|--3--|), which have their own setting TripletsBracketed. If false, only tuplets given as bracketed in XML (bracket="yes") will be bracketed. (If not given in XML, bracketing is implementation-dependent according to standard)

TupletsBracketedUseXMLValue: boolean

Whether to bracket like the XML says when 'bracket="no"' or "yes" is given. Otherwise, OSMD decides bracket usage. Note that sometimes the XML doesn't have any 'bracket' value.

TupletsRatioed: boolean

Whether tuplets should display ratio (3:2 instead of 3 for triplet). Default false.

UnknownTextHeight: number
UseEndOffsetForExpressions: boolean

Whether to use the XML offset value for expressions, especially wedges (crescendo). See #1477

UsePageBackgroundColorForTabNotes: boolean
UseXMLMeasureNumbers: boolean
VerticalBetweenLyricsDistance: number
VexFlowDefaultNotationFontScale: number
VexFlowDefaultTabFontScale: number
VoiceSpacingAddendVexflow: number
VoiceSpacingMultiplierVexflow: number
VoltaOffset: number
WedgeEndDistanceBetweenTimestampsFactor: number
WedgeHorizontalMargin: number
WedgeLineWidth: number
WedgeMeasureBeginOpeningLength: number
WedgeMeasureEndOpeningLength: number
WedgeMinLength: number
WedgeOpeningLength: number
WedgePlacementAboveY: number
WedgePlacementBelowY: number
WedgeVerticalMargin: number
WholeRestXShiftVexflow: number
unit: number = 1.0

A unit of distance. 1.0 is the distance between lines of a stave for OSMD, which is 10 pixels in Vexflow.

Methods

  • addChordName(altName: string, chordKindText: string, adds: string[], alts: string[], subs: string[]): void
  • applyDefaultColorMusic(color: string): void
  • Makes it so that all musical elements (including key/time signature) are colored with the given color by default, unless an element has a different color set (e.g. VoiceEntry.StemColor).

    Parameters

    • color: string

    Returns void

  • calculateCurveParametersArrays(): void
  • clearMusicSheetObjects(): void
  • loadDefaultValues(): void
  • renameChord(altName: string, newAltName: string): void
  • resetChordAccidentalTexts(chordAccidentalTexts: default<AccidentalEnum, string>, useChordAccidentalsUnicode: boolean): void
  • resetChordNames(): void
  • setPreferredSkyBottomLineBackendAutomatically(numberOfGraphicalMeasures?: number): void

Generated using TypeDoc