UNPKG

@stringsync/vexml

Version:

MusicXML to Vexflow

74 lines (73 loc) 3.16 kB
import { Beam } from './beam'; import { AccidentalType, Notehead, NoteType, Stem } from './enums'; import { NamedElement } from '../util'; import { Notations } from './notations'; import { Lyric } from './lyric'; import { TimeModification } from './timemodification'; /** * Contains graphical and musical information about a note. * * https://www.w3.org/2021/06/musicxml40/musicxml-reference/elements/note/ */ export declare class Note { private element; constructor(element: NamedElement<'note'>); /** Returns the stem of the note or null when missing or invalid. */ getStem(): Stem | null; /** Returns the type of note or null when missing or invalid. */ getType(): NoteType | null; /** Returns the duration of the note. Defaults to 4 */ getDuration(): number; /** Returns how many dots are on the note. */ getDotCount(): number; /** Returns the lyrics associated with the note. */ getLyrics(): Lyric[]; /** Whether or not the note is a grace note. */ isGrace(): boolean; /** Whether the note has a grace note. */ hasGrace(): boolean; /** Returns the notes that are part of this note's grace note. */ getGraceNotes(): Note[]; /** Whether or not the note has a glash slash. */ hasGraceSlash(): boolean; /** Returns the notations of the note. */ getNotations(): Notations[]; /** Returns the voice this note belongs to. */ getVoice(): string | null; /** Returns the stave the note belongs to. */ getStaveNumber(): number | null; /** Returns the step of the note. Defaults to 'C'. */ getStep(): string; /** Returns the octave of the note. Defaults to 4. */ getOctave(): number; /** * Returns the step and octave of the rest in the format `${step}/${octave}`. * * Defaults to null. This is intended to only be used for notes that contain a <rest> element. */ getRestDisplayPitch(): string | null; getRestDisplayStep(): string | null; getRestDisplayOctave(): number | null; /** Returns the accidental type of the note. Defaults to null. */ getAccidentalType(): AccidentalType | null; /** Returns the alteration of the note. Defaults to null. */ getAlter(): number | null; /** Whether or not the accidental is cautionary. Defaults to false. */ hasAccidentalCautionary(): boolean; /** Returns the notehead of the note. */ getNotehead(): Notehead | null; /** Whether or not the note is the first note of a chord. */ isChordHead(): boolean; /** Whether or not the note is part of a chord and *not* the first note of the chord. */ isChordTail(): boolean; /** Returns the rest of the notes in the chord iff the current note is a chord head. Defaults to an empty array. */ getChordTail(): Note[]; /** Returns whether or not the note is a rest. */ isRest(): boolean; /** Returns the beams of the note. */ getBeams(): Beam[]; /** Returns the time modification of the note. Defaults to null. */ getTimeModification(): TimeModification | null; /** Whether to print the object. Defaults to true. */ printObject(): boolean; }