OpenSheetMusicDisplay
    Preparing search index...

    Class SourceMeasure

    The Source Measure represents the source data of a unique measure, including all instruments with their staves. There exists one source measure per XML measure or per paper sheet measure (e.g. the source measures are not doubled in repetitions)

    Index

    Constructors

    Properties

    allRests: boolean = false

    Whether the SourceMeasure only has rests, no other entries. Not the same as GraphicalMeasure.hasOnlyRests, because one SourceMeasure can have many GraphicalMeasures (staffs).

    endingBarStyleEnum: SystemLinesEnum
    endingBarStyleXml: string

    The style of the ending bar line.

    hasEndClef: boolean
    hasLyrics: boolean = false
    hasMoodExpressions: boolean = false
    isReducedToMultiRest: boolean = false
    IsSystemStartMeasure: boolean = false
    measureListIndex: number

    The unique measure list index starting with 0.

    MeasureNumberPrinted: number
    MeasureNumberXML: number
    multipleRestMeasureNumber: number = 0

    If this measure is a MultipleRestMeasure, this is the number of the measure in that sequence of measures.

    multipleRestMeasures: number
    printNewPageXml: boolean = false

    Whether the MusicXML says to print a new page (page break). See OSMDOptions.newPageFromXML

    printNewSystemXml: boolean = false

    Whether the MusicXML says to print a new system (line break). See OSMDOptions.newSystemFromXML

    rehearsalExpression: RehearsalExpression
    RhythmPrinted: RhythmInstruction
    WidthFactor: number = 1

    The graphical measure width will be multiplied by this factor. E.g. factor 0.6 = 60% will make the measure only 60% as long as before. Note that this potentially causes issues by counteracting systems like lyrics overlap prevention, and if you give Vexflow too little width to render it will eventually cause other layout issues too. This factor is also read by a custom XML attribute osmdWidthFactor in the measure node, e.g. This will either be multiplicative with a sheet-wide widthFactor or override it, depending on settings. (TODO sheet-wide widthFactor not yet implemented)

    Accessors

    Methods

    • Check the [[SourceMeasure]] for a possible VerticalContainer with all of its [[StaffEntry]]s undefined, and if found, remove the VerticalContainer from the [[SourceMeasure]].

      Parameters

      • index: number

      Returns void

    • Check at the given timestamp if a VerticalContainer exists, if not creates a new, timestamp-ordered one, and at the given index, if a [[SourceStaffEntry]] exists, and if not, creates a new one.

      Parameters

      • inMeasureTimestamp: Fraction
      • inSourceMeasureStaffIndex: number
      • staff: Staff

      Returns { createdNewContainer: boolean; staffEntry: SourceStaffEntry }

    • Search for a non-null [[SourceStaffEntry]] at the given verticalIndex, starting from the given horizontalIndex and moving backwards. If none is found, then return undefined.

      Parameters

      • verticalIndex: number
      • horizontalIndex: number

      Returns SourceStaffEntry

    • This method is used for handling a measure with the following error (in the procedure of finding out the Instrument's Duration): If the LastStaffEntry is missing (implied restNote or error), then go back the StaffEntries until you find a TiedNote (tie Start), which gives the correct MeasureDuration.

      Parameters

      Returns Fraction