Class VexFlow

Hierarchy

  • VexFlow

Constructors

Properties

Accidental: typeof Accidental = Accidental
Annotation: typeof Annotation = Annotation
AnnotationHorizontalJustify: typeof AnnotationHorizontalJustify = AnnotationHorizontalJustify
AnnotationVerticalJustify: typeof AnnotationVerticalJustify = AnnotationVerticalJustify
Articulation: typeof Articulation = Articulation
BUILD: {
    DATE: string;
    ID: string;
    INFO: string;
    VERSION: string;
} = ...

Type declaration

  • DATE: string
  • ID: string
  • INFO: string
  • VERSION: string
BarNote: typeof BarNote = BarNote
Barline: typeof Barline = Barline
BarlineType: typeof BarlineType = BarlineType
Beam: typeof Beam = Beam
Bend: typeof Bend = Bend
BoundingBox: typeof BoundingBox = BoundingBox
CanvasContext: typeof CanvasContext = CanvasContext
ChordSymbol: typeof ChordSymbol = ChordSymbol
ChordSymbolHorizontalJustify: typeof ChordSymbolHorizontalJustify = ChordSymbolHorizontalJustify
ChordSymbolVerticalJustify: typeof ChordSymbolVerticalJustify = ChordSymbolVerticalJustify
Clef: typeof Clef = Clef
ClefNote: typeof ClefNote = ClefNote
Crescendo: typeof Crescendo = Crescendo
Curve: typeof Curve = Curve
CurvePosition: typeof CurvePosition = CurvePosition
Dot: typeof Dot = Dot
EasyScore: typeof EasyScore = EasyScore
Element: typeof Element = Element
Factory: typeof Factory = Factory
Font: typeof Font = Font
FontStyle: typeof FontStyle = FontStyle
FontWeight: typeof FontWeight = FontWeight
Formatter: typeof Formatter = Formatter
Fraction: typeof Fraction = Fraction
FretHandFinger: typeof FretHandFinger = FretHandFinger
GhostNote: typeof GhostNote = GhostNote
GlyphNote: typeof GlyphNote = GlyphNote
Glyphs: typeof Glyphs = Glyphs
GraceNote: typeof GraceNote = GraceNote
GraceNoteGroup: typeof GraceNoteGroup = GraceNoteGroup
GraceTabNote: typeof GraceTabNote = GraceTabNote
KeyManager: typeof KeyManager = KeyManager
KeySigNote: typeof KeySigNote = KeySigNote
KeySignature: typeof KeySignature = KeySignature
Modifier: typeof Modifier = Modifier
ModifierContext: typeof ModifierContext = ModifierContext
ModifierPosition: typeof ModifierPosition = ModifierPosition
MultiMeasureRest: typeof MultiMeasureRest = MultiMeasureRest
Music: typeof Music = Music
Note: typeof Note = Note
NoteHead: typeof NoteHead = NoteHead
NoteSubGroup: typeof NoteSubGroup = NoteSubGroup
Ornament: typeof Ornament = Ornament
Parenthesis: typeof Parenthesis = Parenthesis
Parser: typeof Parser = Parser
PedalMarking: typeof PedalMarking = PedalMarking
Registry: typeof Registry = Registry
RenderContext: typeof RenderContext = RenderContext
Renderer: typeof Renderer = Renderer
RendererBackends: typeof RendererBackends = RendererBackends
RendererLineEndType: typeof RendererLineEndType = RendererLineEndType
RepeatNote: typeof RepeatNote = RepeatNote
Repetition: typeof Repetition = Repetition
RuntimeError: typeof RuntimeError = RuntimeError
SVGContext: typeof SVGContext = SVGContext
Stave: typeof Stave = Stave
StaveConnector: typeof StaveConnector = StaveConnector
StaveHairpin: typeof StaveHairpin = StaveHairpin
StaveLine: typeof StaveLine = StaveLine
StaveModifier: typeof StaveModifier = StaveModifier
StaveModifierPosition: typeof StaveModifierPosition = StaveModifierPosition
StaveNote: typeof StaveNote = StaveNote
StaveTempo: typeof StaveTempo = StaveTempo
StaveText: typeof StaveText = StaveText
StaveTie: typeof StaveTie = StaveTie
Stem: typeof Stem = Stem
StringNumber: typeof StringNumber = StringNumber
Stroke: typeof Stroke = Stroke
SymbolModifiers: typeof SymbolModifiers = SymbolModifiers
System: typeof System = System
TabNote: typeof TabNote = TabNote
TabSlide: typeof TabSlide = TabSlide
TabStave: typeof TabStave = TabStave
TabTie: typeof TabTie = TabTie
Test: undefined = undefined
TextBracket: typeof TextBracket = TextBracket
TextBracketPosition: typeof TextBracketPosition = TextBracketPosition
TextDynamics: typeof TextDynamics = TextDynamics
TextJustification: typeof TextJustification = TextJustification
TextNote: typeof TextNote = TextNote
TickContext: typeof TickContext = TickContext
TimeSigNote: typeof TimeSigNote = TimeSigNote
TimeSignature: typeof TimeSignature = TimeSignature
Tremolo: typeof Tremolo = Tremolo
Tuning: typeof Tuning = Tuning
Tuplet: typeof Tuplet = Tuplet
Vibrato: typeof Vibrato = Vibrato
VibratoBracket: typeof VibratoBracket = VibratoBracket
Voice: typeof Voice = Voice
VoiceMode: typeof VoiceMode = VoiceMode
Volta: typeof Volta = Volta
VoltaType: typeof VoltaType = VoltaType

Accessors

  • get NOTATION_FONT_SCALE(): number
  • Returns number

  • set NOTATION_FONT_SCALE(value): void
  • Parameters

    • value: number

    Returns void

  • get RENDER_PRECISION_PLACES(): number
  • Returns number

  • set RENDER_PRECISION_PLACES(precision): void
  • Parameters

    • precision: number

    Returns void

  • get RESOLUTION(): number
  • Returns number

  • set RESOLUTION(value): void
  • Parameters

    • value: number

    Returns void

  • get SLASH_NOTEHEAD_WIDTH(): number
  • Returns number

  • set SLASH_NOTEHEAD_WIDTH(value): void
  • Parameters

    • value: number

    Returns void

  • get SOFTMAX_FACTOR(): number
  • Returns number

  • set SOFTMAX_FACTOR(factor): void
  • Parameters

    • factor: number

    Returns void

  • get STAVE_LINE_DISTANCE(): number
  • Returns number

  • set STAVE_LINE_DISTANCE(value): void
  • Parameters

    • value: number

    Returns void

  • get STAVE_LINE_THICKNESS(): number
  • Returns number

  • set STAVE_LINE_THICKNESS(value): void
  • Parameters

    • value: number

    Returns void

  • get STEM_HEIGHT(): number
  • Returns number

  • set STEM_HEIGHT(value): void
  • Parameters

    • value: number

    Returns void

  • get STEM_WIDTH(): number
  • Returns number

  • set STEM_WIDTH(value): void
  • Parameters

    • value: number

    Returns void

  • get TABLATURE_FONT_SCALE(): number
  • Returns number

  • set TABLATURE_FONT_SCALE(value): void
  • Parameters

    • value: number

    Returns void

  • get UNISON(): boolean
  • Returns boolean

  • set UNISON(unison): void
  • Parameters

    • unison: boolean

    Returns void

  • get unicode(): Record<string, string>
  • Returns Record<string, string>

Methods

  • Parameters

    • clef: string

    Returns {
        lineShift: number;
    }

    • lineShift: number
  • Parameters

    • duration: string

    Returns number

  • Returns string[]

  • Returns Record<string, {
        acc?: string;
        num: number;
    }>

  • Parameters

    • spec: string

    Returns boolean

  • Parameters

    • key: string
    • Optional clef: string
    • Optional params: any

    Returns any

  • Parameters

    • spec: string

    Returns {
        line: number;
        type: string;
    }[]

  • Load the fonts that are used by your app.

    Call this if you are using vexflow-core.js to take advantage of lazy loading for fonts.

    If you are using vexflow.js or vexflow-bravura.js, this method is unnecessary, since they already call loadFonts(...) and setFonts(...) for you.

    If fontNames is undefined, all fonts in Font.FILES will be loaded. This is useful for debugging, but not recommended for production because it will load lots of fonts.

    For example, on the flow.html test page, you could call: await VexFlow.loadFonts();

    Alternatively, you may load web fonts with a stylesheet link (e.g., from Google Fonts), and a @font-face { font-family: ... } rule in your CSS.

    Customize Font.HOST_URL and Font.FILES to load different fonts for your app.

    Parameters

    • Rest ...fontNames: string[]

    Returns Promise<void>

  • Call this if you are using vexflow-core.js to take advantage of lazy loading for fonts.

    vexflow.js and vexflow-bravura.js already call setFonts('Bravura', 'Academico'), so you only need to call this when switching fonts.

    Example:

    await VexFlow.loadFonts('Bravura', 'Academico', 'Petaluma', 'Petaluma Script');
    VexFlow.setFonts('Bravura', 'Academico');
    ... render a score in Bravura ...
    VexFlow.setFonts('Petaluma', 'Petaluma Script');
    ... render a score in Petaluma...

    See demos/fonts/ for more examples.

    Parameters

    • Rest ...fontNames: string[]

    Returns void