Options
All
  • Public
  • Public/Protected
  • All
Menu

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

Properties

abstractInstructions: [number, AbstractNotationInstruction, Fraction][] = []
activeClefs: ClefInstruction[]
activeClefsHaveBeenInitialized: boolean[]
activeKey: KeyInstruction
activeKeyHasBeenInitialized: boolean = false
activeRhythm: RhythmInstruction
currentClefNumber: number = 1
currentMeasure: SourceMeasure
currentMultirestStartMeasure: SourceMeasure
currentStaff: Staff
currentStaffEntry: SourceStaffEntry
currentVoiceGenerator: VoiceGenerator
currentXmlMeasureIndex: number = 0
divisions: number = 0
expressionReaders: ExpressionReader[]
followingMultirestMeasures: number
inSourceMeasureInstrumentIndex: number
instrument: Instrument
maxTieNoteFraction: Fraction
musicSheet: MusicSheet
pluginManager: ReaderPluginManager
previousMeasure: SourceMeasure
repetitionInstructionReader: RepetitionInstructionReader
slurReader: SlurReader
staffMainVoiceGeneratorDict: {} = {}

Type declaration

voiceGeneratorsDict: {} = {}

Type declaration

xmlMeasureList: IXmlElement[]

Accessors

Methods

  • createDefaultClefInstruction(staffIndex: number): void
  • createDefaultKeyInstruction(): void
  • createExpressionGenerators(numberOfStaves: number): void
  • doCalculationsAfterDurationHasBeenSet(): void
  • getOrCreateVoiceGenerator(voiceId: number, staffId: number): VoiceGenerator
  • 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

  • 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

  • readExpressionStaffNumber(xmlNode: IXmlElement): number
  • readNextXmlMeasure(currentMeasure: SourceMeasure, measureStartAbsoluteTimestamp: Fraction, octavePlusOne: boolean): boolean
  • Main CreateSheet: read the next XML Measure and save all data to the given SourceMeasure.

    Parameters

    • currentMeasure: SourceMeasure
    • measureStartAbsoluteTimestamp: Fraction

      Using this instead of currentMeasure.AbsoluteTimestamp as it isn't set yet

    • octavePlusOne: boolean

      Software like Guitar Pro gives one octave too low, so we need to add one

    Returns boolean

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

Generated using TypeDoc