Structural Metadata
For some songs you might want to define that the song has multiple tracks, staves or voices.
- Multiple tracks are used when multiple instruments are playing together in one song.
- Multiple staves are typically used to write grand staff piano notation (left hand/right hand) or splitup voices for readability.
- Multiple voices are typically used to write notation where multiple independent timings and pitches are played. This can be if multiple vocals are singing together (hence the name voices), or special playing techniques (playing a base rhythm and melody on the same instrument).
In alphaTex new tracks, staves and voices are started with their respective metadata tags specified at the start of a bar:
\track\staff\voice
alphaTab refers to these kind of metadata tags as "structural" tags as they define the general structure of the song.
The initial track, staff or voice is implicitly started. Only on the "second" item you need to specify the tags. For clarity it is encouraged to also specify the initial item if there are multiple tracks, staves or voices.
\track​
\track
\track longName
\track (shortName longName)
Description: Marks the start of a new track
Values:
| Name | Description | Type | Required |
|---|---|---|---|
| longName | The long name of the track | string | no |
| shortName | The short name of the track | string | no |
The displayed name depends on the configured Track Name Policy.
If the short name is not specified, the first 10 characters of the long name are used as short name.
Example
\track "First Track" "frst"
C4 D4 E4 F4
\track
C5 D5 E5 F5
Following properties are available.
color​
color colorCode
Description:
The data model holds information about the color of the track which might be used by user interfaces to visually differenciate them. This data mainly originates from the Guitar Pro file format where colors are used to differenciate the tracks in the track picker and some other visualizations. It does not have an impact on the color of the music notation but can be used in a custom UI.
Values:
| Name | Description | Type | Required |
|---|---|---|---|
| colorCode | The colorCode in any supported color format | string | yes |
Example:
\track { color "#FF0000" }
1.1 2.1 3.1 4.1
systemsLayout​
systemsLayout (numberOfBars numberOfBars...)
Description: Defines the number of bars to display per system.
The systemsLayout and defaultSystemsLayout allow configuring the system layout.
The system layout, defines how many bars should be displayed per system (line) if enabled via systemsLayoutMode.
Values:
| Name | Description | Type | Required |
|---|---|---|---|
| numberOfBars | Defines for every system (line) the number of bars it should contain | number (repeated) | yes |
Example:
\title "Single Track"
\track { systemsLayout (2 3 2) }
:1 c4 | c4 | c4 | c4 | c4 | c4 | c4
defaultSystemsLayout​
defaultSystemsLayout numberOfBars`
Description: Defines the default number of bars to display per system.
The systemsLayout and defaultSystemsLayout allow configuring the system layout.
The system layout, defines how many bars should be displayed per system (line) if enabled via systemsLayoutMode.
Values:
| Name | Description | Type | Required |
|---|---|---|---|
| numberOfBars | Defines for every system (line) the number of bars it should contain | number | yes |
Example:
\title "Single Track"
.
\track { defaultSystemsLayout 2 }
:1 c4 | c4 | c4 | c4 | c4 | c4 | c4
solo​
solo
Description: Set the track to be played alone in the data model.
Values: None
Example:
\track { solo }
1.1 2.1 3.1 4.1
\track
10.1 11.1 12.1 13.1
mute​
mute
Description: Set the track to be muted (not played) in the data model.
Values: None
Example:
\track
1.1 2.1 3.1 4.1
\track { mute }
10.1 11.1 12.1 13.1
volume​
volume value
Description: Set the track volume in the data model.
Values:
| Name | Description | Type | Required |
|---|---|---|---|
| value | The volume to set | number (0-16) | yes |
Example:
\track { volume 0 }
1.1 2.1 3.1 4.1
\track { volume 16 }
10.1 11.1 12.1 13.1
balance​
balance value
Description: Set the track balance in the data model.
Values:
| Name | Description | Type | Required |
|---|---|---|---|
| value | The balance to set | number (0-16; 8 is centered) | yes |
Example:
\track { volume 0 }
1.1 2.1 3.1 4.1
\track { volume 16 }
10.1 11.1 12.1 13.1
instrument​
instrument value
Description: Set the midi instrument for this track.
Values:
| Name | Description | Type | Required |
|---|---|---|---|
| value | The MIDI instrument to set | number (MIDI program number 0-127) or string (midi instrument name) | yes |
Refer to the following list of names you can use.
| Number | Name |
|---|---|
| 0 | Acoustic Grand Piano |
| 1 | Bright Grand Piano |
| 2 | Electric Grand Piano |
| 3 | Honky tonk Piano |
| 4 | Electric Piano 1 |
| 5 | Electric Piano 2 |
| 6 | Harpsichord |
| 7 | Clavinet |
| 8 | Celesta |
| 9 | Glockenspiel |
| 10 | Musicbox |
| 11 | Vibraphone |
| 12 | Marimba |
| 13 | Xylophone |
| 14 | Tubularbells |
| 15 | Dulcimer |
| 16 | Drawbar Organ |
| 17 | Percussive Organ |
| 18 | Rock Organ |
| 19 | Church Organ |
| 20 | Reed Organ |
| 21 | Accordion |
| 22 | Harmonica |
| 23 | Tango Accordion |
| 24 | Acoustic Guitar Nylon |
| 25 | Acoustic Guitar Steel |
| 26 | Electric Guitar Jazz |
| 27 | Electric Guitar Clean |
| 28 | Electric Guitar Muted |
| 29 | Overdriven Guitar |
| 30 | Distortion Guitar |
| 31 | Guitar Harmonics |
| 32 | Acoustic Bass |
| 33 | Electric Bass Finger |
| 34 | Electric Bass Pick |
| 35 | Fretless Bass |
| 36 | Slap Bass 1 |
| 37 | Slap Bass 2 |
| 38 | Synth Bass 1 |
| 39 | Synth Bass 2 |
| 40 | Violin |
| 41 | Viola |
| 42 | Cello |
| 43 | Contrabass |
| 44 | Tremolo Strings |
| 45 | Pizzicato Strings |
| 46 | Orchestral Harp |
| 47 | Timpani |
| 48 | String Ensemble 1 |
| 49 | String Ensemble 2 |
| 50 | Synth Strings 1 |
| 51 | Synth Strings 2 |
| 52 | Choir Aahs |
| 53 | Voice Oohs |
| 54 | Synth Voice |
| 55 | Orchestra Hit |
| 56 | Trumpet |
| 57 | Trombone |
| 58 | Tuba |
| 59 | Muted Trumpet |
| 60 | French Horn |
| 61 | Brass Section |
| 62 | Synth Brass 1 |
| 63 | Synth Brass 2 |
| 64 | Soprano Sax |
| 65 | Alto Sax |
| 66 | Tenor Sax |
| 67 | Baritone Sax |
| 68 | Oboe |
| 69 | English Horn |
| 70 | Bassoon |
| 71 | Clarinet |
| 72 | Piccolo |
| 73 | Flute |
| 74 | Recorder |
| 75 | Pan Flute |
| 76 | Blown bottle |
| 77 | Shakuhachi |
| 78 | Whistle |
| 79 | Ocarina |
| 80 | Lead 1 Square |
| 81 | Lead 2 Sawtooth |
| 82 | Lead 3 Calliope |
| 83 | Lead 4 Chiff |
| 84 | Lead 5 Charang |
| 85 | Lead 6 Voice |
| 86 | Lead 7 Fifths |
| 87 | Lead 8 Bass and Lead |
| 88 | Pad 1 newage |
| 89 | Pad 2 warm |
| 90 | Pad 3 polysynth |
| 91 | Pad 4 choir |
| 92 | Pad 5 bowed |
| 93 | Pad 6 metallic |
| 94 | Pad 7 halo |
| 95 | Pad 8 sweep |
| 96 | Fx 1 rain |
| 97 | Fx 2 soundtrack |
| 98 | Fx 3 crystal |
| 99 | Fx 4 atmosphere |
| 100 | Fx 5 brightness |
| 101 | Fx 6 goblins |
| 102 | Fx 7 echoes |
| 103 | Fx 8 scifi |
| 104 | Sitar |
| 105 | Banjo |
| 106 | Shamisen |
| 107 | Koto |
| 108 | Kalimba |
| 109 | Bag pipe |
| 110 | Fiddle |
| 111 | Shanai |
| 112 | Tinkle Bell |
| 113 | Agogo |
| 114 | Steel Drums |
| 115 | Woodblock |
| 116 | Taiko Drum |
| 117 | Melodic Tom |
| 118 | Synth Drum |
| 119 | Reverse Cymbal |
| 120 | Guitar Fret Noise |
| 121 | Breath Noise |
| 122 | Seashore |
| 123 | Bird Tweet |
| 124 | Telephone Ring |
| 125 | Helicopter |
| 126 | Applause |
| 127 | Gunshot |
Example:
\track { instrument 0 }
C4 C5 r r
\track { instrument "Acoustic Steel Guitar" }
\tuning (E4 B3 G3 D3 A2 E2)
r r 12.1 13.1
bank​
bank value
Description: Set the MIDI bank to select when playing this track.
The loaded soundfont needs to have this bank defined, otherwise there might be no audio.
Values:
| Name | Description | Type | Required |
|---|---|---|---|
| value | The midi bank to set | number | yes |
Example:
\track { instrument 25 bank 2 }
multiBarRest​
multiBarRest
Description: Enables the display of multibar rests if this track is shown as standalone.
Values: None
Example:
\track { multiBarRest }
C4*4 | r.1 | r.1 | r.1 | C4 * 4
\track
C4*4 | r.1 | r.1 | r.1 | C4 * 4
\staff​
\staff
Description: Marks the start of a new staff.
The staff with the largest number of bars defines how long the overall song is. There is no need to manually ensure that all staves have the correct number of bars. AlphaTab will create missing empty bars automatically.
Values: None
Example
\track "Piano with Grand Staff" "pno."
\staff{score} \tuning piano \instrument acousticgrandpiano
c4 d4 e4 f4 |
\staff{score} \tuning piano \clef F4
c2 c2 c2 c2 |
\track "Guitar"
\staff{tabs slash} \capo 5
1.2 3.2 0.1 1.1
Following properties are available.
If no properties describing the visible notation are provided, the default is score tabs.
score​
score lineCount
Description: Enable the display of standard notation.
Values:
| Name | Description | Type | Required |
|---|---|---|---|
| lineCount | The number of staff lines | number | no (default: 5) |
Example:
\track
\staff {score 3}
D4 D4 D4 D4
\staff {score}
C4 C4 C4 C4
tabs​
tabs
Description: Enable the display of guitar tablature.
Guitar tabs are only shown if the contained notes are stringed/fretted notes.
Values: None
Example:
\track
\staff {tabs}
3.3 4.3 5.3 5.5
slash​
slash
Description:
Enable the display of slash notation.
Values: None
Example:
\track
\staff {tabs slash}
3.3 4.3 5.3 5.5
numbered​
numbered
Description: Enable the display of numbered notation (Jianpu).
Values: None
Example:
\track
\staff {score numbered}
C4 D4 E4 F4
\voice​
\voice
Description: Marks the start of a new voice.
Unlike the structure in the data model, alphaTex expects you to define all bars of a voice, then all the bars of the next voice.
It structure is: \voice /* Voice 1 Bar 1*/ | /* Voice 1 Bar 2*/ \voice /* Voice 2 Bar 1*/ | /* Voice21 Bar 2*/
Once a new voice starts, you again can define the notes starting from the first bar. alphaTab will try to consolidate inconsistencies in the number of bars across voices.
Values: None
Example
\track "Piano"
\staff{score} \tuning piano \instrument acousticgrandpiano
\voice
c4 d4 e4 f4 | c4 d4 e4 f4
\voice
c3 d3 e3 f3 | c3 d3 e3 f3
\track "Piano2"
\staff{score} \tuning piano \instrument acousticgrandpiano
\voice
c4 d4 e4 f4 | c4 d4 e4 f4
\voice
c3 d3 e3 f3
There are no properties on this metadata.