You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/alphatex/introduction.mdx
+22-2Lines changed: 22 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,8 +6,8 @@ import { AlphaTexSample } from '@site/src/components/AlphaTexSample';
6
6
7
7
In this section you find all details about how to write music notation using AlphaTex.
8
8
AlphaTex is a text format for writing music notation for AlphaTab. AlphaTex loading
9
-
can be enabled by specifying `data-tex="true"`on the container element.
10
-
AlphaTab will load the tex code from the element contents and parse it.
9
+
can be enabled by setting the [`tex`](/docs/reference/settings/core/tex) option or loading it via [`tex()`](/docs/reference/api/tex) method on the API.
10
+
AlphaTab will load the tex code from the element contents and parse it. You can also load it from a file like other formats.
11
11
AlphaTex supports most of the features alphaTab supports overall.
12
12
If you find anything missing you would like to see, feel free to
13
13
[initiate a Discussion on GitHub](https://github.com/CoderLine/alphaTab/discussions/new) so we can find a good solution together.
@@ -30,3 +30,23 @@ Here is an example score fully rendered using alphaTex.
alphaTex has the following structure variations. Comments are supported in C-style comments via `// Single Line` and `/* Multi Line */`.
38
+
39
+
40
+
```title=General File Structure
41
+
/* Song Metadata */
42
+
.
43
+
/* Song Contents */
44
+
.
45
+
/* Sync Points */
46
+
```
47
+
48
+
The Song Metadata and Sync Points are optional but the dots are mandatory to separate the sections in case there is any content filled.
49
+
50
+
* Song Metadata: This section contains all information generally about the song like title.
51
+
* Song Contents: This section contains defines the whole song contents with all the tracks, staves, bars, beats, notes that alphaTab supports. Bars are separated by `|` symbols.
52
+
* Sync Points: alphaTab can be synchronized with external media like audio backing tracks or videos. To have the correct cursor display and highlighting, songs have to be synchronized. This section defines such markers.
*`BarIndex` is the numeric (0-based) index of the bar for which the sync point applies.
21
+
*`Occurence` is the numeric (0-based) index of bar repetitions. e.g. on Repeats or Jumps bars might be played multiple times. This value allows specifying points on subsequent plays of a bar.
22
+
*`MillisecondOffset` is the numeric timestamp in milliseconds in the external audio.
23
+
*`RatioPosition` is the relative offset within the bar at which the sync point is placed (0 if not provided).
24
+
25
+
The `BarIndex`, `Occurence`, `RatioPosition` values define the absolute position within the music sheet.
26
+
The `MillisecondOffset` defines the absolute position within the external media.
27
+
28
+
With this information known, alphaTab can synchronize the external media with the music sheet.
29
+
30
+
The sample below uses an audio backing track with inconsistent tempos. The sync points correct the tempo differences and the cursor is placed correctly.
0 commit comments