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/getting-started/configuration-web.mdx
+5-87Lines changed: 5 additions & 87 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,9 +13,8 @@ Simply create a div container where you want alphaTab to be located on your page
13
13
to the available width of the div when using the page layout. If you prefer a fixed layout simply set a fixed width on the div via CSS
14
14
and no resizes to alphaTab will happen either.
15
15
16
-
If jQuery is detected on the page you can use the jQuery plugin to interact with alphaTab. Otherwise alphaTab is initailized using a special `API`
17
-
object. The main namespace `alphaTab` contains every class and enum exposed by the API. The main api is the `alphaTab.AlphaTabApi`
18
-
class:
16
+
The main namespace `alphaTab` and its sub-namespaces like `model` or `midi` contain all types and functionalities by alphaTab. The main api is the `alphaTab.AlphaTabApi`
17
+
class which can be used to initialize and interface with alphaTab:
19
18
20
19
```html
21
20
<divid="alphaTab"></div>
@@ -27,78 +26,20 @@ const api = new alphaTab.AlphaTabApi(element);
27
26
28
27
## Settings
29
28
30
-
There are 2 main ways to initialize alphaTab: either via a settings object or via data attributes.
31
-
Depending on the technologies used in your project either the direct code initialization or the data attributes might be easier to use.
32
-
33
-
The data attributes might be more suitable for server side rendering technologies where settings are provided from a backend infrastructure
34
-
during page rendering. When printing the main alphaTab div element to the DOM you can pass on any settings you might want to have.
35
-
36
-
When using client side frontend frameworks like Angular, React or even plain JavaScript it might be more suitable to initialize alphaTab
37
-
via a settings object.
38
-
39
-
Both systems can be combined while the data attributes will overrule the JSON settings.
40
-
The full list of settings can be found in the [API Reference](/docs/reference/settings).
41
-
42
-
importTabsfrom'@theme/Tabs';
43
-
importTabItemfrom'@theme/TabItem';
44
-
45
-
<Tabs
46
-
defaultValue="js"
47
-
values={[
48
-
{ label: 'Settings Object', value: 'js', },
49
-
{ label: 'jQuery', value: 'jq', },
50
-
{ label: 'Data Attributes', value: 'html', },
51
-
]
52
-
}>
53
-
<TabItemvalue="js">
54
-
55
29
The settings object is passed to the constructor of the API object as second parameter:
56
30
57
31
```js
58
32
constapi=newalphaTab.AlphaTabApi(element, {
59
33
// any settings go here
60
34
});
61
-
```
62
-
63
-
</TabItem>
64
-
<TabItemvalue="jq">
65
35
66
-
AlphaTab is initialized via the `$.alphaTab()` plugin. The first parameter is the settings object and the API object will be returned.
67
-
68
-
```js
69
-
constapi=$('#alphaTab').alphaTab();
70
36
```
71
37
72
-
</TabItem>
73
-
<TabItemvalue="html">
74
-
75
-
Data Attributes will only allow configuration, you still need to manually initailize alphaTab with one of the other variants.
76
-
But the settings parameter can be simply left out.
Copy file name to clipboardExpand all lines: docs/guides/audio-video-sync.mdx
+178-3Lines changed: 178 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,9 +2,6 @@
2
2
title: Audio & Video Sync
3
3
---
4
4
5
-
> [!WARNING]
6
-
> This guide is still incomplete and is currently being extended.
7
-
8
5
alphaTab can be synchronized with an external audio or video backing track. You can either use Guitar Pro 8 files with an audio track or synchronize alphaTab with an external media using the
9
6
[Media Sync Editor in the Playground](/docs/playground/playground.mdx).
10
7
@@ -34,6 +31,15 @@ Beside that you can load Guitar Pro 8 files and directly benefit from the enhanc
34
31
### Custom External Media Player
35
32
36
33
alphaTab can be integrated with any external media system but it requires some implementation on the integrator side. To properly synchronize alphaTab and an external media source (audio or video) the `alphaTab.synth.IExternalMediaHandler` interface has to be implemented and provided to alphaTab.
34
+
Beside that, alphaTab has to be informed about the time updates on the external media (e.g. during playback and seeking). This update should happen at a rate smaller than two subsequent notes. 50ms updates have shown to work well on even fast songs, but to save power and battery you might want to handle this dynamically.
35
+
36
+
The following example illustrates a full integration with a HTML Media Element like `<audio />` or `<video />`. This should be a good reference on how to implement the related sync with your media player.
37
+
Most things should be quite obvious like syncing volume, playback speed and providing the time and duration.
@@ -46,3 +52,172 @@ Some key reasons behind this is:
46
52
47
53
Nevertheless we want to give you some guidance on how to link alphaTab to YouTube. The following steps show how to use the [YouTube Player API Reference for iframe Embeds](https://developers.google.com/youtube/iframe_api_reference) together with alphaTab.
48
54
55
+
56
+
```js
57
+
// assuming a <div id="youtube"></div> somewhere
58
+
59
+
60
+
//
61
+
// 1. load the YouTube IFrame API. we use promises to have a bit better control over the initialization sequence
> > Seeks to a specified time in the video. If the player is paused when the function is called, it will remain paused. If the function is called from another state (playing, video cued, etc.), the player will play the video.
180
+
>
181
+
> alphaTab might initially do some seeking to the start position. This can cause the video to directly start playing which you might not want.
182
+
> To workaround this problem you could adjust the handler to check the player state and react accordingly.
Copy file name to clipboardExpand all lines: docs/guides/exporter.mdx
+1-5Lines changed: 1 addition & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,11 +12,7 @@ import { SinceBadge } from '@site/src/components/SinceBadge';
12
12
After alphaTab has loaded a full [`Score`](/docs/reference/score) object from any input source, it can also be exported again to one of the supported export formats.
13
13
Supported export formats:
14
14
15
-
- Guitar Pro 7 (alphaTab.exporter.Gp7Exporter) <spanclassName="badge badge--info">since 1.2.0-alpha.75</span>
16
-
17
-
:::note
18
-
More exporters are planned for the 1.5 release unless special feature requests of users are incoming.
19
-
:::
15
+
- Guitar Pro 7 (alphaTab.exporter.Gp7Exporter) <spanclassName="badge badge--info">since 1.2.0</span>
20
16
21
17
To export a `Score` object the corresponding exporter needs to be created and called. Then the resulting binary array can be used further to
22
18
trigger a download, send it to a server, save it to a file etc.
0 commit comments