Options
All
  • Public
  • Public/Protected
  • All
Menu

Class InstrumentReader

An InstrumentReader is used during the reading phase to keep parsing new measures from the MusicXML file with the readNextXmlMeasure method.

Hierarchy

  • InstrumentReader

Index

Constructors

constructor

Properties

Private abstractInstructions

abstractInstructions: [number, AbstractNotationInstruction][] = []

Private activeClefs

activeClefs: ClefInstruction[]

Private activeClefsHaveBeenInitialized

activeClefsHaveBeenInitialized: boolean[]

Private activeKey

activeKey: KeyInstruction

Private activeKeyHasBeenInitialized

activeKeyHasBeenInitialized: boolean = false

Private activeRhythm

activeRhythm: RhythmInstruction

Private currentMeasure

currentMeasure: SourceMeasure

Private currentStaff

currentStaff: Staff

Private currentStaffEntry

currentStaffEntry: SourceStaffEntry

Private currentVoiceGenerator

currentVoiceGenerator: VoiceGenerator

Private currentXmlMeasureIndex

currentXmlMeasureIndex: number = 0

Private divisions

divisions: number = 0

Private expressionReaders

expressionReaders: ExpressionReader[]

Private inSourceMeasureInstrumentIndex

inSourceMeasureInstrumentIndex: number

Private instrument

instrument: Instrument

Private maxTieNoteFraction

maxTieNoteFraction: Fraction

Private musicSheet

musicSheet: MusicSheet

Private openChordSymbolContainers

openChordSymbolContainers: ChordSymbolContainer[] = []

Private previousMeasure

previousMeasure: SourceMeasure

Private repetitionInstructionReader

repetitionInstructionReader: RepetitionInstructionReader

Private slurReader

slurReader: SlurReader

Private staffMainVoiceGeneratorDict

staffMainVoiceGeneratorDict:

Type declaration

Private voiceGeneratorsDict

voiceGeneratorsDict:

Type declaration

Private xmlMeasureList

xmlMeasureList: IXmlElement[]

Accessors

ActiveKey

ActiveRhythm

MaxTieNoteFraction

Methods

Private addAbstractInstruction

  • addAbstractInstruction(node: IXmlElement, guitarPro: boolean): void

Private createDefaultClefInstruction

  • createDefaultClefInstruction(staffIndex: number): void

Private createDefaultKeyInstruction

  • createDefaultKeyInstruction(): void

Private createExpressionGenerators

  • createExpressionGenerators(numberOfStaves: number): void

doCalculationsAfterDurationHasBeenSet

  • doCalculationsAfterDurationHasBeenSet(): void

Private getNoteDurationForTuplet

Private getNoteDurationFromTypeNode

Private getOrCreateVoiceGenerator

  • getOrCreateVoiceGenerator(voiceId: number, staffId: number): VoiceGenerator

Private isAttributesNodeAtBeginOfMeasure

Private isAttributesNodeAtEndOfMeasure

parseXmlColor

  • parseXmlColor(xmlColorString: string): string
  • Parse a color in XML format. Can be #ARGB or #RGB format, colors as byte hex values.

    Parameters

    • xmlColorString: string

    Returns string

    color in Vexflow format #[A]RGB or undefined for invalid xmlColorString

Private readDivisionsFromNotes

  • readDivisionsFromNotes(): number
  • Calculate the divisions value from the type and duration of the first MeasureNote that makes sense (meaning itself hasn't any errors and it doesn't belong to a Tuplet).

    If all the MeasureNotes belong to a Tuplet, then we read the next XmlMeasure (and so on...). If we have reached the end of the Instrument and still the divisions aren't set, we throw an exception

    Returns number

Private readExpressionStaffNumber

  • readExpressionStaffNumber(xmlNode: IXmlElement): number

readNextXmlMeasure

  • readNextXmlMeasure(currentMeasure: SourceMeasure, measureStartAbsoluteTimestamp: Fraction, guitarPro: boolean): boolean

Private saveAbstractInstructionList

  • saveAbstractInstructionList(numberOfStaves: number, beginOfMeasure: boolean): void

Private saveClefInstructionAtEndOfMeasure

  • saveClefInstructionAtEndOfMeasure(): void

Generated using TypeDoc