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 inSourceMeasureInstrumentIndex

inSourceMeasureInstrumentIndex: number

Private instrument

instrument: Instrument

Private maxTieNoteFraction

maxTieNoteFraction: Fraction

Private musicSheet

musicSheet: MusicSheet

Private openChordSymbolContainer

openChordSymbolContainer: ChordSymbolContainer

Private previousMeasure

previousMeasure: SourceMeasure

Private slurReader

slurReader: any

Private staffMainVoiceGeneratorDict

staffMainVoiceGeneratorDict: object

Type declaration

Private voiceGeneratorsDict

voiceGeneratorsDict: object

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

doCalculationsAfterDurationHasBeenSet

  • doCalculationsAfterDurationHasBeenSet(): void

Private getNoteDurationForTuplet

Private getNoteDurationFromTypeNode

Private getOrCreateVoiceGenerator

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

Private isAttributesNodeAtBeginOfMeasure

Private isAttributesNodeAtEndOfMeasure

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

readNextXmlMeasure

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

Private saveAbstractInstructionList

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

Private saveClefInstructionAtEndOfMeasure

  • saveClefInstructionAtEndOfMeasure(): void

Generated using TypeDoc