Skip to main content

alphaTab.model.MasterBar

The MasterBar stores information about a bar which affects all tracks.

 class MasterBar

Properties​

alternateEndings​

Gets or sets the bitflag for the alternate endings. Each bit defines for which repeat counts the bar is played.

alternateEndings: number;

beamingRules​

Defines the custom beaming rules which should be applied to this bar and all bars following.

beamingRules?: BeamingRules;

directions​

The directions applied to this masterbar.

directions: Set<Direction> | null;

displayScale​

Gets a percentual scale for the size of the bars when displayed in a multi-track layout.

displayScale: number;

displayWidth​

An absolute width of the bar to use when displaying in a multi-track layout.

displayWidth: number;

fermata​

Gets or sets the fermatas for this bar. The key is the offset of the fermata in midi ticks.

fermata: Map<number, Fermata> | null;

hasChanges​

Whether the masterbar is has any changes applied to it (e.g. tempo changes, time signature changes etc) The first bar is always considered changed due to initial setup of values. It does not consider elements like whether the tempo really changes to the previous bar.

readonly hasChanges: boolean;

index​

Gets the zero based index of the masterbar.

index: number;

isAnacrusis​

Gets or sets a value indicating whether the master bar is an anacrusis (aka. pickup bar)

isAnacrusis: boolean;

isDoubleBar​

Gets or sets whether a double bar is shown for this masterbar.

isDoubleBar: boolean;

isFreeTime​

Gets or sets whether the bar indicates a free time playing.

isFreeTime: boolean;

isRepeatEnd​

(no description)

readonly isRepeatEnd: boolean;

isRepeatStart​

Gets or sets whether a repeat section starts on this masterbar.

isRepeatStart: boolean;

isSectionStart​

(no description)

readonly isSectionStart: boolean;

keySignature​

The key signature used on all bars.

keySignature: KeySignature;

keySignatureType​

The type of key signature (major/minor)

keySignatureType: KeySignatureType;

MaxAlternateEndings​

(no description)

static readonly MaxAlternateEndings: number;

nextMasterBar​

Gets or sets the next masterbar in the song.

nextMasterBar: MasterBar | null;

previousMasterBar​

Gets or sets the next masterbar in the song.

previousMasterBar: MasterBar | null;

repeatCount​

Gets or sets the number of repeats for the current repeat section.

repeatCount: number;

repeatGroup​

Gets or sets the repeat group this bar belongs to.

repeatGroup: RepeatGroup;

score​

Gets or sets the reference to the score this song belongs to.

score: Score;

section​

Gets or sets the new section information for this bar.

section: Section | null;

start​

The timeline position of the voice within the whole score. (unit: midi ticks)

start: number;

syncPoints​

The sync points for this master bar to synchronize the alphaTab time axis with the external backing track audio.

syncPoints: Automation[] | undefined;

tempoAutomation​

Gets or sets the first tempo automation for this bar.

readonly tempoAutomation: Automation | null;

tempoAutomations​

Gets or sets all tempo automation for this bar.

tempoAutomations: Automation[];

timeSignatureCommon​

Gets or sets whether this is bar has a common time signature.

timeSignatureCommon: boolean;

timeSignatureDenominator​

Gets or sets the time signature denominiator.

timeSignatureDenominator: number;

timeSignatureNumerator​

Gets or sets the time signature numerator.

timeSignatureNumerator: number;

tripletFeel​

Gets or sets the triplet feel that is valid for this bar.

tripletFeel: TripletFeel;

Methods​

addDirection​

Adds a direction to the masterbar.

addDirection(direction: Direction): void
ParameterSummary
directionAll

The direction to add.

addFermata​

Adds a fermata to the masterbar.

addFermata(offset: number, fermata: Fermata): void
ParameterSummary
offsetAll

The offset of the fermata within the bar in midi ticks.

fermataAll

The fermata.

addSyncPoint​

Adds the given sync point to the list of sync points for this bar.

addSyncPoint(syncPoint: Automation): void
ParameterSummary
syncPointAll

The sync point to add.

calculateDuration​

Calculates the time spent in this bar. (unit: midi ticks)

calculateDuration(respectAnacrusis?: boolean): number
ParameterSummary
respectAnacrusisAll

(no description)

finish​

(no description)

finish(sharedDataBag: Map<string, unknown>): void
ParameterSummary
sharedDataBagAll

(no description)

getFermata​

Gets the fermata for a given beat.

getFermata(beat: Beat): Fermata | null
ParameterSummary
beatAll

The beat to get the fermata for.