alphaTab.model.MasterBar
The MasterBar stores information about a bar which affects all tracks.
class MasterBarPropertiesโ
alternateEndingsโ
Gets or sets the bitflag for the alternate endings. Each bit defines for which repeat counts the bar is played.
- JavaScript
- C#
- Kotlin
alternateEndings: number;double AlternateEndings { get; set; }var alternateEndings: DoublebarNumberโ
The actual bar number of this masterbar respecting any Pick-Up bars and manually overriden bar numbers.
Returns NaN for pick-up bars (see isAnacrusis ) Only available after data model finish.
The final bar number is not guaranteed to be unique. using {@see customBarNumber}
users might reset or change counting in any custom fashion. Do not rely on the bar number
for lookup or indexing.
- JavaScript
- C#
- Kotlin
readonly barNumber: number;double BarNumber { get; }val barNumber: DoublebarNumberTextโ
Returns the actual text displayed for this master bar respecting any custom overrides and out-of-order numbers. Only available after data model finish.
- JavaScript
- C#
- Kotlin
readonly barNumberText: string;string BarNumberText { get; }val barNumberText: StringbeamingRulesโ
Defines the custom beaming rules which should be applied to this bar and all bars following.
- JavaScript
- C#
- Kotlin
customBarNumberโ
A custom bar number affecting this and subsequent bar numbers.
e.g. allows setting the initial bar number to 10 and the second will be 11.
Any change to customBarNumber requires an additional call to finish
to consolidate the counting.
- JavaScript
- C#
- Kotlin
customBarNumber?: number;double CustomBarNumber { get; set; }var customBarNumber: DoublecustomBarNumberTextโ
A custom string to display for the bar number as override.
Even with a custom string, this masterbar contributes to the incremental bar numbers
across the score. Set the customBarNumber for the next master bar if you want
alternative counting.
- JavaScript
- C#
- Kotlin
customBarNumberText?: string;string CustomBarNumberText { get; set; }var customBarNumberText: Stringdirectionsโ
The directions applied to this masterbar.
displayScaleโ
Gets a percentual scale for the size of the bars when displayed in a multi-track layout.
- JavaScript
- C#
- Kotlin
displayScale: number;double DisplayScale { get; set; }var displayScale: DoubledisplayWidthโ
An absolute width of the bar to use when displaying in a multi-track layout.
- JavaScript
- C#
- Kotlin
displayWidth: number;double DisplayWidth { get; set; }var displayWidth: Doublefermataโ
Gets or sets the fermatas for this bar. The key is the offset of the fermata in midi ticks.
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.
- JavaScript
- C#
- Kotlin
readonly hasChanges: boolean;bool HasChanges { get; }val hasChanges: Booleanindexโ
Gets the zero based index of the masterbar.
- JavaScript
- C#
- Kotlin
index: number;double Index { get; set; }var index: DoubleisAnacrusisโ
Gets or sets a value indicating whether the master bar is an anacrusis (aka. pickup bar)
- JavaScript
- C#
- Kotlin
isAnacrusis: boolean;bool IsAnacrusis { get; set; }var isAnacrusis: BooleanisDoubleBarโ
Use barLineLeft and barLineRight
Gets or sets whether a double bar is shown for this masterbar.
- JavaScript
- C#
- Kotlin
isDoubleBar: boolean;bool IsDoubleBar { get; set; }var isDoubleBar: BooleanisFreeTimeโ
Gets or sets whether the bar indicates a free time playing.
- JavaScript
- C#
- Kotlin
isFreeTime: boolean;bool IsFreeTime { get; set; }var isFreeTime: BooleanisRepeatEndโ
(no description)
- JavaScript
- C#
- Kotlin
readonly isRepeatEnd: boolean;bool IsRepeatEnd { get; }val isRepeatEnd: BooleanisRepeatStartโ
Gets or sets whether a repeat section starts on this masterbar.
- JavaScript
- C#
- Kotlin
isRepeatStart: boolean;bool IsRepeatStart { get; set; }var isRepeatStart: BooleanisSectionStartโ
(no description)
- JavaScript
- C#
- Kotlin
readonly isSectionStart: boolean;bool IsSectionStart { get; }val isSectionStart: BooleankeySignatureโ
Use key signatures on bar level
The key signature used on all bars.
- JavaScript
- C#
- Kotlin
keySignatureTypeโ
Use key signatures on bar level
The type of key signature (major/minor)
- JavaScript
- C#
- Kotlin
keySignatureType: KeySignatureType;KeySignatureType KeySignatureType { get; set; }var keySignatureType: KeySignatureTypeMaxAlternateEndingsโ
(no description)
- JavaScript
- C#
- Kotlin
static readonly MaxAlternateEndings: number;static double MaxAlternateEndings { get; }companion object { val MaxAlternateEndings: Double }nextMasterBarโ
Gets or sets the next masterbar in the song.
previousMasterBarโ
Gets or sets the next masterbar in the song.
repeatCountโ
Gets or sets the number of repeats for the current repeat section.
- JavaScript
- C#
- Kotlin
repeatCount: number;double RepeatCount { get; set; }var repeatCount: DoublerepeatGroupโ
Gets or sets the repeat group this bar belongs to.
- JavaScript
- C#
- Kotlin
scoreโ
Gets or sets the reference to the score this song belongs to.
sectionโ
Gets or sets the new section information for this bar.
startโ
The timeline position of the voice within the whole score. (unit: midi ticks)
- JavaScript
- C#
- Kotlin
start: number;double Start { get; set; }var start: DoublesyncPointsโ
The sync points for this master bar to synchronize the alphaTab time axis with the external backing track audio.
- JavaScript
- C#
- Kotlin
syncPoints: Automation[] | undefined;IList<Automation>? SyncPoints { get; set; }var syncPoints: alphaTab.collections.List<Automation>?tempoAutomationโ
Use tempoAutomations .
Gets or sets the first tempo automation for this bar.
- JavaScript
- C#
- Kotlin
readonly tempoAutomation: Automation | null;Automation? TempoAutomation { get; }val tempoAutomation: Automation?tempoAutomationsโ
Gets or sets all tempo automation for this bar.
- JavaScript
- C#
- Kotlin
tempoAutomations: Automation[];IList<Automation> TempoAutomations { get; set; }var tempoAutomations: alphaTab.collections.List<Automation>timeSignatureCommonโ
Gets or sets whether this is bar has a common time signature.
- JavaScript
- C#
- Kotlin
timeSignatureCommon: boolean;bool TimeSignatureCommon { get; set; }var timeSignatureCommon: BooleantimeSignatureDenominatorโ
Gets or sets the time signature denominiator.
- JavaScript
- C#
- Kotlin
timeSignatureDenominator: number;double TimeSignatureDenominator { get; set; }var timeSignatureDenominator: DoubletimeSignatureNumeratorโ
Gets or sets the time signature numerator.
- JavaScript
- C#
- Kotlin
timeSignatureNumerator: number;double TimeSignatureNumerator { get; set; }var timeSignatureNumerator: DoubletripletFeelโ
Gets or sets the triplet feel that is valid for this bar.
- JavaScript
- C#
- Kotlin
Methodsโ
addDirectionโ
Adds a direction to the masterbar.
| Parameter | Summary |
|---|---|
directionAll | The direction to add. |
addFermataโ
Adds a fermata to the masterbar.
| Parameter | Summary |
|---|---|
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.
- JavaScript
- C#
- Kotlin
addSyncPoint(syncPoint: Automation): voidvoid AddSyncPoint(Automation syncPoint)fun addSyncPoint(syncPoint: Automation): Unit| Parameter | Summary |
|---|---|
syncPointAll | The sync point to add. |
calculateDurationโ
Calculates the time spent in this bar. (unit: midi ticks)
- JavaScript
- C#
- Kotlin
calculateDuration(respectAnacrusis?: boolean): numberdouble CalculateDuration(bool? respectAnacrusis)fun calculateDuration(respectAnacrusis: Boolean?): Double| Parameter | Summary |
|---|---|
respectAnacrusisAll | (no description) |
finishโ
(no description)
- JavaScript
- C#
- Kotlin
finish(sharedDataBag: Map<string, unknown>): voidvoid Finish(Map<string, object> sharedDataBag)fun finish(sharedDataBag: alphaTab.collections.StringAnyMap<String, Any>): Unit| Parameter | Summary |
|---|---|
sharedDataBagAll | (no description) |
getFermataโ
Gets the fermata for a given beat.
| Parameter | Summary |
|---|---|
beatAll | The beat to get the fermata for. |