In this section you find all details about how to write music notation using AlphaTex.
AlphaTex is a text format for writing music notation for AlphaTab. AlphaTex loading
can be enabled by specifying data-tex="true"
on the container elmement.
AlphaTab will load the tex code from the element contents and parse it.
AlphaTex currently only allows writing of a single track.
Here is an example score fully rendered using alphaTex.
Metadata is specified using \tagname value value
at the beginning of the score.
It can be used to specify global information like title, tempo or track tuning.
Metadata is optional, but if specified, it must be followed by a dot do indicate the end
of the metadata.
The following examples show how to general notes. Multiple bars are
separated by |
.
Notes follow the format fret.string.duration
. For rests
the fret is simply replaced with r
. The duration is specified
as a number where 1 represents a full note, 2 a half note and so on.
To specify multiple notes on a beat, group them in parenthesis. The full format is
(fret.string fret.string ...).duration
To make it simpler to write notes, you can apply the same duration to
multiple notes. Start a new duration range with :duration
.
The following notes will all have this duration. AlphaTex also remembers
the last explictely set duration and will take use it in case of a missing duration.
You can specify a multiplier after a beat to add the same beat multiple times to the score.
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.
Time signatures have the format \ts Numerator Denominator
Repeats can be started with \ro
and
be closed with \rc Count
. Count specifies how often
the bar range is repeated.
The key signature can be specified with \ks Value
where the value is one
of the following: Cb, Gb, Db, Ab, Eb, Bb, F, C, G, D, A, E, B, F#, C#
To change the clef simply specify \clef Clef
where Clef is one of the following
values: G2, Treble, F4, Bass, C3, Tenor, C4, Alto, N, Neutral
To change the tempo of the score you can specify \tempo BPM
.
There are various effects that can be applied to a beat. All beat
effects are specified in braces after the beat.
Beat{Effects}
Please find the list of support effects in the example below.
The tremolo/whammy bar effect is a bit more complex than the others.
You can specify a number of values which are evenly distributed over the
time when the note is played. The values indicate the number of quarter notes
increased or decreased on playing. tb (value1 value2 ...)
Just like beat effects, there are also effects for single notes like harmonics,
bends, accentuations etc. The syntax is
Fret.String{NoteEffects}
Please find the list of support effects in the example below.
The bend effect works like the tremolo/whammy bar effect.
You can specify a number of values which are evenly distributed over the
time when the note is played. The values indicate the number of quarter notes
increased bend up upon playing. b (value1 value2 ...)
AlphaTab can export an already loaded track as alphaTex.
function toTex(track) {
var exporter = new AlphaTab.Exporter.AlphaTexExporter();
exporter.Export(track);
return exporter.ToTex();
}
Open a file to see the generated alphaTex here.