Bar Metadata
For bars various tags can be specified which change information like
clefs, key signatures repeats etc. They follow the format
\tag value value just like the score metadata. Be sure not to
mix the score metadata and the bar metadata of the first bar.
\ts​
\ts common
\ts (numerator denominator)
Description: Defines the time signature for this and subsequent bars.
AlphaTab does not yet support polytempo notation where instruments might use different time signatures. Therefore be sure to only specify the timesignatures once as part of the first track/staff or ensure they are consistent across the whole document.
Values:
| Name | Description | Type | Required |
|---|---|---|---|
| common | Specifies a common (4/4) time signature using the special C symbol | identifier | yes |
| numerator | The time signature numerator | number | yes |
| numerator | The time signature denominator | number | yes |
Example:
\ts 3 4 | \ts 4 4 | \ts 6 8 | \ts common
There are no properties on this metadata.
\ro​
\ro
Description: Marks the start of a repeat.
Values: None
Example:
\ro 1.3 2.3 3.3 4.3 | 5.3 6.3 7.3 8.3 | \rc 2 1.3 2.3 3.3 4.3 |
\ro \rc 3 1.3 2.3 3.3 4.3
There are no properties on this metadata.
\rc​
\rc repeats
Description: Marks the end of a repeat.
Values:
| Name | Description | Type | Required |
|---|---|---|---|
| repeats | The number of repeats which should be played | number | yes |
Example:
\ro 1.3 2.3 3.3 4.3 | 5.3 6.3 7.3 8.3 | \rc 2 1.3 2.3 3.3 4.3 |
\ro \rc 3 1.3 2.3 3.3 4.3
There are no properties on this metadata.
\ae​
\ae ending
\ae (ending ending...)
Description: Specifies on which repeats a bar should be played (to build alternate endings).
Values:
| Name | Description | Type | Required |
|---|---|---|---|
| ending | The repeats on which the bar should be played | number list | yes |
Example:
\ro 1.3 2.3 3.3 4.3 | \ae (1 2 3) 5.3 6.3 7.3 8.3 | \ae 4 \rc 4 5.3 8.3 7.3 6.3
There are no properties on this metadata.
\ks​
\ks key
Description: Specifies the key signature for this and subsequent bars.
Values:
| Name | Description | Type | Required |
|---|---|---|---|
| key | The key signature | identifier | yes |
For major keys, the value is one of Cb, Gb, Db, Ab, Eb, Bb, F, C, G, D, A, E, B, F#, C#.
Their equivalent minor scale can also be used, so Bminor is the same as D etc.
A major scale can also be explicitly written out, like Dmajor.
Example:
\ks Cb | \ks C | \ks C# |
\ks Aminor | \ks Dmajor | \ks Bminor
There are no properties on this metadata.
\clef​
\clef clef
Description: Changes the clef for this and subsequent bars.
Values:
| Name | Description | Type | Required |
|---|---|---|---|
| clef | The clef | identifier | yes |
Following clefs are supported: G2, Treble, F4, Bass, C3, Tenor, C4, Alto, N, Neutral
Example:
\clef G2 | \clef F4 | \clef C3 | \clef C4 | \clef N |
\clef Treble | \clef Bass | \clef Tenor | \clef Alto | \clef Neutral |
\ottava​
\ottava ottava
Description: Changes the clef ottave for this and subsequent bars.
Values:
| Name | Description | Type | Required |
|---|---|---|---|
| ottava | The clef ottava | identifier | yes |
Following ottavia are supported: 15ma, 8va, regular, 8vb, 15mb
Example:
\clef F4 \ottava 15ma | | \ottava regular | | \clef C3 \ottava 8vb | |
There are no properties on this metadata.
\tempo​
\tempo tempo
\tempo (tempo label position hide)
Description: Adds a tempo change to the bar.
A bar can have multiple tempo changes. They can either be relatively positioned using this metadata tag or
applied via the tempo property as beat effect.
Tempo changes affect the whole song and not only an individual track. To avoid unexpected side effects, we recomment to specify the tempo changes only once on the first track/staff.
Values:
| Name | Description | Type | Required |
|---|---|---|---|
| tempo | The new tempo in BPM | number | yes |
| label | A textual label for the tempo | number | no |
| position | A relative (ratio) position where within the bar the tempo change should happen | number (float, 0-1) | no |
| hide | If specified the tempo change is not visually shown | identifier | no |
Example:
\tempo 30
C4 D4 E4 F4 |
\tempo (120 "Moderate")
\tempo (60 "" 0.5 hide)
C4 D4 E4 F4 |
There are no properties on this metadata.
\tf​
\tf tripletFeel
Description: Changes the triplet feel (aka. swing) play style.
Values:
| Name | Description | Type | Required |
|---|---|---|---|
| tripletFeel | The triplet feel style | identifier | yes |
| TripletFeel | Possible values |
|---|---|
| No Triplet Feel | none |
| Triplet 16th | triplet16th |
| Triplet 8th | triplet8th |
| Dotted 16th | dotted16th |
| Dotted 8th | dotted8th |
| Scottish 16th | scottish16th |
| Scottish 8th | scottish8th |
Example:
\tf none 3.3*4 |
\tf triplet16th 3.3*4 | \tf triplet8th 3.3*4 |
\tf dotted16th 3.3*4 | \tf dotted8th 3.3*4 |
\tf scottish16th 3.3*4 | \tf scottish8th 3.3*4 |
There are no properties on this metadata.
\ac​
\ac
Description: Marks the bar as an anacrusis (pick-up) bar.
By default bars follow a strict timing defined by the time signature and tempo. Anacrusis (aka. pickup bars) do not follow this rule. The length of those bars is defined by the actual beats/notes in the bar.
Values: None
Example:
\ks D \ts 24 16 \ac r.16 6.3 7.3 9.3 7.3 6.3 | r.16 5.4 7.4 9.4 7.4 5.4 6.3.4{d} 9.6.16 10.6 12.6 10.6 9.6 14.6.4{d} r.16
There are no properties on this metadata.
\section​
\section marker text
\section text
Description: Starts a new section within the song (intro, outro,..)
Values:
| Name | Description | Type | Required |
|---|---|---|---|
| marker | The marker for the section, typically a single letter | string | no |
| text | The text/description of the new section | string | yes |
Example:
\section "Intro" // simple section
1.1 1.1 1.1 1.1 | 1.1 1.1 1.1 1.1 |
\section S Solo // with marker and section name differently
1.1 1.1 1.1 1.1
There are no properties on this metadata.
\jump​
\jump direction
Description: Adds a direction/jump instruction to the bar.
Values:
| Name | Description | Type | Required |
|---|---|---|---|
| direction | The direction to add | identifier | yes |
Jump Targets
FineSegnoSegnoSegnoCodaDoubleCoda
Jump Instructions
-
DaCapo -
DaCapoAlCoda -
DaCapoAlDoubleCoda -
DaCapoAlFine -
DalSegno -
DalSegnoAlCoda -
DalSegnoAlDoubleCoda -
DalSegnoAlFine -
DalSegnoSegno -
DalSegnoSegnoAlCoda -
DalSegnoSegnoAlDoubleCoda -
DalSegnoSegnoAlFine -
DaCoda -
DaDoubleCoda
Example:
.
\ro \rc 2 3.3*4 |
3.3*4 |
\jump Segno 3.3*4 |
\ro \rc 2 3.3*4 |
\jump DaCoda 3.3*4 |
3.3*4 | 3.3*4
\jump DalSegnoAlCoda 3.3*4 |
3.3*4 |
\jump Coda 3.3*4 |
3.3*4 |
3.3*4
There are no properties on this metadata.
\ft​
\ft
Description: Marks the bar as a free-time bar where players are free to vary the playback.
Values: None
Example:
.
:2
C4*2 |
\ft C4*2 |
\ft C4*2 |
C4*2 |
There are no properties on this metadata.
\simile​
\simile mark
Description: Adds a simile mark to the bar indicating that the content of the last, or previous two bars should be repeated.
Values:
| Name | Description | Type | Required |
|---|---|---|---|
| mark | The mark to add | identifier | yes |
none- No simile mark is appliedsimple- A simple simile mark. The previous bar is repeated.firstofdouble- A double simile mark. This value is assigned to the first bar of the 2 repeat bars.secondofdouble- A double simile mark. This value is assigned to the second bar of the 2 repeat bars.
Example:
3.3*4 | \simile simple | 3.3*4 | 4.3*4 | \simile firstofdouble | \simile secondofdouble
There are no properties on this metadata.
\barlineLeft and \barlineRight​
\barlineLeft style
\barlineRight style
Description: Adjusts the lines which will be shown left and right on the bar.
For some special notation needs, the default bar line can be adjusted on every bar. The bar line styles are aligned with the ones from MusicXML.
alphaTab attempts to reuse lines on overlapping styles across bars.
Values:
| Name | Description | Type | Required |
|---|---|---|---|
| style | The line style to use | identifier | yes |
Available styles:
automatic- Bar lines are determined automatically based on details like repeats and free time (default).dasheddottedheavyheavyheavyheavylightlightheavylightlightnoneregularshorttick
Example:
\instrument piano
.
\track "Overlapping"
\staff
\barlineleft dashed
\barlineright dotted
|
\barlineleft heavyheavy
\barlineright heavyheavy
\staff
\barlineleft lightlight
\barlineright lightheavy
|
\barlineleft heavylight
\barlineright dashed
\track "All Styles"
\staff
\barlineright dashed |
\barlineright dotted |
\barlineright heavy |
\barlineright heavyHeavy |
\barlineright heavyLight |
\barlineright lightHeavy |
\barlineright lightlight |
\barlineright none |
\barlineright regular |
\barlineright short |
\barlineright tick |
There are no properties on this metadata.
\scale​
\scale scale
Description: Adjusts the relative scale of the bar when using systemsLayoutMode: 'UseModelLayout' with the page layout.
Values:
| Name | Description | Type | Required |
|---|---|---|---|
| scale | The scale of the bar within the system | number (float) | yes |
Example:
\track { defaultSystemsLayout 3 }
\scale 0.25 :1 c4 | \scale 0.5 c4 | \scale 0.25 c4 |
\scale 0.5 c4 | \scale 2 c4 | \scale 0.5 c4 |
c4 | c4
There are no properties on this metadata.
\width​
\width width
Description: Adjusts the absolute of the bar when using systemsLayoutMode: 'UseModelLayout' with the horizontal layout.
Values:
| Name | Description | Type | Required |
|---|---|---|---|
| width | The absolute width of the bar | number | yes |
Example:
\track
\width 100 :1 c4 | \width 300 c4 | \width 350 c4
There are no properties on this metadata.
\sync​
\sync (barIndex occurence millisecondOffset ratioPosition)
Description: Adds a new sync point for synchronizing the music sheet with an external media source like a backing track or video player.
alphaTex support specifying sync points for the synchronization with external media.
It is recommended to add the sync points at the very end of the song but it is also possible to define them inbetween.
The barIndex, occurence, ratioPosition values define the absolute position within the music sheet.
The millisecondOffset defines the absolute position within the external media.
With this information known, alphaTab can synchronize the external media with the music sheet.
Values:
| Name | Description | Type | Required |
|---|---|---|---|
| barIndex | The index of the bar being synced | number | yes |
| occurence | The occurence of the bar for which this sync point applies (on repeats) | number | yes |
| millisecondOffset | The absolute millisecond offset within the external media | number | yes |
| ratioPosition | The relative position within the bar where the synchronization happens | number | no |
Example:
The sample below uses an audio backing track with inconsistent tempos. The sync points correct the tempo differences and the cursor is placed correctly.
\title "Prelude in D Minor"
\artist "J.S. Bach (1685-1750)"
\copyright "Public Domain"
\tempo 80
.
\ts 3 4
0.4.16 (3.2 -.4) (1.1 -.4) (5.1 -.4) 1.1 3.2 1.1 3.2 2.3.8 (3.2 3.4) |
(3.2 0.4).16 (3.2 -.4) (1.1 -.4) (5.1 -.4) 1.1 3.2 1.1 3.2 2.3.8 (3.2 3.4) |
(3.2 0.4).16 (3.2 -.4) (3.1 -.4) (6.1 -.4) 3.1 3.2 3.1 3.2 3.3.8 (3.2 0.3) |
(3.2 0.4).16 (3.2 -.4) (3.1 -.4) (6.1 -.4) 3.1 3.2 3.1 3.2 3.3.8 (3.2 0.3) |
.
\sync 0 0 0
\sync 0 0 1500 0.666
\sync 1 0 4075 0.666
\sync 2 0 6475 0.333
\sync 3 0 10223 1
\accidentals​
\accidentals mode
Description: Changes the mode how alphaTab should treat accidentals when writing pitched notes.
alphaTab can use the accidentals as specified in alphaTex, or apply accidentals automatically based on the note pitch.
Values:
| Name | Description | Type | Required |
|---|---|---|---|
| mode | The mode which should be active | auto or explicit | yes |
Example:
\accidentals explicit
C#4 C4 Eb4 Ax4 |
\accidentals auto
C#4 C4 Eb4 Ax4 |
There are no properties on this metadata.
\spd, \spu and \sph​
\spd position
\sph position
\spu position
Description: Specifies how the sustain petal should be pressed down (spd), held (sph) or lifted up (spu).
This tag allows specifying the sustain pedal relative to the bar. The sustain pedal can also be applied via beat properties.
Values:
| Name | Description | Type | Required |
|---|---|---|---|
| position | The relative position within the bar for the marker | number (float, 0-1) | yes |
Example:
\spd 0
\spu 0.25
\spd 0.5
\sph 0.75
\spu 1
:8 C4 * 8
There are no properties on this metadata.