Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions docs/guides/audio-export.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ The audio exporter follows an asynchronous pull pattern:
To export the audio you follow tree main steps:

1. You start a new exporter with [`await api.exportAudio(...)`](/docs/reference/api/exportaudio.mdx).
2. You call [`exporter.render(<milliseconds>)`](/docs/reference/types/synth/iaudioexporter/render.mdx) to produce a chunk of audio which you can then process further. (repeated until end is reached).
3. You cleanup the exporter via [`exporter.destroy()`](/docs/reference/types/synth/iaudioexporter/destroy.mdx). The exporter also implements `Disposable` (`IDisposable` for C#, `AutoCloseable` for `Kotlin`) which allows easy cleanup via language features if supported.
2. You call [`exporter.render(<milliseconds>)`](/docs/reference/types/synth/iaudioexporter#render) to produce a chunk of audio which you can then process further. (repeated until end is reached).
3. You cleanup the exporter via [`exporter.destroy()`](/docs/reference/types/synth/iaudioexporter#destroy). The exporter also implements `Disposable` (`IDisposable` for C#, `AutoCloseable` for `Kotlin`) which allows easy cleanup via language features if supported.

> [!WARNING]
> The raw audio samples for a whole song can consume quite a huge amount of memory: A calculation example:
Expand All @@ -52,14 +52,14 @@ To export the audio you follow tree main steps:

The [`AudioExportOptions`](/docs/reference/types/synth/audioexportoptions/index.mdx) allow customizing various aspects of the audio exported:

* [`soundFonts`](/docs/reference/types/synth/audioexportoptions/soundfonts.mdx) can be used to customize the soundfonts used during export.
* [`sampleRate`](/docs/reference/types/synth/audioexportoptions/samplerate.mdx) can be used to customize the sample rate of the exported audio.
* [`useSyncPoints`](/docs/reference/types/synth/audioexportoptions/usesyncpoints.mdx) controls whether the sync points of the currently loaded song are appled during audio generation.
* [`masterVolume`](/docs/reference/types/synth/audioexportoptions/mastervolume.mdx) controls the master volume of the generated audio.
* [`metronomeVolume`](/docs/reference/types/synth/audioexportoptions/metronomevolume.mdx) controls the volume of the metronome ticks. (keep in mind that the use of `useSyncPoints` changes the audio duration, the metronome is aligned with the music notes, not with the synthesized audio)
* [`playbackRange`](/docs/reference/types/synth/audioexportoptions/playbackrange.mdx) controls the audio range which is exported.
* [`trackVolume`](/docs/reference/types/synth/audioexportoptions/trackvolume.mdx) controls the volume of every track (percentage-wise to the already configured absolute volume)
* [`trackTranspositionPitches`](/docs/reference/types/synth/audioexportoptions/tracktranspositionpitches.mdx) controls an additional transposition pitch for the tracks.
* [`soundFonts`](/docs/reference/types/synth/audioexportoptions#soundfonts) can be used to customize the soundfonts used during export.
* [`sampleRate`](/docs/reference/types/synth/audioexportoptions#samplerate) can be used to customize the sample rate of the exported audio.
* [`useSyncPoints`](/docs/reference/types/synth/audioexportoptions#usesyncpoints) controls whether the sync points of the currently loaded song are appled during audio generation.
* [`masterVolume`](/docs/reference/types/synth/audioexportoptions#mastervolume) controls the master volume of the generated audio.
* [`metronomeVolume`](/docs/reference/types/synth/audioexportoptions#metronomevolume) controls the volume of the metronome ticks. (keep in mind that the use of `useSyncPoints` changes the audio duration, the metronome is aligned with the music notes, not with the synthesized audio)
* [`playbackRange`](/docs/reference/types/synth/audioexportoptions#playbackrange) controls the audio range which is exported.
* [`trackVolume`](/docs/reference/types/synth/audioexportoptions#trackvolume) controls the volume of every track (percentage-wise to the already configured absolute volume)
* [`trackTranspositionPitches`](/docs/reference/types/synth/audioexportoptions#tracktranspositionpitches) controls an additional transposition pitch for the tracks.

## Example

Expand Down
6 changes: 3 additions & 3 deletions docs/guides/formatting-templates.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ import {FormattingTemplateSample} from '@site/src/components/FormattingTemplateS

The most important parts to know:

* The [`style`](/docs/reference/types/model/score/style) on [`alphaTab.model.Score`](/docs/reference/types/model/score) is used to adjust the style of the visual elements.
* The [`headerAndFooter`](/docs/reference/types/model/scorestyle/headerandfooter) on [`alphaTab.model.ScoreStyle`](/docs/reference/types/model/scorestyle/) is used to adjust the text, visibility and alignment of the header and footer elements.
* The [`colors`](/docs/reference/types/model/elementstyle/colors) on `alphaTab.model.ScoreStyle` is used to adjust the color of the header and footer elements (and others).
* The [`style`](/docs/reference/types/model/score#style) on [`alphaTab.model.Score`](/docs/reference/types/model/score) is used to adjust the style of the visual elements.
* The [`headerAndFooter`](/docs/reference/types/model/scorestyle#headerandfooter) on [`alphaTab.model.ScoreStyle`](/docs/reference/types/model/scorestyle/) is used to adjust the text, visibility and alignment of the header and footer elements.
* The [`colors`](/docs/reference/types/model/elementstyle#colors) on `alphaTab.model.ScoreStyle` is used to adjust the color of the header and footer elements (and others).
* The [`alphaTab.model.ScoreSubElement`](/docs/reference/types/model/scoresubelement) defines the possible list of elements to be styled (not all are song info related)

The `template` is a string which can have following placeholders which are then replaced with the respective info of the song:
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/_apiTable.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ import { Signature } from "@site/src/components/Signature";
</a>
</td>
<td>
The currently configured output device if changed via <Signature style="inline" js={[["identifier","setOutputDevice"]]} />.
The currently configured output device if changed via <Signature style="inline" js={[["identifier","setOutputDevice"]]}>setOutputDevice</Signature> .
</td>
</tr>
<tr>
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/_settingsTable.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import { Signature } from "@site/src/components/Signature";
</a>
</td>
<td>
Whether in the <Signature style="inline" js={[["identifier","BoundsLookup"]]} /> also the position and area of each individual note is provided.
Whether in the <Signature style="inline" js={[["identifier","BoundsLookup"]]}>BoundsLookup</Signature> also the position and area of each individual note is provided.
</td>
</tr>
<tr>
Expand Down
36 changes: 17 additions & 19 deletions docs/reference/api/activebeatschanged.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ sidebar_custom_props:
import { Tabs, TabItem, CodeBadge, SinceBadge, DynHeading, Link, Signature } from '@site/src/reference-commons'

<SinceBadge since="1.2.3" />

### Description
This event is fired when the currently active beats across all tracks change. Unlike the <Signature style="inline" js={[["identifier","playedBeatChanged","/docs/reference/types/alphatabapibase/playedbeatchanged"]]} /> event this event contains the beats of all tracks and voices independent of them being rendered.
This event is fired when the currently active beats across all tracks change. Unlike the <Signature style="inline" js={[["identifier","playedBeatChanged","/docs/reference/types/alphatabapibase#playedbeatchanged"]]}>playedBeatChanged</Signature> event this event contains the beats of all tracks and voices independent of them being rendered.

<Signature style="block"
js={[["keyword","readonly"],["whitespace"," "],["identifier","activeBeatsChanged"],["token",":"],["whitespace"," "],["identifier","IEventEmitterOfT","/docs/reference/types/ieventemitteroft"],["token","<"],["identifier","ActiveBeatsChangedEventArgs","/docs/reference/types/synth/activebeatschangedeventargs"],["token",">"],["token",";"]]}
Expand All @@ -31,28 +29,28 @@ This event is fired when the currently active beats across all tracks change. Un
]}
>
<TabItem value="javascript">
```js
const api = new alphaTab.AlphaTabApi(document.querySelector('#alphaTab'));
api.activeBeatsChanged.on(args => {
updateHighlights(args.activeBeats);
});
```js
const api = new alphaTab.AlphaTabApi(document.querySelector('#alphaTab'));
api.activeBeatsChanged.on(args => {
updateHighlights(args.activeBeats);
});
```
</TabItem>
<TabItem value="csharp">
```cs
var api = new AlphaTabApi<MyControl>(...);
api.ActiveBeatsChanged.On(args =>
{
UpdateHighlights(args.ActiveBeats);
});
```cs
var api = new AlphaTabApi<MyControl>(...);
api.ActiveBeatsChanged.On(args =>
{
UpdateHighlights(args.ActiveBeats);
});
```
</TabItem>
<TabItem value="android">
```kotlin
val api = AlphaTabApi<MyControl>(...)
api.activeBeatsChanged.on { args ->
updateHighlights(args.activeBeats)
}
```kotlin
val api = AlphaTabApi<MyControl>(...)
api.activeBeatsChanged.on { args ->
updateHighlights(args.activeBeats)
}
```
</TabItem>
</Tabs>
2 changes: 0 additions & 2 deletions docs/reference/api/actualplayermode.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import { Tabs, TabItem, CodeBadge, SinceBadge, DynHeading, Link, Signature, Prop

<SinceBadge since="1.6.0" />
<PropertyDescription />

### Description
The actual player mode which is currently active. Allows determining whether a backing track or the synthesizer is active in case automatic detection is enabled.

<Signature style="block"
Expand Down
34 changes: 16 additions & 18 deletions docs/reference/api/beatmousedown.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ sidebar_custom_props:
import { Tabs, TabItem, CodeBadge, SinceBadge, DynHeading, Link, Signature } from '@site/src/reference-commons'

<SinceBadge since="0.9.7" />

### Description
This event is fired whenever a the user presses the mouse button on a beat.

<Signature style="block"
Expand All @@ -31,28 +29,28 @@ This event is fired whenever a the user presses the mouse button on a beat.
]}
>
<TabItem value="javascript">
```js
const api = new alphaTab.AlphaTabApi(document.querySelector('#alphaTab'));
api.beatMouseDown.on((beat) => {
startSelectionOnBeat(beat);
});
```js
const api = new alphaTab.AlphaTabApi(document.querySelector('#alphaTab'));
api.beatMouseDown.on((beat) => {
startSelectionOnBeat(beat);
});
```
</TabItem>
<TabItem value="csharp">
```cs
var api = new AlphaTabApi<MyControl>(...);
api.BeatMouseDown.On(beat =>
{
StartSelectionOnBeat(args);
});
```cs
var api = new AlphaTabApi<MyControl>(...);
api.BeatMouseDown.On(beat =>
{
StartSelectionOnBeat(args);
});
```
</TabItem>
<TabItem value="android">
```kotlin
val api = AlphaTabApi<MyControl>(...)
api.beatMouseDown.on { beat ->
startSelectionOnBeat(args)
}
```kotlin
val api = AlphaTabApi<MyControl>(...)
api.beatMouseDown.on { beat ->
startSelectionOnBeat(args)
}
```
</TabItem>
</Tabs>
34 changes: 16 additions & 18 deletions docs/reference/api/beatmousemove.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ sidebar_custom_props:
import { Tabs, TabItem, CodeBadge, SinceBadge, DynHeading, Link, Signature } from '@site/src/reference-commons'

<SinceBadge since="0.9.7" />

### Description
This event is fired whenever the user moves the mouse over a beat after the user already pressed the button on a beat.

<Signature style="block"
Expand All @@ -31,28 +29,28 @@ This event is fired whenever the user moves the mouse over a beat after the user
]}
>
<TabItem value="javascript">
```js
const api = new alphaTab.AlphaTabApi(document.querySelector('#alphaTab'));
api.beatMouseMove.on((beat) => {
expandSelectionToBeat(beat);
});
```js
const api = new alphaTab.AlphaTabApi(document.querySelector('#alphaTab'));
api.beatMouseMove.on((beat) => {
expandSelectionToBeat(beat);
});
```
</TabItem>
<TabItem value="csharp">
```cs
var api = new AlphaTabApi<MyControl>(...);
api.BeatMouseMove.On(beat =>
{
ExpandSelectionToBeat(beat);
});
```cs
var api = new AlphaTabApi<MyControl>(...);
api.BeatMouseMove.On(beat =>
{
ExpandSelectionToBeat(beat);
});
```
</TabItem>
<TabItem value="android">
```kotlin
val api = AlphaTabApi<MyControl>(...)
api.beatMouseMove.on { beat ->
expandSelectionToBeat(beat)
}
```kotlin
val api = AlphaTabApi<MyControl>(...)
api.beatMouseMove.on { beat ->
expandSelectionToBeat(beat)
}
```
</TabItem>
</Tabs>
36 changes: 17 additions & 19 deletions docs/reference/api/beatmouseup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ sidebar_custom_props:
import { Tabs, TabItem, CodeBadge, SinceBadge, DynHeading, Link, Signature } from '@site/src/reference-commons'

<SinceBadge since="0.9.7" />

### Description
This event is fired whenever the user releases the mouse after a mouse press on a beat. This event is fired regardless of whether the mouse was released on a beat.
This event is fired whenever the user releases the mouse after a mouse press on a beat. This event is fired regardless of whether the mouse was released on a beat.
The parameter is null if the mouse was released somewhere beside the beat.

<Signature style="block"
Expand All @@ -32,28 +30,28 @@ The parameter is null if the mouse was released somewhere beside the beat.
]}
>
<TabItem value="javascript">
```js
const api = new alphaTab.AlphaTabApi(document.querySelector('#alphaTab'));
api.beatMouseUp.on((beat) => {
hideSelection(beat);
});
```js
const api = new alphaTab.AlphaTabApi(document.querySelector('#alphaTab'));
api.beatMouseUp.on((beat) => {
hideSelection(beat);
});
```
</TabItem>
<TabItem value="csharp">
```cs
var api = new AlphaTabApi<MyControl>(...);
api.BeatMouseUp.On(beat =>
{
HideSelection(beat);
});
```cs
var api = new AlphaTabApi<MyControl>(...);
api.BeatMouseUp.On(beat =>
{
HideSelection(beat);
});
```
</TabItem>
<TabItem value="android">
```kotlin
val api = AlphaTabApi<MyControl>(...)
api.beatMouseUp.on { beat ->
hideSelection(beat)
}
```kotlin
val api = AlphaTabApi<MyControl>(...)
api.beatMouseUp.on { beat ->
hideSelection(beat)
}
```
</TabItem>
</Tabs>
48 changes: 23 additions & 25 deletions docs/reference/api/boundslookup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,29 @@ import { Tabs, TabItem, CodeBadge, SinceBadge, DynHeading, Link, Signature, Prop

<SinceBadge since="1.5.0" />
<PropertyDescription />

### Description
The tick cache allowing lookup of midi ticks to beats. In older versions of alphaTab you can access the `boundsLookup` via <Signature style="inline" js={[["identifier","boundsLookup","/docs/reference/types/rendering/iscorerenderer/boundslookup"]]} /> on <Signature style="inline" js={[["identifier","renderer","/docs/reference/types/alphatabapibase/renderer"]]} />.

After the rendering completed alphaTab exposes via this lookup the location of the individual
notation elements. The lookup provides fast access to the bars and beats at a given location.
If the <Signature style="inline" js={[["identifier","CoreSettings.includeNoteBounds","/docs/reference/settings/core/includenotebounds"]]} /> option was activated also the location of the individual notes can be obtained.

The property contains a `BoundsLookup` instance which follows a hierarchical structure that represents
the tree of rendered elements.

The hierarchy is: `staffSystems > bars(1) > bars(2) > beats > notes`

* `staffSystems` - Represent the bounds of the individual systems ("rows") where staves are contained.
* `bars(1)` - Represent the bounds of all bars for a particular master bar across all tracks.
* `bars(2)` - Represent the bounds of an individual bar of a track. The bounds on y-axis span the region of the staff and notes might exceed this bounds.
* `beats` - Represent the bounds of the individual beats within a track. The bounds on y-axis are equal to the bar bounds.
* `notes` - Represent the bounds of the individual note heads/numbers within a track.

Each bounds hierarchy have a `visualBounds` and `realBounds`.

* `visualBounds` - Represent the area covering all visually visible elements
* `realBounds` - Represents the actual bounds of the elements in this beat including whitespace areas.
* `noteHeadBounds` (only on `notes` level) - Represents the area of the note heads or number based on the staff

The tick cache allowing lookup of midi ticks to beats. In older versions of alphaTab you can access the `boundsLookup` via <Signature style="inline" js={[["identifier","boundsLookup","/docs/reference/types/rendering/iscorerenderer#boundslookup"]]}>boundsLookup</Signature> on <Signature style="inline" js={[["identifier","renderer","/docs/reference/types/alphatabapibase#renderer"]]}>renderer</Signature> .

After the rendering completed alphaTab exposes via this lookup the location of the individual
notation elements. The lookup provides fast access to the bars and beats at a given location.
If the <Signature style="inline" js={[["identifier","CoreSettings.includeNoteBounds","/docs/reference/settings/core/includenotebounds"]]}>CoreSettings.includeNoteBounds</Signature> option was activated also the location of the individual notes can be obtained.

The property contains a `BoundsLookup` instance which follows a hierarchical structure that represents
the tree of rendered elements.

The hierarchy is: `staffSystems > bars(1) > bars(2) > beats > notes`

* `staffSystems` - Represent the bounds of the individual systems ("rows") where staves are contained.
* `bars(1)` - Represent the bounds of all bars for a particular master bar across all tracks.
* `bars(2)` - Represent the bounds of an individual bar of a track. The bounds on y-axis span the region of the staff and notes might exceed this bounds.
* `beats` - Represent the bounds of the individual beats within a track. The bounds on y-axis are equal to the bar bounds.
* `notes` - Represent the bounds of the individual note heads/numbers within a track.

Each bounds hierarchy have a `visualBounds` and `realBounds`.

* `visualBounds` - Represent the area covering all visually visible elements
* `realBounds` - Represents the actual bounds of the elements in this beat including whitespace areas.
* `noteHeadBounds` (only on `notes` level) - Represents the area of the note heads or number based on the staff

You can check out the individual sizes and regions.

<Signature style="block"
Expand Down
2 changes: 0 additions & 2 deletions docs/reference/api/canvaselement.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import { Tabs, TabItem, CodeBadge, SinceBadge, DynHeading, Link, Signature, Prop

<SinceBadge since="0.9.4" />
<PropertyDescription />

### Description
The UI container that will hold all rendered results.

<Signature style="block"
Expand Down
22 changes: 10 additions & 12 deletions docs/reference/api/changetrackmute.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ sidebar_custom_props:
import { Tabs, TabItem, CodeBadge, SinceBadge, DynHeading, Link, Signature } from '@site/src/reference-commons'

<SinceBadge since="0.9.4" />

### Description
Changes the given tracks to be muted or not. This will result in a muting of the primary and secondary midi channel that the track uses
Changes the given tracks to be muted or not. This will result in a muting of the primary and secondary midi channel that the track uses
for playback. If the track shares the channels with another track, all tracks will be muted as during playback they cannot be distinguished.

<Signature style="block"
Expand Down Expand Up @@ -58,21 +56,21 @@ for playback. If the track shares the channels with another track, all tracks wi
]}
>
<TabItem value="javascript">
```js
const api = new alphaTab.AlphaTabApi(document.querySelector('#alphaTab'));
api.changeTrackMute([api.score.tracks[0], api.score.tracks[1]], true);
```js
const api = new alphaTab.AlphaTabApi(document.querySelector('#alphaTab'));
api.changeTrackMute([api.score.tracks[0], api.score.tracks[1]], true);
```
</TabItem>
<TabItem value="csharp">
```cs
var api = new AlphaTabApi<MyControl>(...);
api.ChangeTrackMute(new Track[] { api.Score.Tracks[0], api.Score.Tracks[1] }, true);
```cs
var api = new AlphaTabApi<MyControl>(...);
api.ChangeTrackMute(new Track[] { api.Score.Tracks[0], api.Score.Tracks[1] }, true);
```
</TabItem>
<TabItem value="android">
```kotlin
val api = AlphaTabApi<MyControl>(...)
api.changeTrackMute(alphaTab.collections.List<alphaTab.model.Track>(api.score.tracks[0], api.score.tracks[1]), true);
```kotlin
val api = AlphaTabApi<MyControl>(...)
api.changeTrackMute(alphaTab.collections.List<alphaTab.model.Track>(api.score.tracks[0], api.score.tracks[1]), true);
```
</TabItem>
</Tabs>
Loading