Skip to content

Commit cda72a9

Browse files
committed
docs: Cleanup some docs regarding deprecations and new features
1 parent 479f823 commit cda72a9

3 files changed

Lines changed: 27 additions & 101 deletions

File tree

docs/getting-started/configuration-web.mdx

Lines changed: 5 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@ Simply create a div container where you want alphaTab to be located on your page
1313
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
1414
and no resizes to alphaTab will happen either.
1515

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:
1918

2019
```html
2120
<div id="alphaTab"></div>
@@ -27,78 +26,20 @@ const api = new alphaTab.AlphaTabApi(element);
2726

2827
## Settings
2928

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-
import Tabs from '@theme/Tabs';
43-
import TabItem from '@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-
<TabItem value="js">
54-
5529
The settings object is passed to the constructor of the API object as second parameter:
5630

5731
```js
5832
const api = new alphaTab.AlphaTabApi(element, {
5933
// any settings go here
6034
});
61-
```
62-
63-
</TabItem>
64-
<TabItem value="jq">
6535

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-
const api = $('#alphaTab').alphaTab();
7036
```
7137

72-
</TabItem>
73-
<TabItem value="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.
77-
78-
```html
79-
<div id="alphaTab" data-layout-mode="horizontal"></div>
80-
```
81-
```js
82-
const api = new alphaTab.AlphaTabApi(element);
83-
```
84-
85-
</TabItem>
86-
</Tabs>
87-
8838
## Events
8939

90-
Events of alphaTab can be either subscribed on the API object directly, or via the DOM element to which alphaTab is attached.
40+
Events of alphaTab should be either subscribed on the API object.
9141
Please refer to the [API Reference](/docs/reference/api) to find a full list of events available.
9242

93-
<Tabs
94-
defaultValue="js"
95-
values={[
96-
{ label: 'API Object', value: 'js', },
97-
{ label: 'DOM events', value: 'html', }
98-
]
99-
}>
100-
<TabItem value="js">
101-
10243
Each event has an `.on(handler)` and `.off(handler)` function to subscribe or unsubscribe.
10344

10445
```js
@@ -108,35 +49,12 @@ api.scoreLoaded.on( (score) => {
10849
});
10950
```
11051

111-
</TabItem>
112-
</Tabs>
113-
11452
## API
11553

116-
The main interaction with alphaTab happens through the API object or via jQuery plugin.
54+
The main interaction with alphaTab happens through the API object.
11755
Simply use any [available API](/docs/reference/api) to get/set details or trigger actions.
11856

119-
<Tabs
120-
defaultValue="js"
121-
values={[
122-
{ label: 'API Object', value: 'js', },
123-
{ label: 'jQuery API', value: 'jq', }
124-
]
125-
}>
126-
<TabItem value="js">
127-
12857
```js
12958
const api = new alphaTab.AlphaTabApi(element);
13059
api.tex('\title "Hello AlphaTab" . 1.1*4')
131-
```
132-
133-
</TabItem>
134-
<TabItem value="jq">
135-
136-
```js
137-
$(element).alphaTab('tex', '\title "Hello AlphaTab" . 1.1*4')
138-
```
139-
140-
</TabItem>
141-
142-
</Tabs>
60+
```

docs/guides/handling-midi-events.mdx

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,7 @@ From this starting point we will be adding the logic.
124124
<span id="counter">1</span>
125125
<span id="and">and</span>
126126
</div>
127-
<div id="alphaTab" data-player-scrolloffsety="-30" data-tex="true"
128-
data-player-enableplayer="true"
129-
data-player-soundfont="https://cdn.jsdelivr.net/npm/@coderline/alphatab@alpha/dist/soundfont/sonivox.sf2">
127+
<div id="alphaTab">
130128
\ts 3 4
131129
1.4.8 1.4{g}.8 2.4.8 2.4{g}.8 3.4.8 3.4{g}.8 |
132130
1.4.8 1.4{g}.8 2.4.8 2.4{g}.8 3.4.8 3.4{g}.8 |
@@ -135,7 +133,16 @@ From this starting point we will be adding the logic.
135133

136134
<script type="text/javascript">
137135
const el = document.getElementById('alphaTab');
138-
let api = new alphaTab.AlphaTabApi(el);
136+
let api = new alphaTab.AlphaTabApi(el, {
137+
core: {
138+
tex: true
139+
},
140+
player: {
141+
playerMode: alphaTab.PlayerMode.EnabledAutomatic,
142+
scrollOffsetY: -30,
143+
soundFont: "https://cdn.jsdelivr.net/npm/@coderline/alphatab@alpha/dist/soundfont/sonivox.sf2"
144+
}
145+
});
139146
api.metronomeVolume = 1;
140147
api.playbackSpeed = 0.5;
141148
@@ -300,9 +307,7 @@ also cause some performance degredation and as there is a bit audio latency invo
300307
<span id="counter">1</span>
301308
<span id="and">and</span>
302309
</div>
303-
<div id="alphaTab" data-player-scrolloffsety="-30" data-tex="true"
304-
data-player-enableplayer="true"
305-
data-player-soundfont="https://cdn.jsdelivr.net/npm/@coderline/alphatab@alpha/dist/soundfont/sonivox.sf2">
310+
<div id="alphaTab">
306311
\ts 3 4
307312
1.4.8 1.4{g}.8 2.4.8 2.4{g}.8 3.4.8 3.4{g}.8 |
308313
1.4.8 1.4{g}.8 2.4.8 2.4{g}.8 3.4.8 3.4{g}.8 |
@@ -311,7 +316,16 @@ also cause some performance degredation and as there is a bit audio latency invo
311316

312317
<script type="text/javascript">
313318
const el = document.getElementById('alphaTab');
314-
let api = new alphaTab.AlphaTabApi(el);
319+
let api = new alphaTab.AlphaTabApi(el, {
320+
core: {
321+
tex: true
322+
},
323+
player: {
324+
playerMode: alphaTab.PlayerMode.EnabledAutomatic,
325+
scrollOffsetY: -30,
326+
soundFont: "https://cdn.jsdelivr.net/npm/@coderline/alphatab@alpha/dist/soundfont/sonivox.sf2"
327+
}
328+
});
315329
api.metronomeVolume = 1;
316330
api.playbackSpeed = 0.5;
317331

docs/introduction.mdx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,6 @@ the information about music sheets. alphaTab has importers for:
124124
* [CapXML](https://www.capella.de/CapXML/) files `.cap` which is an open XML based standard by Capella Software
125125
* [alphaTex](/docs/alphatex/introduction) which is a text based format optimized for writing music notation in a textual format
126126

127-
:::note
128-
There exist many *dialects* of MusicXML and due to its very nature of describing music sheets in a very visual way,
129-
only a limited subset of MusicXML is actually supported. If you encounter issues or missing features do not hesistate
130-
to contact us on Gitter or GitHub to add support for missing features.
131-
:::
132-
133127
## The render engine
134128
This engine is what makes the music sheet visible. alphaTab takes all the information stored in the data model
135129
and does a visual layouting and rendering which is called music engraving.

0 commit comments

Comments
 (0)