diff --git a/docs/reference/settings/core/enablelazyloading.mdx b/docs/reference/settings/core/enablelazyloading.mdx index 47e24b5..8e48c48 100644 --- a/docs/reference/settings/core/enablelazyloading.mdx +++ b/docs/reference/settings/core/enablelazyloading.mdx @@ -2,32 +2,63 @@ title: core.enableLazyLoading description: Enables lazy loading of the rendered music sheet chunks. sidebar_custom_props: - javaScriptOnly: true jsOnParent: true - category: Core - JavaScript Specific + category: Core since: 0.9.6 --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; import { SinceBadge } from '@site/src/components/SinceBadge'; +import { CodeBadge } from '@site/src/components/CodeBadge'; +import { PropertyDescription } from '@site/src/components/PropertyDescription'; +import { TypeTable, TypeRow } from '@site/src/components/TypeTable'; -import { PropertyDescription } from '@site/src/components/PropertyDescription'; -import {TypeTable, TypeRow} from '@site/src/components/TypeTable'; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefault
true
true
true
true
true
true
## Description AlphaTab renders the music sheet in smaller sub-chunks to have fast UI feedback. Not all of those sub-chunks are immediately appended to the DOM due to performance reasons. AlphaTab tries to detect which elements are visible on the screen, and only -appends those elements to the DOM. This reduces the load of the browser heavily but is not working for all layouts and use cases. -This setting set to false, ensures that all rendered items are instantly appended to the DOM. - - - -## Types - - - - - -## Default Value - -`true` \ No newline at end of file +appends those elements to the DOM. This reduces the load of the browser heavily but is not working for all layouts and use cases. +This setting set to false, ensures that all rendered items are instantly appended to the DOM.# diff --git a/docs/reference/settings/core/engine.mdx b/docs/reference/settings/core/engine.mdx index 8d53e37..164539f 100644 --- a/docs/reference/settings/core/engine.mdx +++ b/docs/reference/settings/core/engine.mdx @@ -6,43 +6,63 @@ sidebar_custom_props: category: Core since: 0.9.6 --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; import { SinceBadge } from '@site/src/components/SinceBadge'; +import { CodeBadge } from '@site/src/components/CodeBadge'; +import { PropertyDescription } from '@site/src/components/PropertyDescription'; +import { TypeTable, TypeRow } from '@site/src/components/TypeTable'; -import { PropertyDescription } from '@site/src/components/PropertyDescription'; -import {TypeTable, TypeRow} from '@site/src/components/TypeTable'; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefault
'default'
'default'
"default"
"default"
"default"
"default"
## Description -AlphaTab can use various render engines to draw the music notation. The available render engines is specific to the platform. Please refer to the table below to find out which engines are available on which platform. - - - -## Types - - - - `svg` - Outputs SVG strings.
- `html5` - Uses HTML5 canvas elements to render the music notation. -
- - `skia` - Available on all .net platforms. Uses [Skia](https://skia.org/) for rendering
- `gdi` - Only available desktop .net. Uses [GDI+](https://docs.microsoft.com/en-us/dotnet/framework/winforms/advanced/graphics-and-drawing-in-windows-forms) for rendering
- `svg` - Available on all .net platforms. Outputs SVG strings. -
- - `skia` - Uses [Skia](https://skia.org/) for rendering
- `android` - Uses [android.graphics.Canvas](https://developer.android.com/reference/android/graphics/Canvas) for rendering
- `svg` - Outputs SVG strings. -
-
- -## Default Value - -`default` which is mapped per platform: +AlphaTab can use various render engines to draw the music notation. The available render engines are specific to the platform. - - - - - \ No newline at end of file +| Type | Values | Available On Platform | +|-----------|-------------------------------------------------------------------------|--------------------------| +| `default` | Platform specific default engine (`svg` for web, `skia` for others) | all | +| `svg` | Uses a SVG string with Web Fonts to render the music notation. | all | +| `html5` | Uses HTML5 canvas elements to render the music notation. | `web` | +| `skia` | Uses alphaSkia (a cross platform Skia wrapper) to render music notation | `net`, `android`, `node` | diff --git a/docs/reference/settings/core/file.mdx b/docs/reference/settings/core/file.mdx index f6d8b66..6e1706e 100644 --- a/docs/reference/settings/core/file.mdx +++ b/docs/reference/settings/core/file.mdx @@ -7,27 +7,48 @@ sidebar_custom_props: category: Core - JavaScript Specific since: 0.9.6 --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; import { SinceBadge } from '@site/src/components/SinceBadge'; +import { CodeBadge } from '@site/src/components/CodeBadge'; +import { PropertyDescription } from '@site/src/components/PropertyDescription'; +import { TypeTable, TypeRow } from '@site/src/components/TypeTable'; -import { PropertyDescription } from '@site/src/components/PropertyDescription'; -import {TypeTable, TypeRow} from '@site/src/components/TypeTable'; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefault
null
null
null
null
## Description - AlphaTab can automatically load and render a file after initialization. This eliminates the need of manually calling one of the load methods which are available. alphaTab will automatically initiate an `XMLHttpRequest` after initialization to load and display the provided url of this setting. Note that this setting is only interpreted once on initialization. - - - -## Types - - - - - -## Default Value - -`null` \ No newline at end of file diff --git a/docs/reference/settings/core/fontdirectory.mdx b/docs/reference/settings/core/fontdirectory.mdx index 1b25c12..45e660c 100644 --- a/docs/reference/settings/core/fontdirectory.mdx +++ b/docs/reference/settings/core/fontdirectory.mdx @@ -7,28 +7,49 @@ sidebar_custom_props: category: Core - JavaScript Specific since: 0.9.6 --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; import { SinceBadge } from '@site/src/components/SinceBadge'; +import { CodeBadge } from '@site/src/components/CodeBadge'; +import { PropertyDescription } from '@site/src/components/PropertyDescription'; +import { TypeTable, TypeRow } from '@site/src/components/TypeTable'; -import { PropertyDescription } from '@site/src/components/PropertyDescription'; -import {TypeTable, TypeRow} from '@site/src/components/TypeTable'; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefault
automatic
automatic
automatic
automatic
## Description - AlphaTab will generate some dynamic CSS that is needed for displaying the music symbols correctly. For this it needs to know -where the Web Font files of [Bravura](https://github.com/steinbergmedia/bravura) are. Normally alphaTab expects -them to be in a `Font` subfolder beside the script file. If this is not the case, this setting must be used to configure the path. -Alternatively also a global variable `ALPHATAB_FONT` can be set on the page before initializing alphaTab. - - - -## Types - - - - - -## Default Value - -`${AlphaTabScriptFolder}/font/` \ No newline at end of file +where the Web Font files of [Bravura](https://github.com/steinbergmedia/bravura) are. Normally alphaTab expects +them to be in a `font` subfolder beside the script file. If this is not the case, this setting must be used to configure the path. +Alternatively also a global variable `ALPHATAB_FONT` can be set on the page before initializing alphaTab. diff --git a/docs/reference/settings/core/includenotebounds.mdx b/docs/reference/settings/core/includenotebounds.mdx index 247cc9e..4b37e7b 100644 --- a/docs/reference/settings/core/includenotebounds.mdx +++ b/docs/reference/settings/core/includenotebounds.mdx @@ -1,48 +1,93 @@ --- title: core.includeNoteBounds -description: Gets or sets whether in the BoundsLookup also the position and area of each individual note is provided. +description: Whether to include individual note positions in the BoundsLookup. sidebar_custom_props: jsOnParent: true category: Core since: 0.9.6 --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; import { SinceBadge } from '@site/src/components/SinceBadge'; +import { CodeBadge } from '@site/src/components/CodeBadge'; +import { PropertyDescription } from '@site/src/components/PropertyDescription'; +import { TypeTable, TypeRow } from '@site/src/components/TypeTable'; -import { PropertyDescription } from '@site/src/components/PropertyDescription'; -import {TypeTable, TypeRow} from '@site/src/components/TypeTable'; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefault
false
false
false
false
false
false
## Description -AlphaTab collects the position of the rendered music notation elements during the rendering process. This way some level of interactivity can be provided like the feature that seeks to the corresponding position when clicking on a beat. -By default the position of the individual notes is not collected due to performance reasons. If access to note position information is needed, this setting can enable it. - - - -## Types +AlphaTab collects the position of the rendered music notation elements during the rendering process. +This way some level of interactivity can be provided like the feature that seeks to the corresponding position when clicking on a beat. +By default the position of the individual notes is not collected due to performance reasons. +If access to note position information is needed, this setting can enable it. - - - +## Examples -## Default Value - -`false` - -## Example - JavaScript + + ```js const settings = { core: { - includeNoteBounds: true + includeNoteBounds: true } }; -let api = new alphaTab.AlphaTabApi(document.querySelector('#alphaTab'), settings); +const api = new alphaTab.AlphaTabApi(document.querySelector('#alphaTab'), settings); api.renderFinished.on(function() { - var lookup = api.renderer.boundsLookup; - var x = 100; - var y = 100; - var beat = lookup.getBeatAtPos(x, y); - var note = lookup.getNoteAtPos(beat, x, y); + const lookup = api.renderer.boundsLookup; + const x = 100; + const y = 100; + const beat = lookup.getBeatAtPos(x, y); + const note = lookup.getNoteAtPos(beat, x, y); }); -``` \ No newline at end of file +``` + + + \ No newline at end of file diff --git a/docs/reference/settings/core/loglevel.mdx b/docs/reference/settings/core/loglevel.mdx index 6a46c81..24dd14b 100644 --- a/docs/reference/settings/core/loglevel.mdx +++ b/docs/reference/settings/core/loglevel.mdx @@ -6,58 +6,99 @@ sidebar_custom_props: category: Core since: 0.9.6 --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; import { SinceBadge } from '@site/src/components/SinceBadge'; +import { CodeBadge } from '@site/src/components/CodeBadge'; +import { PropertyDescription } from '@site/src/components/PropertyDescription'; +import { TypeTable, TypeRow } from '@site/src/components/TypeTable'; -import { PropertyDescription } from '@site/src/components/PropertyDescription'; -import {TypeTable, TypeRow} from '@site/src/components/TypeTable'; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefault
LogLevel.Info
LogLevel.Info
LogLevel.Info
LogLevel.Info
LogLevel.Info
LogLevel.Info
## Description -AlphaTab internally does quite a bit of logging for debugging and informational purposes. The log level of alphaTab can be controlled via this setting. - - +AlphaTab internally does quite a bit of logging for debugging and informational purposes. +The log level of alphaTab can be controlled via this setting. -## Types +## Related Types - - - `None` - No logging
- `Debug` - Debug level (internal details are displayed)
- `Info` - Info level (only important details are shown)
- `Warning`
- `Error` -
- - `none`
- `debug`
- `info`
- `warning`
- `error` -
- - `0` - None
- `1` - Debug
- `2` - Info
- `3` - Warning
- `4` - Error -
- - `None`
- `Debug`
- `Info`
- `Warning`
- `Error` -
- - `None`
- `Debug`
- `Info`
- `Warning`
- `Error` -
-
+### `enum alphaTab.LogLevel` -## Default Value + + +`import * as alphaTab from '@coderline/alphaTab';` -`Info` \ No newline at end of file +* `alphaTab.LogLevel.None` - No logging +* `alphaTab.LogLevel.Debug` - Debug level (internal details are displayed). +* `alphaTab.LogLevel.Info` - Info level (only important details are shown) +* `alphaTab.LogLevel.Warning` - Warning level +* `alphaTab.LogLevel.Error` - Error level. + + +* `"None"` - No logging +* `"Debug"` - Debug level (internal details are displayed). +* `"Info"` - Info level (only important details are shown) +* `"Warning"` - Warning level +* `"Error"` - Error level. + + +* `AlphaTab.LogLevel.None` - No logging +* `AlphaTab.LogLevel.Debug` - Debug level (internal details are displayed). +* `AlphaTab.LogLevel.Info` - Info level (only important details are shown) +* `AlphaTab.LogLevel.Warning` - Warning level +* `AlphaTab.LogLevel.Error` - Error level. + + +* `alphaTab.LogLevel.None` - No logging +* `alphaTab.LogLevel.Debug` - Debug level (internal details are displayed). +* `alphaTab.LogLevel.Info` - Info level (only important details are shown) +* `alphaTab.LogLevel.Warning` - Warning level +* `alphaTab.LogLevel.Error` - Error level. + + \ No newline at end of file diff --git a/docs/reference/settings/core/scriptfile.mdx b/docs/reference/settings/core/scriptfile.mdx index df595fc..d496edb 100644 --- a/docs/reference/settings/core/scriptfile.mdx +++ b/docs/reference/settings/core/scriptfile.mdx @@ -7,27 +7,50 @@ sidebar_custom_props: category: Core - JavaScript Specific since: 0.9.6 --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; import { SinceBadge } from '@site/src/components/SinceBadge'; +import { CodeBadge } from '@site/src/components/CodeBadge'; +import { PropertyDescription } from '@site/src/components/PropertyDescription'; +import { TypeTable, TypeRow } from '@site/src/components/TypeTable'; -import { PropertyDescription } from '@site/src/components/PropertyDescription'; -import {TypeTable, TypeRow} from '@site/src/components/TypeTable'; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefault
automatic
automatic
automatic
automatic
## Description AlphaTab needs to know the full URL to the script file it is contained in to launch the web workers. AlphaTab will do its best to auto-detect this path but in case it fails, this setting can be used to explicitly define it. Altenatively also a global variable `ALPHATAB_ROOT` can -be defined before initializing. Please be aware that bundling alphaTab together with other scripts might cause errors +be defined before initializing. Please be aware that bundling alphaTab together with other scripts might cause errors in case those scripts are not suitable for web workers. e.g. if there is a script bundled together with alphaTab that accesses the DOM, -this will cause an error when alphaTab starts this script as worker. - - - -## Types - - - - - -## Default Value -Absolute url to JavaScript file containing alphaTab. (auto detected) \ No newline at end of file +this will cause an error when alphaTab starts this script as worker. diff --git a/docs/reference/settings/core/tex.mdx b/docs/reference/settings/core/tex.mdx index 5cd6d51..3784f7f 100644 --- a/docs/reference/settings/core/tex.mdx +++ b/docs/reference/settings/core/tex.mdx @@ -7,33 +7,67 @@ sidebar_custom_props: category: Core - JavaScript Specific since: 0.9.6 --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; import { SinceBadge } from '@site/src/components/SinceBadge'; +import { CodeBadge } from '@site/src/components/CodeBadge'; +import { PropertyDescription } from '@site/src/components/PropertyDescription'; +import { TypeTable, TypeRow } from '@site/src/components/TypeTable'; -import { PropertyDescription } from '@site/src/components/PropertyDescription'; -import {TypeTable, TypeRow} from '@site/src/components/TypeTable'; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefault
false
false
false
false
## Description - -This setting allows you to fill alphaTex code into the DOM element and make alphaTab automatically +This setting allows you to fill alphaTex code into the DOM element and make alphaTab automatically load it when initializing. Note that this setting is only interpreted once on initialization. +## Examples + + + + ```html -
\title "Simple alphaTex init" . 3.3*4
+
\title "Simple alphaTex init" . 3.3*4
``` - - -## Types - - - - - -## Default Value - -`false` \ No newline at end of file +
+
\ No newline at end of file diff --git a/docs/reference/settings/core/tracks.mdx b/docs/reference/settings/core/tracks.mdx index 52ef30d..efb8e1e 100644 --- a/docs/reference/settings/core/tracks.mdx +++ b/docs/reference/settings/core/tracks.mdx @@ -7,35 +7,47 @@ sidebar_custom_props: category: Core - JavaScript Specific since: 0.9.6 --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; import { SinceBadge } from '@site/src/components/SinceBadge'; +import { CodeBadge } from '@site/src/components/CodeBadge'; +import { PropertyDescription } from '@site/src/components/PropertyDescription'; +import { TypeTable, TypeRow } from '@site/src/components/TypeTable'; -import { PropertyDescription } from '@site/src/components/PropertyDescription'; -import {TypeTable, TypeRow} from '@site/src/components/TypeTable'; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefault
null
null
null
null
## Description - This setting can be used in combinition with the `file` or `tex` option. It controls which of the tracks of the initially loaded file should be displayed. - - - -## Types - - - - If the `all` string is provided, all tracks of the song will be displayed. - - - If a single number is provided, the value represents the 0-based index of the track to display. - - - If a number array is provided, the values represent the 0-based indexes of the tracks to display. - - - - -## Default Value - -`null` \ No newline at end of file diff --git a/docs/reference/settings/core/useworkers.mdx b/docs/reference/settings/core/useworkers.mdx index f6de577..6d1cf93 100644 --- a/docs/reference/settings/core/useworkers.mdx +++ b/docs/reference/settings/core/useworkers.mdx @@ -6,22 +6,58 @@ sidebar_custom_props: category: Core since: 0.9.6 --- - +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; +import { SinceBadge } from '@site/src/components/SinceBadge'; +import { CodeBadge } from '@site/src/components/CodeBadge'; import { PropertyDescription } from '@site/src/components/PropertyDescription'; -import {TypeTable, TypeRow} from '@site/src/components/TypeTable'; - -## Description -AlphaTab normally tries to render the music sheet asynchronously in a worker. This reduces the load on the UI side and avoids hanging. However sometimes it might be more desirable to have -a synchronous rendering behavior. This setting can be set to false to synchronously render the music sheet on the UI side. +import { TypeTable, TypeRow } from '@site/src/components/TypeTable'; - + -## Types + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefault
true
true
true
true
true
true
- - - - -## Default Value - -`true` \ No newline at end of file +## Description +AlphaTab normally tries to render the music sheet asynchronously in a worker. +This reduces the load on the UI side and avoids hanging. However sometimes it might be more desirable to have +a synchronous rendering behavior. This setting can be set to false to synchronously render the music sheet on the UI side. diff --git a/docs/reference/settings/display/accoladebarpaddingright.mdx b/docs/reference/settings/display/accoladebarpaddingright.mdx new file mode 100644 index 0000000..9e61e20 --- /dev/null +++ b/docs/reference/settings/display/accoladebarpaddingright.mdx @@ -0,0 +1,50 @@ +--- +title: display.accoladeBarPaddingRight +description: The padding between the accolade bar and the start of the bar itself. +sidebar_custom_props: + category: Display + since: 1.4.0 +--- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; +import { SinceBadge } from '@site/src/components/SinceBadge'; +import { CodeBadge } from '@site/src/components/CodeBadge'; +import { PropertyDescription } from '@site/src/components/PropertyDescription'; +import { TypeTable, TypeRow } from '@site/src/components/TypeTable'; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefault
3
3
3
3
+ +## Description +The padding between the accolade (system bracket) and the start of the bar itself. diff --git a/docs/reference/settings/display/barcount.mdx b/docs/reference/settings/display/barcount.mdx index 0f10d38..86a518f 100644 --- a/docs/reference/settings/display/barcount.mdx +++ b/docs/reference/settings/display/barcount.mdx @@ -1,32 +1,52 @@ --- title: display.barCount -description: The total number of bars that should be rendered from the song. +description: The total number of bars that should be rendered from the song. sidebar_custom_props: - jsOnParent: true category: Display since: 0.9.6 --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; import { SinceBadge } from '@site/src/components/SinceBadge'; +import { CodeBadge } from '@site/src/components/CodeBadge'; +import { PropertyDescription } from '@site/src/components/PropertyDescription'; +import { TypeTable, TypeRow } from '@site/src/components/TypeTable'; -import { PropertyDescription } from '@site/src/components/PropertyDescription'; -import {TypeTable, TypeRow} from '@site/src/components/TypeTable'; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefault
-1
-1
-1
-1
## Description - -This setting sets the number of bars that should be rendered from the overall song. This setting can be used to -achieve a paging system or to only show partial bars of the same file. By this a tutorial alike display can be achieved -that explains various parts of the song. [Demo](/docs/showcase/layouts) - - - -## Types - - - - - -## Default Value - -`-1` - All bars from start \ No newline at end of file +This setting sets the number of bars that should be rendered from the overall song. This setting can be used to +achieve a paging system or to only show partial bars of the same file. By this, a tutorial alike display can be achieved +that explains various parts of the song. Set this to `-1` (default) for showing all bars. diff --git a/docs/reference/settings/display/barcountperpartial.mdx b/docs/reference/settings/display/barcountperpartial.mdx index 4c8af37..568329a 100644 --- a/docs/reference/settings/display/barcountperpartial.mdx +++ b/docs/reference/settings/display/barcountperpartial.mdx @@ -2,31 +2,51 @@ title: display.barCountPerPartial description: The number of bars that should be placed within one partial render. sidebar_custom_props: - jsOnParent: true category: Display since: 0.9.6 --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; import { SinceBadge } from '@site/src/components/SinceBadge'; +import { CodeBadge } from '@site/src/components/CodeBadge'; +import { PropertyDescription } from '@site/src/components/PropertyDescription'; +import { TypeTable, TypeRow } from '@site/src/components/TypeTable'; -import { PropertyDescription } from '@site/src/components/PropertyDescription'; -import {TypeTable, TypeRow} from '@site/src/components/TypeTable'; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefault
10
10
10
10
## Description - AlphaTab renders the whole music sheet in smaller chunks named "partials". This is to reduce the risk of encountering browser performance restrictions and it gives faster visual feedback to the user. This -setting controls how many bars are placed within such a partial. - - - -## Types - - - - - -## Default Value - -`10` \ No newline at end of file +setting controls how many bars are placed within such a partial. diff --git a/docs/reference/settings/display/barsperrow.mdx b/docs/reference/settings/display/barsperrow.mdx index 0d72849..e071d34 100644 --- a/docs/reference/settings/display/barsperrow.mdx +++ b/docs/reference/settings/display/barsperrow.mdx @@ -2,30 +2,50 @@ title: display.barsPerRow description: Limit the displayed bars per row. sidebar_custom_props: - jsOnParent: true category: Display since: 0.9.6 --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; import { SinceBadge } from '@site/src/components/SinceBadge'; +import { CodeBadge } from '@site/src/components/CodeBadge'; +import { PropertyDescription } from '@site/src/components/PropertyDescription'; +import { TypeTable, TypeRow } from '@site/src/components/TypeTable'; -import { PropertyDescription } from '@site/src/components/PropertyDescription'; -import {TypeTable, TypeRow} from '@site/src/components/TypeTable'; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefault
-1
-1
-1
-1
## Description - This setting sets the number of bars that should be put into one row during layouting. This setting is only respected -when using the layoutMode `page` where bars are aligned in rows. [Demo](/docs/showcase/layouts#page-layout-5-bars-per-row) - - - -## Types - - - - - -## Default Value - -`-1` - automatic \ No newline at end of file +when using the layoutMode `page` where bars are aligned in rows. diff --git a/docs/reference/settings/display/effectstaffpaddingbottom.mdx b/docs/reference/settings/display/effectstaffpaddingbottom.mdx new file mode 100644 index 0000000..51e31b5 --- /dev/null +++ b/docs/reference/settings/display/effectstaffpaddingbottom.mdx @@ -0,0 +1,50 @@ +--- +title: display.effectStaffPaddingBottom +description: The bottom padding applied to effect annotation staffs. +sidebar_custom_props: + category: Display + since: 1.4.0 +--- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; +import { SinceBadge } from '@site/src/components/SinceBadge'; +import { CodeBadge } from '@site/src/components/CodeBadge'; +import { PropertyDescription } from '@site/src/components/PropertyDescription'; +import { TypeTable, TypeRow } from '@site/src/components/TypeTable'; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefault
0
0
0
0
+ +## Description +The bottom padding applied to effect annotation staffs showing details like vibratos, lyrics etc. diff --git a/docs/reference/settings/display/effectstaffpaddingtop.mdx b/docs/reference/settings/display/effectstaffpaddingtop.mdx new file mode 100644 index 0000000..e9c51a7 --- /dev/null +++ b/docs/reference/settings/display/effectstaffpaddingtop.mdx @@ -0,0 +1,50 @@ +--- +title: display.effectStaffPaddingTop +description: The top padding applied to effect annotation staffs. +sidebar_custom_props: + category: Display + since: 1.4.0 +--- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; +import { SinceBadge } from '@site/src/components/SinceBadge'; +import { CodeBadge } from '@site/src/components/CodeBadge'; +import { PropertyDescription } from '@site/src/components/PropertyDescription'; +import { TypeTable, TypeRow } from '@site/src/components/TypeTable'; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefault
0
0
0
0
+ +## Description +The top padding applied to effect annotation staffs showing details like vibratos, lyrics etc. diff --git a/docs/reference/settings/display/firstsystempaddingtop.mdx b/docs/reference/settings/display/firstsystempaddingtop.mdx new file mode 100644 index 0000000..d62d506 --- /dev/null +++ b/docs/reference/settings/display/firstsystempaddingtop.mdx @@ -0,0 +1,51 @@ +--- +title: display.firstSystemPaddingTop +description: The top padding applied to the first system. +sidebar_custom_props: + category: Display + since: 1.4.0 +--- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; +import { SinceBadge } from '@site/src/components/SinceBadge'; +import { CodeBadge } from '@site/src/components/CodeBadge'; +import { PropertyDescription } from '@site/src/components/PropertyDescription'; +import { TypeTable, TypeRow } from '@site/src/components/TypeTable'; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefault
5
5
5
5
+ +## Description +The top padding applied to the first system right after top elements like the score information, +tuning and chord diagrams. diff --git a/docs/reference/settings/display/justifylastsystem.mdx b/docs/reference/settings/display/justifylastsystem.mdx index 105aa92..123b655 100644 --- a/docs/reference/settings/display/justifylastsystem.mdx +++ b/docs/reference/settings/display/justifylastsystem.mdx @@ -1,36 +1,54 @@ --- title: display.justifyLastSystem -description: Whether to justify also the last system in page layouts. +description: Whether to justify also the last system in page layouts. sidebar_custom_props: - jsOnParent: true category: Display - since: 1.3.0-alpha.720 + since: 1.3.0 --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; import { SinceBadge } from '@site/src/components/SinceBadge'; - - - +import { CodeBadge } from '@site/src/components/CodeBadge'; import { PropertyDescription } from '@site/src/components/PropertyDescription'; -import {TypeTable, TypeRow} from '@site/src/components/TypeTable'; +import { TypeTable, TypeRow } from '@site/src/components/TypeTable'; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefault
false
false
false
false
## Description - Setting this option to `true` tells alphaTab to also justify the last system (row) like it -already does for the systems which are full. - +already does for the systems which are full. | Justification Disabled | Justification Enabled | |--------------------------------------------------------------|-------------------------------------------------------| | ![Disabled](/img/reference/property/justify-last-system-false.png) | ![Enabled](/img/reference/property/justify-last-system-true.png) | - - - -## Types - - - - - - -## Default Value - -`false` \ No newline at end of file diff --git a/docs/reference/settings/display/lastsystempaddingbottom.mdx b/docs/reference/settings/display/lastsystempaddingbottom.mdx new file mode 100644 index 0000000..55835a8 --- /dev/null +++ b/docs/reference/settings/display/lastsystempaddingbottom.mdx @@ -0,0 +1,51 @@ +--- +title: display.lastSystemPaddingBottom +description: The bottom padding applied to last system. +sidebar_custom_props: + category: Display + since: 1.4.0 +--- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; +import { SinceBadge } from '@site/src/components/SinceBadge'; +import { CodeBadge } from '@site/src/components/CodeBadge'; +import { PropertyDescription } from '@site/src/components/PropertyDescription'; +import { TypeTable, TypeRow } from '@site/src/components/TypeTable'; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefault
0
0
0
0
+ +## Description +The bottom padding applied to the last system below the last notation symbols and above +the alphaTab annotation. diff --git a/docs/reference/settings/display/layoutmode.mdx b/docs/reference/settings/display/layoutmode.mdx index c39f72d..52c34b8 100644 --- a/docs/reference/settings/display/layoutmode.mdx +++ b/docs/reference/settings/display/layoutmode.mdx @@ -1,49 +1,81 @@ --- title: display.layoutMode -description: The layouting mode used to arrange the the notation. +description: The mode used to arrange staves and systems. sidebar_custom_props: - jsOnParent: true category: Display since: 0.9.6 --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; import { SinceBadge } from '@site/src/components/SinceBadge'; +import { CodeBadge } from '@site/src/components/CodeBadge'; +import { PropertyDescription } from '@site/src/components/PropertyDescription'; +import { TypeTable, TypeRow } from '@site/src/components/TypeTable'; -import { PropertyDescription } from '@site/src/components/PropertyDescription'; -import {TypeTable, TypeRow} from '@site/src/components/TypeTable'; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefault
LayoutMode.Page
LayoutMode.Page
LayoutMode.Page
LayoutMode.Page
## Description +AlphaTab has various layout engines that arrange the rendered bars differently. +This setting controls which layout mode is used. -AlphaTab has various layout engines that arrange the rendered bars differently. This setting controls which layout mode is used. - - - -## Types +## Related Types - - - `Page` - The bars are aligned in a [page-style fashion](/docs/showcase/layouts#page-layout)
- `Horizontal` - The bars are aligned in a [left-to-right](/docs/showcase/layouts#horizontal-layout) -
- - `page`
- `horizontal` -
- - `0` - Page
- `1` - Horizontal -
- - `Page`
- `Horizontal` -
- - `Page`
- `Horizontal` -
-
+### `enum alphaTab.LayoutMode` -## Default Value + + +`import * as alphaTab from '@coderline/alphaTab';` -`page` \ No newline at end of file +* `alphaTab.LayoutMode.Page` - Bars are aligned in rows using a fixed width. [Demo](/docs/showcase/layouts#page-layout) +* `alphaTab.LayoutMode.Horizontal` - Bars are aligned horizontally in one row. [Demo](/docs/showcase/layouts#horizontal-layout) + + +* `"Page"` - Bars are aligned in rows using a fixed width. [Demo](/docs/showcase/layouts#page-layout) +* `"Horizontal"` - Bars are aligned horizontally in one row. [Demo](/docs/showcase/layouts#horizontal-layout) + + +* `AlphaTab.LayoutMode.Page` - Bars are aligned in rows using a fixed width. [Demo](/docs/showcase/layouts#page-layout) +* `AlphaTab.LayoutMode.Horizontal` - Bars are aligned horizontally in one row. [Demo](/docs/showcase/layouts#horizontal-layout) + + +* `alphaTab.LayoutMode.Page` - Bars are aligned in rows using a fixed width. [Demo](/docs/showcase/layouts#page-layout) +* `alphaTab.LayoutMode.Horizontal` - Bars are aligned horizontally in one row. [Demo](/docs/showcase/layouts#horizontal-layout) + + \ No newline at end of file diff --git a/docs/reference/settings/display/notationstaffpaddingbottom.mdx b/docs/reference/settings/display/notationstaffpaddingbottom.mdx new file mode 100644 index 0000000..d165700 --- /dev/null +++ b/docs/reference/settings/display/notationstaffpaddingbottom.mdx @@ -0,0 +1,51 @@ +--- +title: display.notationStaffPaddingBottom +description: The bottom padding applied to main notation staffs. +sidebar_custom_props: + category: Display + since: 1.4.0 +--- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; +import { SinceBadge } from '@site/src/components/SinceBadge'; +import { CodeBadge } from '@site/src/components/CodeBadge'; +import { PropertyDescription } from '@site/src/components/PropertyDescription'; +import { TypeTable, TypeRow } from '@site/src/components/TypeTable'; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefault
5
5
5
5
+ +## Description +The bottom padding applied to main notation staffs like the standard music notation or guitar tabs. +It doesn't apply to "effect staffs" showing annotations like vibratos. diff --git a/docs/reference/settings/display/notationstaffpaddingtop.mdx b/docs/reference/settings/display/notationstaffpaddingtop.mdx new file mode 100644 index 0000000..7f78d75 --- /dev/null +++ b/docs/reference/settings/display/notationstaffpaddingtop.mdx @@ -0,0 +1,51 @@ +--- +title: display.notationStaffPaddingTop +description: The top padding applied to main notation staffs. +sidebar_custom_props: + category: Display + since: 1.4.0 +--- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; +import { SinceBadge } from '@site/src/components/SinceBadge'; +import { CodeBadge } from '@site/src/components/CodeBadge'; +import { PropertyDescription } from '@site/src/components/PropertyDescription'; +import { TypeTable, TypeRow } from '@site/src/components/TypeTable'; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefault
5
5
5
5
+ +## Description +The top padding applied to main notation staffs like the standard music notation or guitar tabs. +It doesn't apply to "effect staffs" showing annotations like vibratos. diff --git a/docs/reference/settings/display/padding.mdx b/docs/reference/settings/display/padding.mdx index 11beac4..c0e86eb 100644 --- a/docs/reference/settings/display/padding.mdx +++ b/docs/reference/settings/display/padding.mdx @@ -2,36 +2,50 @@ title: display.padding description: Adjusts the padding between the music notation and the border sidebar_custom_props: - jsOnParent: true category: Display since: 0.9.6 --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; import { SinceBadge } from '@site/src/components/SinceBadge'; +import { CodeBadge } from '@site/src/components/CodeBadge'; +import { PropertyDescription } from '@site/src/components/PropertyDescription'; +import { TypeTable, TypeRow } from '@site/src/components/TypeTable'; -import { PropertyDescription } from '@site/src/components/PropertyDescription'; -import {TypeTable, TypeRow} from '@site/src/components/TypeTable'; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefault
[35,35]
[35,35]
[35,35]
[35,35]
## Description - -AlphaTab by default has a padding between the border of the control and the start of the content. -This setting controls this padding between border and content. - - - -## Types - - - - `[left, top, right, bottom]` - - - -## Default Value - -If set to `null`: - -`[20, 20, 20, 20]` - for LayoutMode.Horizontal - -`[40, 40, 40, 40]` - for LayoutMode.Page \ No newline at end of file +AlphaTab by default has a padding between the border of the control and the start of the content. +This setting controls this padding between border and content. diff --git a/docs/reference/settings/display/resources.mdx b/docs/reference/settings/display/resources.mdx index 4592896..56acc6e 100644 --- a/docs/reference/settings/display/resources.mdx +++ b/docs/reference/settings/display/resources.mdx @@ -2,194 +2,534 @@ title: display.resources description: Allows adjusting of the used fonts and colors for rendering. sidebar_custom_props: - domWildcard: true - jsOnParent: true category: Display since: 0.9.6 --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; import { SinceBadge } from '@site/src/components/SinceBadge'; - - - -import useBaseUrl from '@docusaurus/useBaseUrl'; import { CodeBadge } from '@site/src/components/CodeBadge'; +import { PropertyDescription } from '@site/src/components/PropertyDescription'; +import { TypeTable, TypeRow } from '@site/src/components/TypeTable'; -export var Resources = { - colors: [ - { - name: 'barNumberColor', - defaultValue: 'rgb(200, 0, 0)', - description: 'The color to use for displaying the bar numbers above the music sheet.', - }, - { - name: 'barSeparatorColor', - defaultValue: 'rgb(34, 34, 17)', - description: 'The color to use for rendering bar separators, the accolade and repeat signs.', - }, - { - name: 'mainGlyphColor', - defaultValue: 'rgb(0, 0, 0)', - description: 'The color to use for music notation elements of the primary voice.', - }, - { - name: 'scoreInfoColor', - defaultValue: 'rgb(0, 0, 0)', - description: 'The color to use for displaying the song information above the music sheets.', - }, - { - name: 'secondaryGlyphColor', - defaultValue: 'rgb(0,0,0,0.4)', - description: 'The color to use for music notation elements of the secondary voices.', - }, - { - name: 'staffLineColor', - defaultValue: 'rgb(165, 165, 165)', - description: 'The color to use for rendering the lines of staves.', - }, - ], - fonts: [ - { - name: 'barNumberFont', - defaultValue: '11px Arial, sans-serif', - description: 'The font to use for displaying the bar numbers above the music sheet.', - }, - { - name: 'copyrightFont', - defaultValue: 'bold 12px Arial, sans-serif', - description: 'The font to use for displaying the songs copyright information in the header of the music sheet.,', - }, - { - name: 'effectFont', - defaultValue: 'italic 12px Georgia, serif', - description: 'The font to use for displaying certain effect related elements in the music sheet.', - }, - { - name: 'fingeringFont', - defaultValue: '14px Georgia, serif', - description: 'The font to use for displaying finger information in the music sheet.', - }, - { - name: 'fretboardNumberFont', - defaultValue: '11px Arial, sans-serif', - description: 'The font to use for displaying the fretboard numbers in chord diagrams.', - }, - { - name: 'graceFont', - defaultValue: '11px Arial, sans-serif', - description: 'The font to use for grace notation related texts in the music sheet.', - }, - { - name: 'markerFont', - defaultValue: 'bold 14px Georgia, serif', - description: 'The font to use for section marker labels shown above the music sheet.', - }, - { - name: 'subTitleFont', - defaultValue: '20px Georgia, serif', - description: 'The font to use for displaying the songs subtitle in the header of the music sheet.', - }, - { - name: 'tablatureFont', - defaultValue: '13px Arial, sans-serif', - description: 'The font to use for displaying the guitar tablature numbers in the music sheet.', - }, - { - name: 'titleFont', - defaultValue: '32px Georgia, serif', - description: 'The font to use for displaying the songs title in the header of the music sheet.', - }, - { - name: 'wordsFont', - defaultValue: '15px Arial, sans-serif', - description: 'The font to use for displaying the lyrics information in the header of the music sheet.', - } - ] -}; - -export function toPascalCase(v) { - return v.substr(0, 1).toUpperCase() + v.substr(1); -} - -export function ResourceRow({resource, type}) { - return ( - - -
-
-
- - - - - - - {resource.defaultValue} - - {resource.description} - - - ); -} + -export function ResourceTable() { - const colors = Resources.colors.map(c => ); - const fonts = Resources.fonts.map(f => ); - return ( - - - - - - - - - - - {colors} - {fonts} - -
ResourceTypeDefaultSummary
- ); -} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefault
## Description - AlphaTab allows configuring the colors and fonts used for rendering via the rendering resources settings. Please note that as of today -this is the primary way of changing the way how alphaTab styles elements. CSS styling in the browser cannot be guaranteed to work due to its flexibility. - - -Due to space reasons in the following table the common prefix of the settings are removed. Please refer to these examples to eliminate confusion on the usage: +this is the primary way of changing the way how alphaTab styles elements. CSS styling in the browser cannot be guaranteed to work due to its flexibility. +Due to space reasons in the following table the common prefix of the settings are removed. Please refer to these examples to eliminate confusion on the usage: | Platform | Prefix | Example Usage | |------------|---------------------------|--------------------------------------------------------------------| | JavaScript | `display.resources.` | `settings.display.resources.wordsFont = ...` | | JSON | `display.resources.` | `var settings = { display: { resources: { wordsFonts: '...'} } };` | -| JSON | `resources.` | `var settings = { resources: { wordsFonts: '...'} };` | -| HTML | `data-display-resources-` | `
` | -| HTML | `data-resources-` | `
` | | .net | `Display.Resources.` | `settings.Display.Resources.WordsFonts = ...` | | Android | `display.resources.` | `settings.display.resources.wordsFonts = ...` | +## Related Types -## Resources -Following resources exist for adjusting the style. - - - -## Types - -### Fonts +### `class alphaTab.RenderingResources` -For the JavaScript platform any font that might be installed on the client machines can be used. -Any additional fonts can be added via WebFonts. The rendering of the score will be delayed until it is detected that the font was loaded. -Simply use any CSS font property compliant string as configuration. Relative font sizes with percentual values are not supported, remaining values will be considered if supported. - -Since 1.2.3 Multiple fonts are also supported for the Web version. alphaTab will check if any of the fonts in the list is loaded instead of all. If none is available at the time alphaTab is initialized, it will try to initiate the load of the specified fonts individual through the Browser Font APIs. - -For the .net platform any installed font on the system can be used. Simply construct the `Font` object to configure your desired fonts. - -### Colors - -For JavaScript you can use any CSS font property compliant string. (#RGB, #RGBA, #RRGGBB, #RRGGBBAA, rgb(r,g,b), rgba(r,g,b,a) ) - -On .net simply construct the `Color` object to configure your desired color. \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PropertyTypeDefaultSummary
Font'bold 12px Arial, sans-serif'The font to use for displaying the songs copyright information in the header of the music sheet.
Font'32px Georgia, serif'The font to use for displaying the songs title in the header of the music sheet.
Font'20px Georgia, serif'The font to use for displaying the songs subtitle in the header of the music sheet.
Font'15px Georgia, serif'The font to use for displaying the lyrics information in the header of the music sheet.
Font'italic 12px Georgia, serif'The font to use for displaying certain effect related elements in the music sheet.
Font'11px Arial, sans-serif'The font to use for displaying the fretboard numbers in chord diagrams.
Font'13px Arial, sans-serif'The font to use for displaying the guitar tablature numbers in the music sheet.
Font'11px Arial, sans-serif'The font to use for grace notation related texts in the music sheet.
Color'rgba(165, 165, 165, 1)'The color to use for rendering the lines of staves.
Color'rgba(34, 34, 17, 1)'The color to use for rendering bar separators, the accolade and repeat signs.
Font'11px Arial, sans-serif'The font to use for displaying the bar numbers above the music sheet.
Color'rgba(200, 0, 0, 1)'The color to use for displaying the bar numbers above the music sheet.
Font'14px Georgia, serif'The font to use for displaying finger information in the music sheet.
Font'bold 14px Georgia, serif'The font to use for section marker labels shown above the music sheet.
Color'rgba(0, 0, 0, 1)'The color to use for music notation elements of the primary voice.
Color'rgba(0, 0, 0, 0.39)'The color to use for music notation elements of the secondary voices.
Color'rgba(0, 0, 0, 1)'The color to use for displaying the song information above the music sheet.
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SettingTypeDefaultSummary
Font'bold 12px Arial, sans-serif'The font to use for displaying the songs copyright information in the header of the music sheet.
Font'32px Georgia, serif'The font to use for displaying the songs title in the header of the music sheet.
Font'20px Georgia, serif'The font to use for displaying the songs subtitle in the header of the music sheet.
Font'15px Georgia, serif'The font to use for displaying the lyrics information in the header of the music sheet.
Font'italic 12px Georgia, serif'The font to use for displaying certain effect related elements in the music sheet.
Font'11px Arial, sans-serif'The font to use for displaying the fretboard numbers in chord diagrams.
Font'13px Arial, sans-serif'The font to use for displaying the guitar tablature numbers in the music sheet.
Font'11px Arial, sans-serif'The font to use for grace notation related texts in the music sheet.
Color'rgba(165, 165, 165, 1)'The color to use for rendering the lines of staves.
Color'rgba(34, 34, 17, 1)'The color to use for rendering bar separators, the accolade and repeat signs.
Font'11px Arial, sans-serif'The font to use for displaying the bar numbers above the music sheet.
Color'rgba(200, 0, 0, 1)'The color to use for displaying the bar numbers above the music sheet.
Font'14px Georgia, serif'The font to use for displaying finger information in the music sheet.
Font'bold 14px Georgia, serif'The font to use for section marker labels shown above the music sheet.
Color'rgba(0, 0, 0, 1)'The color to use for music notation elements of the primary voice.
Color'rgba(0, 0, 0, 0.39)'The color to use for music notation elements of the secondary voices.
Color'rgba(0, 0, 0, 1)'The color to use for displaying the song information above the music sheet.
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SettingTypeDefaultSummary
Font'bold 12px Arial, sans-serif'The font to use for displaying the songs copyright information in the header of the music sheet.
Font'32px Georgia, serif'The font to use for displaying the songs title in the header of the music sheet.
Font'20px Georgia, serif'The font to use for displaying the songs subtitle in the header of the music sheet.
Font'15px Georgia, serif'The font to use for displaying the lyrics information in the header of the music sheet.
Font'italic 12px Georgia, serif'The font to use for displaying certain effect related elements in the music sheet.
Font'11px Arial, sans-serif'The font to use for displaying the fretboard numbers in chord diagrams.
Font'13px Arial, sans-serif'The font to use for displaying the guitar tablature numbers in the music sheet.
Font'11px Arial, sans-serif'The font to use for grace notation related texts in the music sheet.
Color'rgba(165, 165, 165, 1)'The color to use for rendering the lines of staves.
Color'rgba(34, 34, 17, 1)'The color to use for rendering bar separators, the accolade and repeat signs.
Font'11px Arial, sans-serif'The font to use for displaying the bar numbers above the music sheet.
Color'rgba(200, 0, 0, 1)'The color to use for displaying the bar numbers above the music sheet.
Font'14px Georgia, serif'The font to use for displaying finger information in the music sheet.
Font'bold 14px Georgia, serif'The font to use for section marker labels shown above the music sheet.
Color'rgba(0, 0, 0, 1)'The color to use for music notation elements of the primary voice.
Color'rgba(0, 0, 0, 0.39)'The color to use for music notation elements of the secondary voices.
Color'rgba(0, 0, 0, 1)'The color to use for displaying the song information above the music sheet.
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SettingTypeDefaultSummary
Font'bold 12px Arial, sans-serif'The font to use for displaying the songs copyright information in the header of the music sheet.
Font'32px Georgia, serif'The font to use for displaying the songs title in the header of the music sheet.
Font'20px Georgia, serif'The font to use for displaying the songs subtitle in the header of the music sheet.
Font'15px Georgia, serif'The font to use for displaying the lyrics information in the header of the music sheet.
Font'italic 12px Georgia, serif'The font to use for displaying certain effect related elements in the music sheet.
Font'11px Arial, sans-serif'The font to use for displaying the fretboard numbers in chord diagrams.
Font'13px Arial, sans-serif'The font to use for displaying the guitar tablature numbers in the music sheet.
Font'11px Arial, sans-serif'The font to use for grace notation related texts in the music sheet.
Color'rgba(165, 165, 165, 1)'The color to use for rendering the lines of staves.
Color'rgba(34, 34, 17, 1)'The color to use for rendering bar separators, the accolade and repeat signs.
Font'11px Arial, sans-serif'The font to use for displaying the bar numbers above the music sheet.
Color'rgba(200, 0, 0, 1)'The color to use for displaying the bar numbers above the music sheet.
Font'14px Georgia, serif'The font to use for displaying finger information in the music sheet.
Font'bold 14px Georgia, serif'The font to use for section marker labels shown above the music sheet.
Color'rgba(0, 0, 0, 1)'The color to use for music notation elements of the primary voice.
Color'rgba(0, 0, 0, 0.39)'The color to use for music notation elements of the secondary voices.
Color'rgba(0, 0, 0, 1)'The color to use for displaying the song information above the music sheet.
+
+
\ No newline at end of file diff --git a/docs/reference/settings/display/scale.mdx b/docs/reference/settings/display/scale.mdx index e6c8b85..b806008 100644 --- a/docs/reference/settings/display/scale.mdx +++ b/docs/reference/settings/display/scale.mdx @@ -2,35 +2,50 @@ title: display.scale description: The zoom level of the rendered notation. sidebar_custom_props: - jsOnParent: true category: Display since: 0.9.6 --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; import { SinceBadge } from '@site/src/components/SinceBadge'; +import { CodeBadge } from '@site/src/components/CodeBadge'; +import { PropertyDescription } from '@site/src/components/PropertyDescription'; +import { TypeTable, TypeRow } from '@site/src/components/TypeTable'; -import { PropertyDescription } from '@site/src/components/PropertyDescription'; -import {TypeTable, TypeRow} from '@site/src/components/TypeTable'; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefault
1.0
1.0
1.0
1.0
## Description - -AlphaTab can scale up or down the rendered music notation for more optimized display scenarios. By default music notation is rendered at 100% scale (value 1) and can be scaled up or down by -percental values. - - - -## Types - - - - - `1.0` - 100%
- `1.2` - 120%
- `0.8` - 80% -
-
- -## Default Value - -`1.0` \ No newline at end of file +AlphaTab can scale up or down the rendered music notation for more optimized display scenarios. +By default music notation is rendered at 100% scale (value 1) and can be scaled up or down by percental values. diff --git a/docs/reference/settings/display/startbar.mdx b/docs/reference/settings/display/startbar.mdx index 0beae55..3b1da48 100644 --- a/docs/reference/settings/display/startbar.mdx +++ b/docs/reference/settings/display/startbar.mdx @@ -2,33 +2,51 @@ title: display.startBar description: The bar start index to start layouting with. sidebar_custom_props: - jsOnParent: true category: Display since: 0.9.6 --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; import { SinceBadge } from '@site/src/components/SinceBadge'; +import { CodeBadge } from '@site/src/components/CodeBadge'; +import { PropertyDescription } from '@site/src/components/PropertyDescription'; +import { TypeTable, TypeRow } from '@site/src/components/TypeTable'; -import { PropertyDescription } from '@site/src/components/PropertyDescription'; -import {TypeTable, TypeRow} from '@site/src/components/TypeTable'; - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefault
1
1
1
1
## Description - -This setting sets the index of the first bar that should be rendered from the overall song. This setting can be used to +This setting sets the index of the first bar that should be rendered from the overall song. This setting can be used to achieve a paging system or to only show partial bars of the same file. By this a tutorial alike display can be achieved that explains various parts of the song. Please note that this is the bar number as shown in the music sheet (1-based) not the array index (0-based). -[Demo](/docs/showcase/layouts#page-layout-bar-5-to-8) - - - -## Types - - - - - -## Default Value - -`1` \ No newline at end of file diff --git a/docs/reference/settings/display/staveprofile.mdx b/docs/reference/settings/display/staveprofile.mdx index e3c9676..bdae8e0 100644 --- a/docs/reference/settings/display/staveprofile.mdx +++ b/docs/reference/settings/display/staveprofile.mdx @@ -1,64 +1,96 @@ --- title: display.staveProfile -description: The stave profile defining which staves are shown for the music sheet. +description: The stave profile defining which staves are shown for the music sheet. sidebar_custom_props: - jsOnParent: true category: Display since: 0.9.6 --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; import { SinceBadge } from '@site/src/components/SinceBadge'; +import { CodeBadge } from '@site/src/components/CodeBadge'; +import { PropertyDescription } from '@site/src/components/PropertyDescription'; +import { TypeTable, TypeRow } from '@site/src/components/TypeTable'; -import { PropertyDescription } from '@site/src/components/PropertyDescription'; -import {TypeTable, TypeRow} from '@site/src/components/TypeTable'; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefault
StaveProfile.Default
StaveProfile.Default
StaveProfile.Default
StaveProfile.Default
## Description - AlphaTab has various stave profiles that define which staves will be shown in for the rendered tracks. - - -## Types +## Related Types - - - `Default` - The profile is auto detected by the track configurations.
- `ScoreTab` - Standard music notation and guitar tablature are rendered.
- `Score` - Only standard music notation is rendered.
- `Tab` - Only guitar tablature is rendered.
- `TabMixed` - Only guitar tablature is rendered, but also rests and time signatures are not shown. This profile is typically used in multi-track scenarios.
-
- - `default`
- `scoretab`
- `score`
- `tab`
- `tabmixed` -
- - `0` - Default
- `1` - ScoreTab
- `2` - Score
- `3` - Tab
- `4` - TabMixed -
- - `Default`
- `ScoreTab`
- `Score`
- `Tab`
- `TabMixed`
-
- - `Default`
- `ScoreTab`
- `Score`
- `Tab`
- `TabMixed`
-
-
+### `enum alphaTab.StaveProfile` -## Default Value + + +`import * as alphaTab from '@coderline/alphaTab';` -`Default` +* `alphaTab.StaveProfile.Default` - The profile is auto detected by the track configurations. +* `alphaTab.StaveProfile.ScoreTab` - Standard music notation and guitar tablature are rendered. +* `alphaTab.StaveProfile.Score` - Only standard music notation is rendered. +* `alphaTab.StaveProfile.Tab` - Only guitar tablature is rendered. +* `alphaTab.StaveProfile.TabMixed` - Only guitar tablature is rendered, but also rests and time signatures are not shown. +This profile is typically used in multi-track scenarios. + + +* `"Default"` - The profile is auto detected by the track configurations. +* `"ScoreTab"` - Standard music notation and guitar tablature are rendered. +* `"Score"` - Only standard music notation is rendered. +* `"Tab"` - Only guitar tablature is rendered. +* `"TabMixed"` - Only guitar tablature is rendered, but also rests and time signatures are not shown. +This profile is typically used in multi-track scenarios. + + +* `AlphaTab.StaveProfile.Default` - The profile is auto detected by the track configurations. +* `AlphaTab.StaveProfile.ScoreTab` - Standard music notation and guitar tablature are rendered. +* `AlphaTab.StaveProfile.Score` - Only standard music notation is rendered. +* `AlphaTab.StaveProfile.Tab` - Only guitar tablature is rendered. +* `AlphaTab.StaveProfile.TabMixed` - Only guitar tablature is rendered, but also rests and time signatures are not shown. +This profile is typically used in multi-track scenarios. + + +* `alphaTab.StaveProfile.Default` - The profile is auto detected by the track configurations. +* `alphaTab.StaveProfile.ScoreTab` - Standard music notation and guitar tablature are rendered. +* `alphaTab.StaveProfile.Score` - Only standard music notation is rendered. +* `alphaTab.StaveProfile.Tab` - Only guitar tablature is rendered. +* `alphaTab.StaveProfile.TabMixed` - Only guitar tablature is rendered, but also rests and time signatures are not shown. +This profile is typically used in multi-track scenarios. + + \ No newline at end of file diff --git a/docs/reference/settings/display/stretchforce.mdx b/docs/reference/settings/display/stretchforce.mdx index 3fee8e5..984d3e5 100644 --- a/docs/reference/settings/display/stretchforce.mdx +++ b/docs/reference/settings/display/stretchforce.mdx @@ -1,39 +1,55 @@ --- title: display.stretchForce -description: The default stretch force to use for layouting. +description: The default stretch force to use for layouting. sidebar_custom_props: - jsOnParent: true category: Display since: 0.9.6 --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; import { SinceBadge } from '@site/src/components/SinceBadge'; +import { CodeBadge } from '@site/src/components/CodeBadge'; +import { PropertyDescription } from '@site/src/components/PropertyDescription'; +import { TypeTable, TypeRow } from '@site/src/components/TypeTable'; -import { PropertyDescription } from '@site/src/components/PropertyDescription'; -import {TypeTable, TypeRow} from '@site/src/components/TypeTable'; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefault
1.0
1.0
1.0
1.0
## Description - -The stretch force is a setting that controls the spacing of the music notation. AlphaTab uses a varaint of the Gourlay algorithm for spacing which has springs and rods for -aligning elements. This setting controls the "strength" of the springs. The stronger the springs, the wider the spacing. +The stretch force is a setting that controls the spacing of the music notation. AlphaTab uses a varaint of the Gourlay algorithm for spacing which has springs and rods for +aligning elements. This setting controls the "strength" of the springs. The stronger the springs, the wider the spacing. | Force 1 | Force 0.5 | |--------------------------------------------------------------|-------------------------------------------------------| | ![Default](/img/reference/property/stretchforce-default.png) | ![0.5](/img/reference/property/stretchforce-half.png) | - - - -## Types - - - - `1.0`
- `1.5`
- `0.5`
-
-
- -## Default Value - -`1.0` \ No newline at end of file diff --git a/docs/reference/settings/display/systemlabelpaddingleft.mdx b/docs/reference/settings/display/systemlabelpaddingleft.mdx new file mode 100644 index 0000000..2e35f93 --- /dev/null +++ b/docs/reference/settings/display/systemlabelpaddingleft.mdx @@ -0,0 +1,50 @@ +--- +title: display.systemLabelPaddingLeft +description: The padding left to the track name label of the system. +sidebar_custom_props: + category: Display + since: 1.4.0 +--- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; +import { SinceBadge } from '@site/src/components/SinceBadge'; +import { CodeBadge } from '@site/src/components/CodeBadge'; +import { PropertyDescription } from '@site/src/components/PropertyDescription'; +import { TypeTable, TypeRow } from '@site/src/components/TypeTable'; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefault
0
0
0
0
+ +## Description +The padding left to the track name label or in general at the start of the system (if no label is shown). diff --git a/docs/reference/settings/display/systemlabelpaddingright.mdx b/docs/reference/settings/display/systemlabelpaddingright.mdx new file mode 100644 index 0000000..ec9fcd0 --- /dev/null +++ b/docs/reference/settings/display/systemlabelpaddingright.mdx @@ -0,0 +1,50 @@ +--- +title: display.systemLabelPaddingRight +description: The padding right to the track name label of the system. +sidebar_custom_props: + category: Display + since: 1.4.0 +--- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; +import { SinceBadge } from '@site/src/components/SinceBadge'; +import { CodeBadge } from '@site/src/components/CodeBadge'; +import { PropertyDescription } from '@site/src/components/PropertyDescription'; +import { TypeTable, TypeRow } from '@site/src/components/TypeTable'; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefault
5
5
5
5
+ +## Description +The padding right to the track name label of the system and right to the bracket of the first system diff --git a/docs/reference/settings/display/systempaddingbottom.mdx b/docs/reference/settings/display/systempaddingbottom.mdx new file mode 100644 index 0000000..656fb11 --- /dev/null +++ b/docs/reference/settings/display/systempaddingbottom.mdx @@ -0,0 +1,50 @@ +--- +title: display.systemPaddingBottom +description: The bottom padding applied to all individual systems beside the last one. +sidebar_custom_props: + category: Display + since: 1.4.0 +--- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; +import { SinceBadge } from '@site/src/components/SinceBadge'; +import { CodeBadge } from '@site/src/components/CodeBadge'; +import { PropertyDescription } from '@site/src/components/PropertyDescription'; +import { TypeTable, TypeRow } from '@site/src/components/TypeTable'; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefault
20
20
20
20
+ +## Description +The bottom padding applied to all individual systems beside the last one. diff --git a/docs/reference/settings/display/systempaddingtop.mdx b/docs/reference/settings/display/systempaddingtop.mdx new file mode 100644 index 0000000..c671a5e --- /dev/null +++ b/docs/reference/settings/display/systempaddingtop.mdx @@ -0,0 +1,50 @@ +--- +title: display.systemPaddingTop +description: The top padding applied to systems. +sidebar_custom_props: + category: Display + since: 1.4.0 +--- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; +import { SinceBadge } from '@site/src/components/SinceBadge'; +import { CodeBadge } from '@site/src/components/CodeBadge'; +import { PropertyDescription } from '@site/src/components/PropertyDescription'; +import { TypeTable, TypeRow } from '@site/src/components/TypeTable'; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefault
10
10
10
10
+ +## Description +The top padding applied to all individual systems beside the first one. diff --git a/docs/reference/settings/display/systemslayoutmode.mdx b/docs/reference/settings/display/systemslayoutmode.mdx index 357391c..c0bc43d 100644 --- a/docs/reference/settings/display/systemslayoutmode.mdx +++ b/docs/reference/settings/display/systemslayoutmode.mdx @@ -2,106 +2,133 @@ title: display.systemsLayoutMode description: The mode used to arrange staves and systems. sidebar_custom_props: - jsOnParent: true category: Display - since: 1.3.0-alpha.671 + since: 1.4.0 --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; import { SinceBadge } from '@site/src/components/SinceBadge'; - - - +import { CodeBadge } from '@site/src/components/CodeBadge'; import { PropertyDescription } from '@site/src/components/PropertyDescription'; -import {TypeTable, TypeRow} from '@site/src/components/TypeTable'; +import { TypeTable, TypeRow } from '@site/src/components/TypeTable'; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefault
SystemsLayoutMode.Automatic
SystemsLayoutMode.Automatic
SystemsLayoutMode.Automatic
SystemsLayoutMode.Automatic
## Description - -By default alphaTab uses an own (automatic) mode to arrange and scale the bars when +By default alphaTab uses an own (automatic) mode to arrange and scale the bars when putting them into staves. This property allows changing this mode to change the music sheet arrangement. - - -## Types - - - - `Automatic`
- `UseModelLayout` -
- - `automatic`
- `usemodellayout` -
- - `0` - Automatic
- `1` - UseModelLayout -
- - `Automatic`
- `UseModelLayout` -
- - `Automatic`
- `UseModelLayout` -
-
- -## Default Value - -`automatic` - ## Supported File Formats: +* Guitar Pro 6-8 Since 1.3.0 -* Guitar Pro 6-8 1.3.0-alpha.671 - -If you want/need support for more file formats to respect the sizing information feel free to [open a discussion](https://github.com/CoderLine/alphaTab/discussions/new?category=ideas) on GitHub. +If you want/need support for more file formats to respect the sizing information feel free to [open a discussion](https://github.com/CoderLine/alphaTab/discussions/new?category=ideas) on GitHub. ## Automatic Mode In the automatic mode alphaTab arranges the bars and staves using its internal mechanisms. -For the `page` layout this means it will scale the bars according to the `stretchForce` and available width. +For the `page` layout this means it will scale the bars according to the `stretchForce` and available width. Wrapping into new systems (rows) will happen when the row is considered "full". -For the `horizontal` layout the `stretchForce` defines the sizing and no wrapping happens at all. +For the `horizontal` layout the `stretchForce` defines the sizing and no wrapping happens at all. ## Model Layout mode -File formats like Guitar Pro embed information about the layout in the file and alphaTab can read and use this information. +File formats like Guitar Pro embed information about the layout in the file and alphaTab can read and use this information. When this mode is enabled, alphaTab will also actively use this information and try to respect it. alphaTab holds following information in the data model and developers can change those values (e.g. by tapping into the `scoreLoaded`) event. **Used when single tracks are rendered:** - * `score.tracks[index].systemsLayout` - An array of numbers describing how many bars should be placed within each system (row). * `score.tracks[index].defaultSystemsLayout` - The number of bars to place in a system (row) when no value is defined in the `systemsLayout`. -* `score.tracks[index].staves[index].bars[index].displayScale` - The relative size of this bar in the system it is placed. Note that this is not directly a percentage value. e.g. if there are 3 bars and all define scale 1, they are sized evenly. -* `score.tracks[index].staves[index].bars[index].displayWidth` - The absolute size of this bar when displayed. +* `score.tracks[index].staves[index].bars[index].displayScale` - The relative size of this bar in the system it is placed. Note that this is not directly a percentage value. e.g. if there are 3 bars and all define scale 1, they are sized evenly. +* `score.tracks[index].staves[index].bars[index].displayWidth` - The absolute size of this bar when displayed. **Used when multiple tracks are rendered:** -* `score.systemsLayout` - Like the `systemsLayout` on track level. -* `score.defaultSystemsLayout` - Like the `defaultSystemsLayout` on track level. +* `score.systemsLayout` - Like the `systemsLayout` on track level. +* `score.defaultSystemsLayout` - Like the `defaultSystemsLayout` on track level. * `score.masterBars[index].displayScale` - Like the `displayScale` on bar level. * `score.masterBars[index].displayWidth` - Like the `displayWidth` on bar level. ### Page Layout -The page layout uses the `systemsLayout` and `defaultSystemsLayout` to decide how many bars go into a single system (row). +The page layout uses the `systemsLayout` and `defaultSystemsLayout` to decide how many bars go into a single system (row). Additionally when sizing the bars within the system the `displayScale` is used. As indicated above, the scale is rather a ratio than a percentage value but percentages work also: - - +![system layout page example](/img/reference/property/systems-layout-page-examples.png) The page layout does not use `displayWidth`. The use of absolute widths would break the proper alignments needed for this kind of display. -Also note that the sizing is including any glyphs and notation elements within the bar. e.g. if there are clefs in the bar, they are still "squeezed" into the available size. +Also note that the sizing is including any glyphs and notation elements within the bar. e.g. if there are clefs in the bar, they are still "squeezed" into the available size. It is not the case that the actual notes with their lengths are sized accordingly. This fits the sizing system of Guitar Pro and when files are customized there, -alphaTab will match this layout quite close. +alphaTab will match this layout quite close. ### Horizontal Layout -The horizontal layout uses the `displayWidth` to scale the bars to size the bars exactly as specified. This kind of sizing and layout can be useful for usecases like: +The horizontal layout uses the `displayWidth` to scale the bars to size the bars exactly as specified. This kind of sizing and layout can be useful for usecases like: * Comparing files against each other (top/bottom comparison) * Aligning the playback of multiple files on one screen assuming the same tempo (e.g. one file per track). +## Related Types + +### `enum alphaTab.SystemsLayoutMode` + + + +`import * as alphaTab from '@coderline/alphaTab';` + +* `alphaTab.SystemsLayoutMode.Automatic` - Use the automatic alignment system provided by alphaTab (default) +* `alphaTab.SystemsLayoutMode.UseModelLayout` - Use the systems layout and sizing information stored from the score model. + + +* `"Automatic"` - Use the automatic alignment system provided by alphaTab (default) +* `"UseModelLayout"` - Use the systems layout and sizing information stored from the score model. + + +* `AlphaTab.SystemsLayoutMode.Automatic` - Use the automatic alignment system provided by alphaTab (default) +* `AlphaTab.SystemsLayoutMode.UseModelLayout` - Use the systems layout and sizing information stored from the score model. + + +* `alphaTab.SystemsLayoutMode.Automatic` - Use the automatic alignment system provided by alphaTab (default) +* `alphaTab.SystemsLayoutMode.UseModelLayout` - Use the systems layout and sizing information stored from the score model. + + \ No newline at end of file diff --git a/docs/reference/settings/importer/beattextaslyrics.mdx b/docs/reference/settings/importer/beattextaslyrics.mdx index f2634aa..91c7846 100644 --- a/docs/reference/settings/importer/beattextaslyrics.mdx +++ b/docs/reference/settings/importer/beattextaslyrics.mdx @@ -5,48 +5,48 @@ sidebar_custom_props: category: Importer since: 1.2.0 --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; import { SinceBadge } from '@site/src/components/SinceBadge'; +import { CodeBadge } from '@site/src/components/CodeBadge'; +import { PropertyDescription } from '@site/src/components/PropertyDescription'; +import { TypeTable, TypeRow } from '@site/src/components/TypeTable'; -import { PropertyDescription } from '@site/src/components/PropertyDescription'; -import {TypeTable, TypeRow} from '@site/src/components/TypeTable'; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefault
false
false
false
false
## Description - -On various old Guitar Pro 3-5 files tab authors often used the "beat text" feature to add lyrics to the individual tracks. -This was easier and quicker than using the lyrics feature. - -These texts were optimized to align correctly when viewed in Guitar Pro with the default layout but can lead to -disturbed display in alphaTab. When `beatTextAsLyrics` is set to true, alphaTab will try to rather parse beat text -values as lyrics using typical text patterns like dashes, underscores and spaces. - -The lyrics are only detected if not already proper lyrics are applied to the track. - -Enable this option for input files which suffer from this practice. - -:::note - -alphaTab tries to relate the texts and chunks to the beats but this is not perfect. -Errors are likely to happen with such kind of files. - -::: - - - -## Types - - - - - -## Default Value -`false` - -## Example - -**Enabled** -![Enabled](/img/reference/property/beattextaslyrics-enabled.png) - -**Disabled** - ![Disabled](/img/reference/property/beattextaslyrics-disabled.png) \ No newline at end of file +If set to true, text annotations on beats are attempted to be parsed as +lyrics considering spaces as separators and removing underscores. +If a track/staff has explicit lyrics the beat texts will not be detected as lyrics. diff --git a/docs/reference/settings/importer/encoding.mdx b/docs/reference/settings/importer/encoding.mdx index 714c4e0..6c95fff 100644 --- a/docs/reference/settings/importer/encoding.mdx +++ b/docs/reference/settings/importer/encoding.mdx @@ -5,35 +5,46 @@ sidebar_custom_props: category: Importer since: 0.9.6 --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; import { SinceBadge } from '@site/src/components/SinceBadge'; +import { CodeBadge } from '@site/src/components/CodeBadge'; +import { PropertyDescription } from '@site/src/components/PropertyDescription'; +import { TypeTable, TypeRow } from '@site/src/components/TypeTable'; -import { PropertyDescription } from '@site/src/components/PropertyDescription'; -import {TypeTable, TypeRow} from '@site/src/components/TypeTable'; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefault
'utf-8'
"utf-8"
"utf-8"
"utf-8"
## Description - -By default strings are interpreted as UTF-8 from the input files. This is sometimes not the case and leads to strong display -of strings in the rendered notation. Via this setting the text encoding for decoding the strings can be changed. The supported -encodings depend on the browser or operating system. This setting is considered for the importers - -* Guitar Pro 7 -* Guitar Pro 6 -* Guitar Pro 3-5 -* MusicXML - - - -## Types - - - - `utf-8`
- `Windows-1252` -
-
- -## Default Value - -`utf-8` \ No newline at end of file +The text encoding to use when decoding strings. By default UTF-8 is used. diff --git a/docs/reference/settings/importer/mergepartgroupsinmusicxml.mdx b/docs/reference/settings/importer/mergepartgroupsinmusicxml.mdx index f858bfb..1db4532 100644 --- a/docs/reference/settings/importer/mergepartgroupsinmusicxml.mdx +++ b/docs/reference/settings/importer/mergepartgroupsinmusicxml.mdx @@ -5,24 +5,46 @@ sidebar_custom_props: category: Importer since: 0.9.6 --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; import { SinceBadge } from '@site/src/components/SinceBadge'; +import { CodeBadge } from '@site/src/components/CodeBadge'; +import { PropertyDescription } from '@site/src/components/PropertyDescription'; +import { TypeTable, TypeRow } from '@site/src/components/TypeTable'; -import { PropertyDescription } from '@site/src/components/PropertyDescription'; -import {TypeTable, TypeRow} from '@site/src/components/TypeTable'; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefault
false
false
false
false
## Description - -This setting controls whether multiple `part-group` tags will result into a single track with multiple staves. - - - -## Types - - - - - -## Default Value -`false` \ No newline at end of file +If part-groups should be merged into a single track. diff --git a/docs/reference/settings/notation/displaytranspositionpitches.mdx b/docs/reference/settings/notation/displaytranspositionpitches.mdx index ca3c95c..187128a 100644 --- a/docs/reference/settings/notation/displaytranspositionpitches.mdx +++ b/docs/reference/settings/notation/displaytranspositionpitches.mdx @@ -5,32 +5,53 @@ sidebar_custom_props: category: Notation since: 0.9.6 --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; import { SinceBadge } from '@site/src/components/SinceBadge'; +import { CodeBadge } from '@site/src/components/CodeBadge'; +import { PropertyDescription } from '@site/src/components/PropertyDescription'; +import { TypeTable, TypeRow } from '@site/src/components/TypeTable'; -import { PropertyDescription } from '@site/src/components/PropertyDescription'; -import {TypeTable, TypeRow} from '@site/src/components/TypeTable'; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefault
[]
[]
[]
[]
## Description - -For some instruments the pitch shown on the standard notation has an additional transposition. One example is the Guitar. +For some instruments the pitch shown on the standard notation has an additional transposition. One example is the Guitar. Notes are shown 1 octave higher than they are on the piano. The following image shows a C4 for a piano and a guitar, and a C5 for the piano as comparison: ![Display Transposition Pitches example](/img/reference/property/displaytranspositionpitches.png) -The `DisplayTranspositionPitch` setting allows defining an additional pitch offset per track, that is then considered when displaying the music sheet. +The `displayTranspositionPitch` setting allows defining an additional pitch offset per track, that is then considered when displaying the music sheet. This setting does not affect the playback of the instrument in any way. Despite the 2 different standard notations in the above example, they both play the same note height. The transposition is defined as number of semitones and one value per track of the song can be defined. - - - -## Types - - - - - -## Default Value - -`(empty)` \ No newline at end of file diff --git a/docs/reference/settings/notation/elements.mdx b/docs/reference/settings/notation/elements.mdx index adc2223..1c4fb73 100644 --- a/docs/reference/settings/notation/elements.mdx +++ b/docs/reference/settings/notation/elements.mdx @@ -1,276 +1,76 @@ --- title: notation.elements -description: Render the song information or not. +description: Controls the display of various elements on the music sheet. sidebar_custom_props: category: Notation since: 0.9.8 --- - import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import { SinceBadge } from '@site/src/components/SinceBadge'; +import { CodeBadge } from '@site/src/components/CodeBadge'; +import { PropertyDescription } from '@site/src/components/PropertyDescription'; +import { TypeTable, TypeRow } from '@site/src/components/TypeTable'; -import { PropertyDescription } from "@site/src/components/PropertyDescription"; -import { TypeTable, TypeRow } from "@site/src/components/TypeTable"; - -## Description - -AlphaTab has quite a set of notation elements that are usually shown by default or only shown when using -the `SongBook` notation mode. This setting allows showing/hiding individual notation elements like the -song information or the track names. - -For each element you can configure whether it is visible or not. The setting is a Map/Dictionary where -the key is the element to configure and the value is a boolean value whether it should be visible or not. - - - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - - + + + - - - + + + - - - - - - - - + + +
ElementDescriptionDefault VisibilityNameTypeDefault
ScoreTitleThe score title shown at the start of the music sheet.visible
ScoreSubTitleThe score subtitle shown at the start of the music sheet.visible
ScoreArtistThe score artist shown at the start of the music sheet.visible
ScoreAlbumThe score album shown at the start of the music sheet.visible
ScoreWordsThe score words author shown at the start of the music sheet.visible
ScoreMusicThe score music author shown at the start of the music sheet.visible
ScoreWordsAndMusicThe score words&music author shown at the start of the music sheet.visible
ScoreCopyrightThe score copyright owner shown at the start of the music sheet.visible
GuitarTuningThe tuning information of the guitar shown above the staves.visible
TrackNamesThe track names which are shown in the accolade.visible
ChordDiagramsThe chord diagrams for guitars. Usually shown below the score info.visible
ParenthesisOnTiedBends - Parenthesis that are shown for tied bends if they are preceeded by bends. - visible
TabNotesOnTiedBends - The tab number for tied notes if the bend of a note is increased at that - point. - visible
ZerosOnDiveWhammysZero tab numbers on "dive whammys".not visible
EffectAlternateEndingsThe alternate endings information on repeats shown above the staff.visible
EffectCapo - The information about the fret on which the capo is placed shown above the - staff. - visible
EffectChordNamesThe chord names shown above beats shown above the staff.visible
EffectCrescendoThe crescendo/decrescendo angle shown above the staff.visible
EffectDynamicsThe beat dynamics shown above the staff.visible
EffectFadeInThe curved angle for fade in/out effects shown above the staff.visible
EffectFermataThe fermata symbol shown above the staff.visible
EffectFingeringThe fingering information.visible
EffectHarmonics - The harmonics names shown above the staff. (does not represent the harmonic - note heads) - visible
EffectLetRingThe let ring name and line above the staff.visible
EffectLyricsThe lyrics of the track shown above the staff.visible
EffectMarkerThe section markers shown above the staff.visible
EffectOttaviaThe ottava symbol and lines shown above the staff.visible
EffectPalmMuteThe palm mute name and line shown above the staff.visible
EffectPickSlide - The pick slide information shown above the staff. (does not control the pick - slide lines) - visible
EffectPickStrokeThe pick stroke symbols shown above the staff.visible
EffectSlightBeatVibratoThe slight beat vibrato waves shown above the staff.visible
EffectSlightNoteVibratoThe slight note vibrato waves shown above the staff.visible
EffectTapThe tap/slap/pop effect names shown above the staff.visible
EffectTempoThe tempo information shown above the staff.visible
EffectTextThe additional beat text shown above the staff.visible
EffectTrillThe trill name and waves shown above the staff.visible
EffectTripletFeelThe triplet feel symbol shown above the staff.visible
EffectWhammyBar - The whammy bar information shown above the staff. (does not control the - whammy lines shown within the staff) - visible
EffectWideBeatVibratoThe wide beat vibrato waves shown above the staff.visible
EffectWideNoteVibratoThe wide note vibrato waves shown above the staff.visible
+## Description +AlphaTab has quite a set of notation elements that are usually shown by default or only shown when using +the `SongBook` notation mode. This setting allows showing/hiding individual notation elements like the +song information or the track names. + +For each element you can configure whether it is visible or not. The setting is a Map/Dictionary where +the key is the element to configure and the value is a boolean value whether it should be visible or not. ## Examples - - - -Internally the setting is a [Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) where the key must be a `alphaTab.NotationElement` enumeration value. -For JSON input the usual enumeration serialization applies where also the names can be used. The names -are case insensitive. + + + +Internally the setting is a [Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) where the key must be a `alphaTab.NotationElement` enumeration value. +For JSON input the usual enumeration serialization applies where also the names can be used. The names +are case insensitive. ```js const api = new alphaTab.AlphaTabApi(document.querySelector('#alphaTab'), { @@ -285,16 +85,7 @@ api.settings.notation.elements.set(alphaTab.NotationElement.EffectWhammyBar, fal ``` - - -For data attributes currently a full object must be embedded in the attribute value. - -```js -
-``` - -
- + ```cs var settings = new AlphaTab.Settings(); diff --git a/docs/reference/settings/notation/extendbendarrowsontiednotes.mdx b/docs/reference/settings/notation/extendbendarrowsontiednotes.mdx index f75adeb..a53dc07 100644 --- a/docs/reference/settings/notation/extendbendarrowsontiednotes.mdx +++ b/docs/reference/settings/notation/extendbendarrowsontiednotes.mdx @@ -5,30 +5,51 @@ sidebar_custom_props: category: Notation since: 0.9.6 --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; import { SinceBadge } from '@site/src/components/SinceBadge'; +import { CodeBadge } from '@site/src/components/CodeBadge'; +import { PropertyDescription } from '@site/src/components/PropertyDescription'; +import { TypeTable, TypeRow } from '@site/src/components/TypeTable'; -import { PropertyDescription } from '@site/src/components/PropertyDescription'; -import {TypeTable, TypeRow} from '@site/src/components/TypeTable'; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefault
true
true
true
true
## Description - -By default the arrows and lines on bend effects are extended to the space of tied notes. This behavior is the Guitar Pro default but some applications and songbooks practice it different. +By default the arrows and lines on bend effects are extended to the space of tied notes. This behavior is the Guitar Pro default but some applications and songbooks practice it different. There the bend only is drawn to the next beat. - - | Enabled | Disabled | |-----------------------------------------------------------------------------|-------------------------------------------------------------------------------| | ![Enabled](/img/reference/property/extendbendarrowsontiednotes-enabled.png) | ![Disabled](/img/reference/property/extendbendarrowsontiednotes-disabled.png) | - -## Types - - - - - -## Default Value - -`true` \ No newline at end of file diff --git a/docs/reference/settings/notation/extendlineeffectstobeatend.mdx b/docs/reference/settings/notation/extendlineeffectstobeatend.mdx index 4239197..88f4721 100644 --- a/docs/reference/settings/notation/extendlineeffectstobeatend.mdx +++ b/docs/reference/settings/notation/extendlineeffectstobeatend.mdx @@ -5,29 +5,51 @@ sidebar_custom_props: category: Notation since: 0.9.6 --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; import { SinceBadge } from '@site/src/components/SinceBadge'; +import { CodeBadge } from '@site/src/components/CodeBadge'; +import { PropertyDescription } from '@site/src/components/PropertyDescription'; +import { TypeTable, TypeRow } from '@site/src/components/TypeTable'; -import { PropertyDescription } from '@site/src/components/PropertyDescription'; -import {TypeTable, TypeRow} from '@site/src/components/TypeTable'; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefault
false
false
false
false
## Description - -By default effect annotations that render a line above the staff, stop on the beat. This is the typical display of Guitar Pro. In songbooks and some other tools -these effects are drawn to the end of this beat. - - +By default effect annotations that render a line above the staff, stop on the beat. This is the typical display of Guitar Pro. In songbooks and some other tools +these effects are drawn to the end of this beat. | Enabled | Disabled | |-----------------------------------------------------------------------------|-------------------------------------------------------------------------------| | ![Enabled](/img/reference/property/extendlineeffectstobeatend-enabled.png) | ![Disabled](/img/reference/property/extendlineeffectstobeatend-disabled.png) | - -## Types - - - - - -## Default Value -`false` \ No newline at end of file diff --git a/docs/reference/settings/notation/fingeringmode.mdx b/docs/reference/settings/notation/fingeringmode.mdx index 7a6cb72..e0eff1a 100644 --- a/docs/reference/settings/notation/fingeringmode.mdx +++ b/docs/reference/settings/notation/fingeringmode.mdx @@ -5,49 +5,105 @@ sidebar_custom_props: category: Notation since: 0.9.6 --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; import { SinceBadge } from '@site/src/components/SinceBadge'; +import { CodeBadge } from '@site/src/components/CodeBadge'; +import { PropertyDescription } from '@site/src/components/PropertyDescription'; +import { TypeTable, TypeRow } from '@site/src/components/TypeTable'; -import { PropertyDescription } from '@site/src/components/PropertyDescription'; -import {TypeTable, TypeRow} from '@site/src/components/TypeTable'; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefault
FingeringMode.ScoreDefault
FingeringMode.ScoreDefault
FingeringMode.ScoreDefault
FingeringMode.ScoreDefault
## Description - -AlphaTab supports multiple modes on how to display fingering information in the music sheet. This setting controls how they should be displayed. The default behavior is to show the finger information +AlphaTab supports multiple modes on how to display fingering information in the music sheet. This setting controls how they should be displayed. The default behavior is to show the finger information directly in the score along the notes. For some use cases of training courses and for beginners this notation might be hard to read. The effect band mode allows to show a single finger information above the staff. - - | Score | Effect Band | |-------------------------------------------------------------|-------------------------------------------------------------------| | ![Enabled](/img/reference/property/fingeringmode-score.png) | ![Disabled](/img/reference/property/fingeringmode-effectband.png) | -## Types - - - - `Score`
- `SingleNoteEffectBand` -
- - `score`
- `effectband` -
- - `0` - Score
- `1` - SingleNoteEffectBand -
- - `Score`
- `SingleNoteEffectBand` -
- - `Score`
- `SingleNoteEffectBand` -
-
- -## Default Value - -`Score` \ No newline at end of file +## Related Types + +### `enum alphaTab.FingeringMode` + + + +`import * as alphaTab from '@coderline/alphaTab';` + +* `alphaTab.FingeringMode.ScoreDefault` - Fingerings will be shown in the standard notation staff. +* `alphaTab.FingeringMode.ScoreForcePiano` - Fingerings will be shown in the standard notation staff. Piano finger style is enforced, where +fingers are rendered as 1-5 instead of p,i,m,a,c and T,1,2,3,4. +* `alphaTab.FingeringMode.SingleNoteEffectBand` - Fingerings will be shown in a effect band above the tabs in case +they have only a single note on the beat. +* `alphaTab.FingeringMode.SingleNoteEffectBandForcePiano` - Fingerings will be shown in a effect band above the tabs in case +they have only a single note on the beat. Piano finger style is enforced, where +fingers are rendered as 1-5 instead of p,i,m,a,c and T,1,2,3,4. + + +* `"ScoreDefault"` - Fingerings will be shown in the standard notation staff. +* `"ScoreForcePiano"` - Fingerings will be shown in the standard notation staff. Piano finger style is enforced, where +fingers are rendered as 1-5 instead of p,i,m,a,c and T,1,2,3,4. +* `"SingleNoteEffectBand"` - Fingerings will be shown in a effect band above the tabs in case +they have only a single note on the beat. +* `"SingleNoteEffectBandForcePiano"` - Fingerings will be shown in a effect band above the tabs in case +they have only a single note on the beat. Piano finger style is enforced, where +fingers are rendered as 1-5 instead of p,i,m,a,c and T,1,2,3,4. + + +* `AlphaTab.FingeringMode.ScoreDefault` - Fingerings will be shown in the standard notation staff. +* `AlphaTab.FingeringMode.ScoreForcePiano` - Fingerings will be shown in the standard notation staff. Piano finger style is enforced, where +fingers are rendered as 1-5 instead of p,i,m,a,c and T,1,2,3,4. +* `AlphaTab.FingeringMode.SingleNoteEffectBand` - Fingerings will be shown in a effect band above the tabs in case +they have only a single note on the beat. +* `AlphaTab.FingeringMode.SingleNoteEffectBandForcePiano` - Fingerings will be shown in a effect band above the tabs in case +they have only a single note on the beat. Piano finger style is enforced, where +fingers are rendered as 1-5 instead of p,i,m,a,c and T,1,2,3,4. + + +* `alphaTab.FingeringMode.ScoreDefault` - Fingerings will be shown in the standard notation staff. +* `alphaTab.FingeringMode.ScoreForcePiano` - Fingerings will be shown in the standard notation staff. Piano finger style is enforced, where +fingers are rendered as 1-5 instead of p,i,m,a,c and T,1,2,3,4. +* `alphaTab.FingeringMode.SingleNoteEffectBand` - Fingerings will be shown in a effect band above the tabs in case +they have only a single note on the beat. +* `alphaTab.FingeringMode.SingleNoteEffectBandForcePiano` - Fingerings will be shown in a effect band above the tabs in case +they have only a single note on the beat. Piano finger style is enforced, where +fingers are rendered as 1-5 instead of p,i,m,a,c and T,1,2,3,4. + + \ No newline at end of file diff --git a/docs/reference/settings/notation/notationmode.mdx b/docs/reference/settings/notation/notationmode.mdx index 404d110..fb33ebf 100644 --- a/docs/reference/settings/notation/notationmode.mdx +++ b/docs/reference/settings/notation/notationmode.mdx @@ -5,33 +5,81 @@ sidebar_custom_props: category: Notation since: 0.9.6 --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; import { SinceBadge } from '@site/src/components/SinceBadge'; +import { CodeBadge } from '@site/src/components/CodeBadge'; +import { PropertyDescription } from '@site/src/components/PropertyDescription'; +import { TypeTable, TypeRow } from '@site/src/components/TypeTable'; -import { PropertyDescription } from '@site/src/components/PropertyDescription'; -import {TypeTable, TypeRow} from '@site/src/components/TypeTable'; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefault
NotationMode.GuitarPro
NotationMode.GuitarPro
NotationMode.GuitarPro
NotationMode.GuitarPro
## Description - -AlphaTab provides 2 main music notation display modes `GuitarPro` and `SongBook`. +AlphaTab provides 2 main music notation display modes `GuitarPro` and `SongBook`. As the names indicate they adjust the overall music notation rendering either to be more in line how [Arobas Guitar Pro](https://www.guitar-pro.com) displays it, or more like the common practice in paper song books practices the display. -The main differences in the Songbook display mode are: +## Related Types -1. **Bends** -For bends additional grace beats are introduced. Bends are categorized into gradual and fast bends. - * Gradual bends are indicated by beat text "grad" or "grad.". Bend will sound along the beat duration. - * Fast bends are done right before the next note. If the next note is tied even on-beat of the next note. -2. **Whammy Bars** -Dips are shown as simple annotation over the beats. Whammy Bars are categorized into gradual and fast. - * Gradual whammys are indicated by beat text "grad" or "grad.". Whammys will sound along the beat duration. - * Fast whammys are done right the beat. +### `enum alphaTab.NotationMode` + + + +`import * as alphaTab from '@coderline/alphaTab';` +* `alphaTab.NotationMode.GuitarPro` - Music elements will be displayed and played as in Guitar Pro. +* `alphaTab.NotationMode.SongBook` - Music elements will be displayed and played as in traditional songbooks. +Changes: +1. **Bends** + For bends additional grace beats are introduced. + Bends are categorized into gradual and fast bends. + - Gradual bends are indicated by beat text "grad" or "grad.". Bend will sound along the beat duration. + - Fast bends are done right before the next note. If the next note is tied even on-beat of the next note. +2. **Whammy Bars** + Dips are shown as simple annotation over the beats + Whammy Bars are categorized into gradual and fast. + - Gradual whammys are indicated by beat text "grad" or "grad.". Whammys will sound along the beat duration. + - Fast whammys are done right the beat. 3. **Let Ring** -Tied notes with let ring are not shown in standard notation. Let ring does not cause a longer playback, duration is defined via tied notes. - + Tied notes with let ring are not shown in standard notation + Let ring does not cause a longer playback, duration is defined via tied notes. 4. **Settings** Following default setting values are applied: ```js @@ -48,34 +96,107 @@ Following default setting values are applied: } } ``` - - - -## Types - - - - `SongBook`
- `GuitarPro` -
- - `SongBook`
- `GuitarPro` -
- - `0` - SongBook
- `1` - GuitarPro -
- - `SongBook`
- `GuitarPro` -
- - `SongBook`
- `GuitarPro` -
-
- -## Default Value - -`GuitarPro` \ No newline at end of file +
+ +* `"GuitarPro"` - Music elements will be displayed and played as in Guitar Pro. +* `"SongBook"` - Music elements will be displayed and played as in traditional songbooks. +Changes: +1. **Bends** + For bends additional grace beats are introduced. + Bends are categorized into gradual and fast bends. + - Gradual bends are indicated by beat text "grad" or "grad.". Bend will sound along the beat duration. + - Fast bends are done right before the next note. If the next note is tied even on-beat of the next note. +2. **Whammy Bars** + Dips are shown as simple annotation over the beats + Whammy Bars are categorized into gradual and fast. + - Gradual whammys are indicated by beat text "grad" or "grad.". Whammys will sound along the beat duration. + - Fast whammys are done right the beat. +3. **Let Ring** + Tied notes with let ring are not shown in standard notation + Let ring does not cause a longer playback, duration is defined via tied notes. +4. **Settings** +Following default setting values are applied: +```js +{ + notation: { + smallGraceTabNotes: false, + fingeringMode: alphaTab.FingeringMode.SingleNoteEffectBandm + extendBendArrowsOnTiedNotes: false + }, + elements: { + parenthesisOnTiedBends: false, + tabNotesOnTiedBends: false, + zerosOnDiveWhammys: true + } +} +``` + + +* `AlphaTab.NotationMode.GuitarPro` - Music elements will be displayed and played as in Guitar Pro. +* `AlphaTab.NotationMode.SongBook` - Music elements will be displayed and played as in traditional songbooks. +Changes: +1. **Bends** + For bends additional grace beats are introduced. + Bends are categorized into gradual and fast bends. + - Gradual bends are indicated by beat text "grad" or "grad.". Bend will sound along the beat duration. + - Fast bends are done right before the next note. If the next note is tied even on-beat of the next note. +2. **Whammy Bars** + Dips are shown as simple annotation over the beats + Whammy Bars are categorized into gradual and fast. + - Gradual whammys are indicated by beat text "grad" or "grad.". Whammys will sound along the beat duration. + - Fast whammys are done right the beat. +3. **Let Ring** + Tied notes with let ring are not shown in standard notation + Let ring does not cause a longer playback, duration is defined via tied notes. +4. **Settings** +Following default setting values are applied: +```js +{ + notation: { + smallGraceTabNotes: false, + fingeringMode: alphaTab.FingeringMode.SingleNoteEffectBandm + extendBendArrowsOnTiedNotes: false + }, + elements: { + parenthesisOnTiedBends: false, + tabNotesOnTiedBends: false, + zerosOnDiveWhammys: true + } +} +``` + + +* `alphaTab.NotationMode.GuitarPro` - Music elements will be displayed and played as in Guitar Pro. +* `alphaTab.NotationMode.SongBook` - Music elements will be displayed and played as in traditional songbooks. +Changes: +1. **Bends** + For bends additional grace beats are introduced. + Bends are categorized into gradual and fast bends. + - Gradual bends are indicated by beat text "grad" or "grad.". Bend will sound along the beat duration. + - Fast bends are done right before the next note. If the next note is tied even on-beat of the next note. +2. **Whammy Bars** + Dips are shown as simple annotation over the beats + Whammy Bars are categorized into gradual and fast. + - Gradual whammys are indicated by beat text "grad" or "grad.". Whammys will sound along the beat duration. + - Fast whammys are done right the beat. +3. **Let Ring** + Tied notes with let ring are not shown in standard notation + Let ring does not cause a longer playback, duration is defined via tied notes. +4. **Settings** +Following default setting values are applied: +```js +{ + notation: { + smallGraceTabNotes: false, + fingeringMode: alphaTab.FingeringMode.SingleNoteEffectBandm + extendBendArrowsOnTiedNotes: false + }, + elements: { + parenthesisOnTiedBends: false, + tabNotesOnTiedBends: false, + zerosOnDiveWhammys: true + } +} +``` + +
\ No newline at end of file diff --git a/docs/reference/settings/notation/rhythmheight.mdx b/docs/reference/settings/notation/rhythmheight.mdx index 997f611..9abaeb7 100644 --- a/docs/reference/settings/notation/rhythmheight.mdx +++ b/docs/reference/settings/notation/rhythmheight.mdx @@ -5,25 +5,46 @@ sidebar_custom_props: category: Notation since: 0.9.6 --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; import { SinceBadge } from '@site/src/components/SinceBadge'; +import { CodeBadge } from '@site/src/components/CodeBadge'; +import { PropertyDescription } from '@site/src/components/PropertyDescription'; +import { TypeTable, TypeRow } from '@site/src/components/TypeTable'; -import { PropertyDescription } from '@site/src/components/PropertyDescription'; -import {TypeTable, TypeRow} from '@site/src/components/TypeTable'; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefault
15
15
15
15
## Description - -This setting can be used in combination with the `RhythmMode` setting to control how high the rhythm notation should be rendered below the tab staff. - - - -## Types - - - - - -## Default Value - -`15` \ No newline at end of file +This setting can be used in combination with the `RhythmMode` setting to control how high the rhythm notation should be rendered below the tab staff. diff --git a/docs/reference/settings/notation/rhythmmode.mdx b/docs/reference/settings/notation/rhythmmode.mdx index 476410f..83e6d6b 100644 --- a/docs/reference/settings/notation/rhythmmode.mdx +++ b/docs/reference/settings/notation/rhythmmode.mdx @@ -1,53 +1,84 @@ --- title: notation.rhythmMode -description: Controls how the rhythm notation is rendered for tab staves. +description: Controls how the rhythm notation is rendered for tab staves. sidebar_custom_props: category: Notation since: 0.9.6 --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; import { SinceBadge } from '@site/src/components/SinceBadge'; +import { CodeBadge } from '@site/src/components/CodeBadge'; +import { PropertyDescription } from '@site/src/components/PropertyDescription'; +import { TypeTable, TypeRow } from '@site/src/components/TypeTable'; -import { PropertyDescription } from '@site/src/components/PropertyDescription'; -import {TypeTable, TypeRow} from '@site/src/components/TypeTable'; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefault
TabRhythmMode.Hidden
TabRhythmMode.Hidden
TabRhythmMode.Hidden
TabRhythmMode.Hidden
## Description - This setting enables the display of rhythm notation on tab staffs. [Demo](/docs/showcase/guitar-tabs) - - -## Types +## Related Types - - - `Hidden` - No rhythm notation is shown
- `ShowWithBeams` - Rhythm notation is rendered with all beats having individual beams
- `ShowWithBars` - Rhythm notation is rendered with normal bars like on standard notation -
- - `hidden`
- `showwithbeams`
- `showwithbars` -
- - `0` - Hidden
- `1` - ShowWithBeams
- `2` - ShowWithBars -
- - `Hidden`
- `ShowWithBeams`
- `ShowWithBars` -
- - `Hidden`
- `ShowWithBeams`
- `ShowWithBars` -
-
+### `enum alphaTab.TabRhythmMode` -## Default Value + + +`import * as alphaTab from '@coderline/alphaTab';` -`hidden` \ No newline at end of file +* `alphaTab.TabRhythmMode.Hidden` - Rhythm notation is hidden. +* `alphaTab.TabRhythmMode.ShowWithBeams` - Rhythm notation is shown with individual beams per beat. +* `alphaTab.TabRhythmMode.ShowWithBars` - Rhythm notation is shown and behaves like normal score notation with connected bars. + + +* `"Hidden"` - Rhythm notation is hidden. +* `"ShowWithBeams"` - Rhythm notation is shown with individual beams per beat. +* `"ShowWithBars"` - Rhythm notation is shown and behaves like normal score notation with connected bars. + + +* `AlphaTab.TabRhythmMode.Hidden` - Rhythm notation is hidden. +* `AlphaTab.TabRhythmMode.ShowWithBeams` - Rhythm notation is shown with individual beams per beat. +* `AlphaTab.TabRhythmMode.ShowWithBars` - Rhythm notation is shown and behaves like normal score notation with connected bars. + + +* `alphaTab.TabRhythmMode.Hidden` - Rhythm notation is hidden. +* `alphaTab.TabRhythmMode.ShowWithBeams` - Rhythm notation is shown with individual beams per beat. +* `alphaTab.TabRhythmMode.ShowWithBars` - Rhythm notation is shown and behaves like normal score notation with connected bars. + + \ No newline at end of file diff --git a/docs/reference/settings/notation/slurheight.mdx b/docs/reference/settings/notation/slurheight.mdx index 12f6f6a..25794e9 100644 --- a/docs/reference/settings/notation/slurheight.mdx +++ b/docs/reference/settings/notation/slurheight.mdx @@ -5,33 +5,51 @@ sidebar_custom_props: category: Notation since: 0.9.6 --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; import { SinceBadge } from '@site/src/components/SinceBadge'; +import { CodeBadge } from '@site/src/components/CodeBadge'; +import { PropertyDescription } from '@site/src/components/PropertyDescription'; +import { TypeTable, TypeRow } from '@site/src/components/TypeTable'; -import { PropertyDescription } from '@site/src/components/PropertyDescription'; -import {TypeTable, TypeRow} from '@site/src/components/TypeTable'; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefault
5.0
5.0
5.0
5.0
## Description - Slurs and ties currently calculate their height based on the distance they have from start to end note. Most music notation software do some complex collision detection to avoid a slur to overlap with other elements, alphaTab -only has a simplified version of the slur positioning as of today. This setting allows adjusting the slur height to avoid collisions. The factor defined by this setting, is multiplied with the logarithmic distance between start and end. - - +only has a simplified version of the slur positioning as of today. This setting allows adjusting the slur height to avoid collisions. The factor defined by this setting, is multiplied with the logarithmic distance between start and end. | Slur Height Default | Slur Height 14 | |------------------------------------------------------------------------|--------------------------------------------------------------| | ![Slur Height Default](/img/reference/property/slurheight-default.png) | ![Slur Height 14](/img/reference/property/slurheight-14.png) | - -## Types - - - - `7`
- `14`
- `3.5` -
-
- -## Default Value -`7` \ No newline at end of file diff --git a/docs/reference/settings/notation/smallgracetabnotes.mdx b/docs/reference/settings/notation/smallgracetabnotes.mdx index db35054..aff2b98 100644 --- a/docs/reference/settings/notation/smallgracetabnotes.mdx +++ b/docs/reference/settings/notation/smallgracetabnotes.mdx @@ -5,29 +5,50 @@ sidebar_custom_props: category: Notation since: 0.9.6 --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; import { SinceBadge } from '@site/src/components/SinceBadge'; +import { CodeBadge } from '@site/src/components/CodeBadge'; +import { PropertyDescription } from '@site/src/components/PropertyDescription'; +import { TypeTable, TypeRow } from '@site/src/components/TypeTable'; -import { PropertyDescription } from '@site/src/components/PropertyDescription'; -import {TypeTable, TypeRow} from '@site/src/components/TypeTable'; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefault
true
true
true
true
## Description - -By default, grace notes are drawn smaller on the guitar tabs than the other numbers. With this setting alphaTab can be configured to show grace tab notes with normal text size. - - +By default, grace notes are drawn smaller on the guitar tabs than the other numbers. With this setting alphaTab can be configured to show grace tab notes with normal text size. | Enabled | Disabled | |--------------------------------------------------------------------|----------------------------------------------------------------------| | ![Enabled](/img/reference/property/smallgracetabnotes-enabled.png) | ![Disabled](/img/reference/property/smallgracetabnotes-disabled.png) | - -## Types - - - - - -## Default Value - -`true` \ No newline at end of file diff --git a/docs/reference/settings/notation/transpositionpitches.mdx b/docs/reference/settings/notation/transpositionpitches.mdx index 3c4e6d2..acae0ea 100644 --- a/docs/reference/settings/notation/transpositionpitches.mdx +++ b/docs/reference/settings/notation/transpositionpitches.mdx @@ -5,26 +5,47 @@ sidebar_custom_props: category: Notation since: 0.9.6 --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; import { SinceBadge } from '@site/src/components/SinceBadge'; +import { CodeBadge } from '@site/src/components/CodeBadge'; +import { PropertyDescription } from '@site/src/components/PropertyDescription'; +import { TypeTable, TypeRow } from '@site/src/components/TypeTable'; -import { PropertyDescription } from '@site/src/components/PropertyDescription'; -import {TypeTable, TypeRow} from '@site/src/components/TypeTable'; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefault
[]
[]
[]
[]
## Description - -This setting allows transposing of tracks for display and playback. -The `TranspositionPitches` setting allows defining an additional pitch offset per track, that is then considered when displaying the music sheet. - - - -## Types - - - - - -## Default Value - -`(empty)` \ No newline at end of file +This setting allows transposing of tracks for display and playback. +The `transpositionPitches` setting allows defining an additional pitch offset per track, that is then considered when displaying the music sheet. diff --git a/docs/reference/settings/player/buffertimeinmilliseconds.mdx b/docs/reference/settings/player/buffertimeinmilliseconds.mdx index aa4e0bc..6837ea5 100644 --- a/docs/reference/settings/player/buffertimeinmilliseconds.mdx +++ b/docs/reference/settings/player/buffertimeinmilliseconds.mdx @@ -5,33 +5,49 @@ sidebar_custom_props: category: Player since: 1.2.3 --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; import { SinceBadge } from '@site/src/components/SinceBadge'; +import { CodeBadge } from '@site/src/components/CodeBadge'; +import { PropertyDescription } from '@site/src/components/PropertyDescription'; +import { TypeTable, TypeRow } from '@site/src/components/TypeTable'; -import { PropertyDescription } from '@site/src/components/PropertyDescription'; -import {TypeTable, TypeRow} from '@site/src/components/TypeTable'; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefault
500
500
500
500
## Description - Gets or sets how many milliseconds of audio samples should be buffered in total. - -* Larger buffers cause a delay from when audio settings like volumes will be applied. +* Larger buffers cause a delay from when audio settings like volumes will be applied. * Smaller buffers can cause audio crackling due to constant buffering that is happening. - This buffer size can be changed whenever needed. - - - -## Types - - - - `5000`
- `1000` -
-
- -## Default Value - -`500` \ No newline at end of file diff --git a/docs/reference/settings/player/enableanimatedbeatcursor.mdx b/docs/reference/settings/player/enableanimatedbeatcursor.mdx index 702ad99..58be2f2 100644 --- a/docs/reference/settings/player/enableanimatedbeatcursor.mdx +++ b/docs/reference/settings/player/enableanimatedbeatcursor.mdx @@ -5,26 +5,47 @@ sidebar_custom_props: category: Player since: 1.2.3 --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; import { SinceBadge } from '@site/src/components/SinceBadge'; +import { CodeBadge } from '@site/src/components/CodeBadge'; +import { PropertyDescription } from '@site/src/components/PropertyDescription'; +import { TypeTable, TypeRow } from '@site/src/components/TypeTable'; -import { PropertyDescription } from '@site/src/components/PropertyDescription'; -import {TypeTable, TypeRow} from '@site/src/components/TypeTable'; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefault
true
true
true
true
## Description - -This setting configures whether the beat cursor is animated smoothly or whether it is ticking from beat to beat. +This setting configures whether the beat cursor is animated smoothly or whether it is ticking from beat to beat. The animation of the cursor might not be available on all targets so it might not have any effect. - - - -## Types - - - - - -## Default Value - -`true` \ No newline at end of file diff --git a/docs/reference/settings/player/enablecursor.mdx b/docs/reference/settings/player/enablecursor.mdx index 4520955..b78a53b 100644 --- a/docs/reference/settings/player/enablecursor.mdx +++ b/docs/reference/settings/player/enablecursor.mdx @@ -5,25 +5,46 @@ sidebar_custom_props: category: Player since: 0.9.6 --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; import { SinceBadge } from '@site/src/components/SinceBadge'; +import { CodeBadge } from '@site/src/components/CodeBadge'; +import { PropertyDescription } from '@site/src/components/PropertyDescription'; +import { TypeTable, TypeRow } from '@site/src/components/TypeTable'; -import { PropertyDescription } from '@site/src/components/PropertyDescription'; -import {TypeTable, TypeRow} from '@site/src/components/TypeTable'; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefault
true
true
true
true
## Description - -This setting configures whether the playback cursors are shown or not. In case a developer decides to built an own cursor system the default one can be disabled with this setting. Enabling the cursor also requires the player to be active. - - - -## Types - - - - - -## Default Value - -`true` \ No newline at end of file +This setting configures whether the playback cursors are shown or not. In case a developer decides to built an own cursor system the default one can be disabled with this setting. Enabling the cursor also requires the player to be active. diff --git a/docs/reference/settings/player/enableelementhighlighting.mdx b/docs/reference/settings/player/enableelementhighlighting.mdx index be0ae7f..91e0c96 100644 --- a/docs/reference/settings/player/enableelementhighlighting.mdx +++ b/docs/reference/settings/player/enableelementhighlighting.mdx @@ -5,26 +5,47 @@ sidebar_custom_props: category: Player since: 1.2.3 --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; import { SinceBadge } from '@site/src/components/SinceBadge'; +import { CodeBadge } from '@site/src/components/CodeBadge'; +import { PropertyDescription } from '@site/src/components/PropertyDescription'; +import { TypeTable, TypeRow } from '@site/src/components/TypeTable'; -import { PropertyDescription } from '@site/src/components/PropertyDescription'; -import {TypeTable, TypeRow} from '@site/src/components/TypeTable'; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefault
true
true
true
true
## Description - -This setting configures whether the note elements are highlighted during playback. +This setting configures whether the note elements are highlighted during playback. The highlighting of elements might not be available on all targets and render engine, so it might not have any effect. - - - -## Types - - - - - -## Default Value - -`true` \ No newline at end of file diff --git a/docs/reference/settings/player/enableplayer.mdx b/docs/reference/settings/player/enableplayer.mdx index 2dd522a..ebaa322 100644 --- a/docs/reference/settings/player/enableplayer.mdx +++ b/docs/reference/settings/player/enableplayer.mdx @@ -5,29 +5,50 @@ sidebar_custom_props: category: Player since: 0.9.6 --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; import { SinceBadge } from '@site/src/components/SinceBadge'; +import { CodeBadge } from '@site/src/components/CodeBadge'; +import { PropertyDescription } from '@site/src/components/PropertyDescription'; +import { TypeTable, TypeRow } from '@site/src/components/TypeTable'; -import { PropertyDescription } from '@site/src/components/PropertyDescription'; -import {TypeTable, TypeRow} from '@site/src/components/TypeTable'; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefault
false
false
false
false
## Description - -This setting configures whether the player feature is enabled or not. Depending on the platform enabling the player needs some additional actions of the developer. -For the JavaScript version the [player.soundFont](/docs/reference/settings/player/soundfont) property must be set to the URL of the sound font that should be used or it must be loaded manually via API. -For .net manually the soundfont must be loaded. +This setting configures whether the player feature is enabled or not. Depending on the platform enabling the player needs some additional actions of the developer. +For the JavaScript version the `PlayerSettings.soundFont` property must be set to the URL of the sound font that should be used or it must be loaded manually via API. +For .net manually the soundfont must be loaded. AlphaTab does not ship a default UI for the player. The API must be hooked up to some UI controls to allow the user to interact with the player. - - - -## Types - - - - - -## Default Value - -`false` \ No newline at end of file diff --git a/docs/reference/settings/player/enableuserinteraction.mdx b/docs/reference/settings/player/enableuserinteraction.mdx index 2a71b9a..6cd0842 100644 --- a/docs/reference/settings/player/enableuserinteraction.mdx +++ b/docs/reference/settings/player/enableuserinteraction.mdx @@ -5,27 +5,47 @@ sidebar_custom_props: category: Player since: 0.9.7 --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; import { SinceBadge } from '@site/src/components/SinceBadge'; +import { CodeBadge } from '@site/src/components/CodeBadge'; +import { PropertyDescription } from '@site/src/components/PropertyDescription'; +import { TypeTable, TypeRow } from '@site/src/components/TypeTable'; -import { PropertyDescription } from '@site/src/components/PropertyDescription'; -import {TypeTable, TypeRow} from '@site/src/components/TypeTable'; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefault
true
true
true
true
## Description - This setting configures whether alphaTab provides the default user interaction features like selection of the playback range and "seek on click". -By default users can select the desired playback range with the mouse and also jump to individual beats by click. This behavior can be contolled w1ith this setting. - - - - -## Types - - - - - -## Default Value - -`true` \ No newline at end of file +By default users can select the desired playback range with the mouse and also jump to individual beats by click. This behavior can be contolled w1ith this setting. diff --git a/docs/reference/settings/player/nativebrowsersmoothscroll.mdx b/docs/reference/settings/player/nativebrowsersmoothscroll.mdx index da9273d..ba8bdab 100644 --- a/docs/reference/settings/player/nativebrowsersmoothscroll.mdx +++ b/docs/reference/settings/player/nativebrowsersmoothscroll.mdx @@ -3,30 +3,41 @@ title: player.nativeBrowserSmoothScroll description: Whether the native browser smooth scroll mechanism should be used over a custom animation. sidebar_custom_props: javaScriptOnly: true - category: Player + category: Player - JavaScript Specific since: 1.2.3 --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; import { SinceBadge } from '@site/src/components/SinceBadge'; +import { CodeBadge } from '@site/src/components/CodeBadge'; +import { PropertyDescription } from '@site/src/components/PropertyDescription'; +import { TypeTable, TypeRow } from '@site/src/components/TypeTable'; -import { PropertyDescription } from '@site/src/components/PropertyDescription'; -import {TypeTable, TypeRow} from '@site/src/components/TypeTable'; + + + + + + + + + + + + + + + + + + + + +
NameTypeDefault
true
true
## Description - This setting configures whether the [native browser feature](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollTo) for smooth scrolling should be used over a custom animation. -If this setting is enabled, options like `player.scrollSpeed` will not have an effect anymore. - - - -## Types - - - - - -## Default Value - -`true` \ No newline at end of file +If this setting is enabled, options like `PlayerSettings.scrollSpeed` will not have an effect anymore. diff --git a/docs/reference/settings/player/outputmode.mdx b/docs/reference/settings/player/outputmode.mdx index 1160b0c..3124dd5 100644 --- a/docs/reference/settings/player/outputmode.mdx +++ b/docs/reference/settings/player/outputmode.mdx @@ -6,36 +6,70 @@ sidebar_custom_props: category: Player - JavaScript Specific since: 1.3.0 --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; import { SinceBadge } from '@site/src/components/SinceBadge'; +import { CodeBadge } from '@site/src/components/CodeBadge'; +import { PropertyDescription } from '@site/src/components/PropertyDescription'; +import { TypeTable, TypeRow } from '@site/src/components/TypeTable'; -import { PropertyDescription } from '@site/src/components/PropertyDescription'; -import {TypeTable, TypeRow} from '@site/src/components/TypeTable'; + + + + + + + + + + + + + + + + + + + + +
NameTypeDefault
PlayerOutputMode.WebAudioAudioWorklets
PlayerOutputMode.WebAudioAudioWorklets
## Description - Controls how alphaTab will play the audio samples in the browser. - - -## Types +## Related Types - - - `WebAudioAudioWorklets` - If [audio worklets](https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API/Using_AudioWorklet) are available, they are used. If not fallback to the ScriptProcessorNode
- `WebAudioScriptProcessor` - Using the [ScriptProcessorNode](https://developer.mozilla.org/en-US/docs/Web/API/ScriptProcessorNode) for playback
-
- - `webaudioaudioworklets`
- `webaudioscriptprocessor` -
- - `0` - WebAudioAudioWorklets
- `1` - WebAudioScriptProcessor
-
-
+### `enum alphaTab.PlayerOutputMode` -## Default Value + + +`import * as alphaTab from '@coderline/alphaTab';` -`WebAudioAudioWorklets` \ No newline at end of file +* `alphaTab.PlayerOutputMode.WebAudioAudioWorklets` - If [audio worklets](https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API/Using_AudioWorklet) are available, they are used. +If not fallback to the [ScriptProcessorNode](https://developer.mozilla.org/en-US/docs/Web/API/ScriptProcessorNode) +* `alphaTab.PlayerOutputMode.WebAudioScriptProcessor` - Using the [ScriptProcessorNode](https://developer.mozilla.org/en-US/docs/Web/API/ScriptProcessorNode) for playback. + + +* `"WebAudioAudioWorklets"` - If [audio worklets](https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API/Using_AudioWorklet) are available, they are used. +If not fallback to the [ScriptProcessorNode](https://developer.mozilla.org/en-US/docs/Web/API/ScriptProcessorNode) +* `"WebAudioScriptProcessor"` - Using the [ScriptProcessorNode](https://developer.mozilla.org/en-US/docs/Web/API/ScriptProcessorNode) for playback. + + +* `AlphaTab.PlayerOutputMode.WebAudioAudioWorklets` - If [audio worklets](https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API/Using_AudioWorklet) are available, they are used. +If not fallback to the [ScriptProcessorNode](https://developer.mozilla.org/en-US/docs/Web/API/ScriptProcessorNode) +* `AlphaTab.PlayerOutputMode.WebAudioScriptProcessor` - Using the [ScriptProcessorNode](https://developer.mozilla.org/en-US/docs/Web/API/ScriptProcessorNode) for playback. + + +* `alphaTab.PlayerOutputMode.WebAudioAudioWorklets` - If [audio worklets](https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API/Using_AudioWorklet) are available, they are used. +If not fallback to the [ScriptProcessorNode](https://developer.mozilla.org/en-US/docs/Web/API/ScriptProcessorNode) +* `alphaTab.PlayerOutputMode.WebAudioScriptProcessor` - Using the [ScriptProcessorNode](https://developer.mozilla.org/en-US/docs/Web/API/ScriptProcessorNode) for playback. + + \ No newline at end of file diff --git a/docs/reference/settings/player/playtripletfeel.mdx b/docs/reference/settings/player/playtripletfeel.mdx index 98cb40f..fd5b5c0 100644 --- a/docs/reference/settings/player/playtripletfeel.mdx +++ b/docs/reference/settings/player/playtripletfeel.mdx @@ -5,25 +5,46 @@ sidebar_custom_props: category: Player since: 0.9.6 --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; import { SinceBadge } from '@site/src/components/SinceBadge'; +import { CodeBadge } from '@site/src/components/CodeBadge'; +import { PropertyDescription } from '@site/src/components/PropertyDescription'; +import { TypeTable, TypeRow } from '@site/src/components/TypeTable'; -import { PropertyDescription } from '@site/src/components/PropertyDescription'; -import {TypeTable, TypeRow} from '@site/src/components/TypeTable'; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefault
true
true
true
true
## Description - -If this setting is enabled alphaTab will play the triplet feels accordingly, if it is disabled the triplet feel is only displayed but not played. - - - -## Types - - - - - -## Default Value - -`true` \ No newline at end of file +If this setting is enabled alphaTab will play the triplet feels accordingly, if it is disabled the triplet feel is only displayed but not played. diff --git a/docs/reference/settings/player/scrollelement.mdx b/docs/reference/settings/player/scrollelement.mdx index 0881e13..eef4d1c 100644 --- a/docs/reference/settings/player/scrollelement.mdx +++ b/docs/reference/settings/player/scrollelement.mdx @@ -6,30 +6,38 @@ sidebar_custom_props: category: Player - JavaScript Specific since: 0.9.6 --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; import { SinceBadge } from '@site/src/components/SinceBadge'; +import { CodeBadge } from '@site/src/components/CodeBadge'; +import { PropertyDescription } from '@site/src/components/PropertyDescription'; +import { TypeTable, TypeRow } from '@site/src/components/TypeTable'; -import { PropertyDescription } from '@site/src/components/PropertyDescription'; -import {TypeTable, TypeRow} from '@site/src/components/TypeTable'; + + + + + + + + + + + + + + + + + + + + +
NameTypeDefault
'html,body'
"html,body"
## Description - -When the player is active, it by default automatically scrolls the browser window to the currently played bar. This setting +When the player is active, it by default automatically scrolls the browser window to the currently played bar. This setting defines which elements should be scrolled to bring the played bar into the view port. By default scrolling happens on the `html,body` -selector. - - - -## Types - - - - A selector for `document.querySelector` - - - - -## Default Value - -`html,body` \ No newline at end of file +selector. diff --git a/docs/reference/settings/player/scrollmode.mdx b/docs/reference/settings/player/scrollmode.mdx index 133d43b..92e6cf3 100644 --- a/docs/reference/settings/player/scrollmode.mdx +++ b/docs/reference/settings/player/scrollmode.mdx @@ -5,50 +5,80 @@ sidebar_custom_props: category: Player since: 0.9.6 --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; import { SinceBadge } from '@site/src/components/SinceBadge'; +import { CodeBadge } from '@site/src/components/CodeBadge'; +import { PropertyDescription } from '@site/src/components/PropertyDescription'; +import { TypeTable, TypeRow } from '@site/src/components/TypeTable'; -import { PropertyDescription } from '@site/src/components/PropertyDescription'; -import {TypeTable, TypeRow} from '@site/src/components/TypeTable'; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefault
ScrollMode.Continuous
ScrollMode.Continuous
ScrollMode.Continuous
ScrollMode.Continuous
## Description +This setting controls how alphaTab behaves for scrolling. -This setting controls how alphaTab behaves for scrolling. It supports 3 modes: - - - -## Types - - - - `Off` - No automatic scrolling is done
- `Continuous` - Scrolling happens as soon the offsets of the cursors change
- `OffScreen` - Scrolling happens as soon the cursors exceed the displayed range -
- - `off`
- `continuous`
- `offscreen` -
- - `0` - Off
- `1` - Continuous
- `2` - OffScreen -
- - `Off`
- `Continuous`
- `OffScreen` -
- - `Off`
- `Continuous`
- `OffScreen` -
+## Related Types -
+### `enum alphaTab.ScrollMode` -## Default Value + + +`import * as alphaTab from '@coderline/alphaTab';` -`Continuous` \ No newline at end of file +* `alphaTab.ScrollMode.Off` - Do not scroll automatically +* `alphaTab.ScrollMode.Continuous` - Scrolling happens as soon the offsets of the cursors change. +* `alphaTab.ScrollMode.OffScreen` - Scrolling happens as soon the cursors exceed the displayed range. + + +* `"Off"` - Do not scroll automatically +* `"Continuous"` - Scrolling happens as soon the offsets of the cursors change. +* `"OffScreen"` - Scrolling happens as soon the cursors exceed the displayed range. + + +* `AlphaTab.ScrollMode.Off` - Do not scroll automatically +* `AlphaTab.ScrollMode.Continuous` - Scrolling happens as soon the offsets of the cursors change. +* `AlphaTab.ScrollMode.OffScreen` - Scrolling happens as soon the cursors exceed the displayed range. + + +* `alphaTab.ScrollMode.Off` - Do not scroll automatically +* `alphaTab.ScrollMode.Continuous` - Scrolling happens as soon the offsets of the cursors change. +* `alphaTab.ScrollMode.OffScreen` - Scrolling happens as soon the cursors exceed the displayed range. + + \ No newline at end of file diff --git a/docs/reference/settings/player/scrolloffsetx.mdx b/docs/reference/settings/player/scrolloffsetx.mdx index 46fae27..466d847 100644 --- a/docs/reference/settings/player/scrolloffsetx.mdx +++ b/docs/reference/settings/player/scrolloffsetx.mdx @@ -1,34 +1,52 @@ --- -title: player.playerOffsetX +title: player.scrollOffsetX description: The X-offset to add when scrolling. sidebar_custom_props: category: Player since: 0.9.6 --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; import { SinceBadge } from '@site/src/components/SinceBadge'; +import { CodeBadge } from '@site/src/components/CodeBadge'; +import { PropertyDescription } from '@site/src/components/PropertyDescription'; +import { TypeTable, TypeRow } from '@site/src/components/TypeTable'; -import { PropertyDescription } from '@site/src/components/PropertyDescription'; -import {TypeTable, TypeRow} from '@site/src/components/TypeTable'; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefault
0
0
0
0
## Description - -When alphaTab does an auto-scrolling to the displayed bar, it will try to align the view port to the displayed bar. If due to -some layout specifics or for aesthetics a small padding is needed, this setting allows an additional X-offset that is added to the -scroll position. - - - -## Types - - - - `-10`
- `20` -
-
- -## Default Value - -`0` \ No newline at end of file +When alphaTab does an auto-scrolling to the displayed bar, it will try to align the view port to the displayed bar. If due to +some layout specifics or for aesthetics a small padding is needed, this setting allows an additional X-offset that is added to the +scroll position. diff --git a/docs/reference/settings/player/scrolloffsety.mdx b/docs/reference/settings/player/scrolloffsety.mdx index f7f4a19..3463674 100644 --- a/docs/reference/settings/player/scrolloffsety.mdx +++ b/docs/reference/settings/player/scrolloffsety.mdx @@ -5,30 +5,48 @@ sidebar_custom_props: category: Player since: 0.9.6 --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; import { SinceBadge } from '@site/src/components/SinceBadge'; +import { CodeBadge } from '@site/src/components/CodeBadge'; +import { PropertyDescription } from '@site/src/components/PropertyDescription'; +import { TypeTable, TypeRow } from '@site/src/components/TypeTable'; -import { PropertyDescription } from '@site/src/components/PropertyDescription'; -import {TypeTable, TypeRow} from '@site/src/components/TypeTable'; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefault
0
0
0
0
## Description - -When alphaTab does an auto-scrolling to the displayed bar, it will try to align the view port to the displayed bar. If due to -some layout specifics or for aesthetics a small padding is needed, this setting allows an additional Y-offset that is added to the -scroll position. - - - -## Types - - - - `-10`
- `20` -
-
- -## Default Value - -`0` \ No newline at end of file +When alphaTab does an auto-scrolling to the displayed bar, it will try to align the view port to the displayed bar. If due to +some layout specifics or for aesthetics a small padding is needed, this setting allows an additional Y-offset that is added to the +scroll position. diff --git a/docs/reference/settings/player/scrollspeed.mdx b/docs/reference/settings/player/scrollspeed.mdx index d9f3b4e..0c4282a 100644 --- a/docs/reference/settings/player/scrollspeed.mdx +++ b/docs/reference/settings/player/scrollspeed.mdx @@ -5,30 +5,48 @@ sidebar_custom_props: category: Player since: 0.9.6 --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; import { SinceBadge } from '@site/src/components/SinceBadge'; +import { CodeBadge } from '@site/src/components/CodeBadge'; +import { PropertyDescription } from '@site/src/components/PropertyDescription'; +import { TypeTable, TypeRow } from '@site/src/components/TypeTable'; -import { PropertyDescription } from '@site/src/components/PropertyDescription'; -import {TypeTable, TypeRow} from '@site/src/components/TypeTable'; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefault
300
300
300
300
## Description - If possible from the platform, alphaTab will try to do a smooth scrolling to the played bar. This setting defines the speed of scrolling in milliseconds. -Note that `player.nativeBrowserSmoothScroll` must be set to `false` for this to have an effect. - - - -## Types - - - - `200`
- `300`
- `100` -
-
- -## Default Value -`300` \ No newline at end of file +Note that `PlayerSettings.nativeBrowserSmoothScroll` must be set to `false` for this to have an effect. diff --git a/docs/reference/settings/player/slide.mdx b/docs/reference/settings/player/slide.mdx index 508709f..845c784 100644 --- a/docs/reference/settings/player/slide.mdx +++ b/docs/reference/settings/player/slide.mdx @@ -1,113 +1,238 @@ --- title: player.slide -description: The slide settings allow control how the different slide types are generated for audio. +description: The slide settings allow control how the different slide types are generated for audio. sidebar_custom_props: - domWildCard: true category: Player - since: 0.9.9 + since: 0.9.6 --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; import { SinceBadge } from '@site/src/components/SinceBadge'; - - - -import { PropertyDescription } from '@site/src/components/PropertyDescription'; -import {TypeTable, TypeRow} from '@site/src/components/TypeTable'; import { CodeBadge } from '@site/src/components/CodeBadge'; +import { PropertyDescription } from '@site/src/components/PropertyDescription'; +import { TypeTable, TypeRow } from '@site/src/components/TypeTable'; -export var SlideSettings = [ - { - name: 'simpleSlidePitchOffset', - defaultValue: 6, - type: 'int', - description: 'The 1/4 tones (bend value) offset that simple slides like slide-out-below or slide-in-above use.' - }, - { - name: 'simpleSlideDurationRatio', - defaultValue: 0.25, - type: 'double', - description: - 'The percentage which the simple slides should take up from the whole note. for "slide into" ' + - 'effects the slide will take place from time 0 where the note is plucked to 25% of the overall ' + - 'note duration. For "slide out" effects the slide will start 75% and finish at 100% of the overall note duration.' - }, - { - name: 'shiftSlideDurationRatio', - defaultValue: 0.5, - type: 'double', - description: 'The percentage which the legato and shift slides should take up ' + - ' from the whole note. For a value 0.5 the sliding will start at 50% of the overall note duration ' + - ' and finish at 100%.' - } -]; - -export function toPascalCase(v) { - return v.substr(0, 1).toUpperCase() + v.substr(1); -} - -export function SlideRow({setting}) { - return ( - - -
-
-
- - - - - - - {setting.defaultValue} - - {setting.description} - - - ); -} - -export function SlideTable() { - const settings = SlideSettings.map(c => ); - return ( - - - - - - - - - - - {settings} - -
SettingTypeDefaultSummary
- ); -} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefault
## Description +AlphaTab supports various types of slides which can be grouped into 3 types: -AlphaTab supports various types of slides which can be grouped into 3 types: - +Type 1: * Shift Slides * Legato Slides - +Type 2: * Slide into from below * Slide into from above * Slide out to below -* Slide out to above - +* Slide out to above +Type 3 * Pick Slide out to above * Pick Slide out to below For the first 2 groups the audio generation can be adapted. For the pick slide the audio generation cannot be adapted -as there is no mechanism yet in alphaTab to play pick slides to make them sound real. +as there is no mechanism yet in alphaTab to play pick slides to make them sound real. For the first group only the duration or start point of the slide can be configured while for the second group -the duration/start-point and the pitch offset can be configured. +the duration/start-point and the pitch offset can be configured. + +## Related Types -## Slide Settings +### `class SlidePlaybackSettings` - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PropertyTypeDefaultSummary
number6Gets or sets 1/4 tones (bend value) offset that +simple slides like slide-out-below or slide-in-above use.
number0.25Gets or sets the percentage which the simple slides should take up +from the whole note. for "slide into" effects the slide will take place +from time 0 where the note is plucked to 25% of the overall note duration. +For "slide out" effects the slide will start 75% and finish at 100% of the overall +note duration.
number0.5Gets or sets the percentage which the legato and shift slides should take up +from the whole note. For a value 0.5 the sliding will start at 50% of the overall note duration +and finish at 100%
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SettingTypeDefaultSummary
number6Gets or sets 1/4 tones (bend value) offset that +simple slides like slide-out-below or slide-in-above use.
number0.25Gets or sets the percentage which the simple slides should take up +from the whole note. for "slide into" effects the slide will take place +from time 0 where the note is plucked to 25% of the overall note duration. +For "slide out" effects the slide will start 75% and finish at 100% of the overall +note duration.
number0.5Gets or sets the percentage which the legato and shift slides should take up +from the whole note. For a value 0.5 the sliding will start at 50% of the overall note duration +and finish at 100%
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SettingTypeDefaultSummary
double6Gets or sets 1/4 tones (bend value) offset that +simple slides like slide-out-below or slide-in-above use.
double0.25Gets or sets the percentage which the simple slides should take up +from the whole note. for "slide into" effects the slide will take place +from time 0 where the note is plucked to 25% of the overall note duration. +For "slide out" effects the slide will start 75% and finish at 100% of the overall +note duration.
double0.5Gets or sets the percentage which the legato and shift slides should take up +from the whole note. For a value 0.5 the sliding will start at 50% of the overall note duration +and finish at 100%
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SettingTypeDefaultSummary
Double6Gets or sets 1/4 tones (bend value) offset that +simple slides like slide-out-below or slide-in-above use.
Double0.25Gets or sets the percentage which the simple slides should take up +from the whole note. for "slide into" effects the slide will take place +from time 0 where the note is plucked to 25% of the overall note duration. +For "slide out" effects the slide will start 75% and finish at 100% of the overall +note duration.
Double0.5Gets or sets the percentage which the legato and shift slides should take up +from the whole note. For a value 0.5 the sliding will start at 50% of the overall note duration +and finish at 100%
+
+
\ No newline at end of file diff --git a/docs/reference/settings/player/songbookbendduration.mdx b/docs/reference/settings/player/songbookbendduration.mdx index b981436..9c1e10a 100644 --- a/docs/reference/settings/player/songbookbendduration.mdx +++ b/docs/reference/settings/player/songbookbendduration.mdx @@ -5,31 +5,48 @@ sidebar_custom_props: category: Player since: 0.9.6 --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; import { SinceBadge } from '@site/src/components/SinceBadge'; +import { CodeBadge } from '@site/src/components/CodeBadge'; +import { PropertyDescription } from '@site/src/components/PropertyDescription'; +import { TypeTable, TypeRow } from '@site/src/components/TypeTable'; -import { PropertyDescription } from '@site/src/components/PropertyDescription'; -import {TypeTable, TypeRow} from '@site/src/components/TypeTable'; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefault
75
75
75
75
## Description - -If the display mode `songbook` is enabled, this has an effect on the way bends are played. For songbook bends the bend is done very quickly at the end or start of the beat. -This setting defines the play duration for those bends in milliseconds. This duration is in milliseconds unlike some other settings which are in midi ticks. The reason is that on songbook bends, -the bends should always be played in the same speed, regardless of the song tempo. Midi ticks are tempo dependent. - - - -## Types - - - - `75`
- `120`
- `250` -
-
- -## Default Value - -`75` \ No newline at end of file +If the display mode `songbook` is enabled, this has an effect on the way bends are played. For songbook bends the bend is done very quickly at the end or start of the beat. +This setting defines the play duration for those bends in milliseconds. This duration is in milliseconds unlike some other settings which are in midi ticks. The reason is that on songbook bends, +the bends should always be played in the same speed, regardless of the song tempo. Midi ticks are tempo dependent. diff --git a/docs/reference/settings/player/songbookdipduration.mdx b/docs/reference/settings/player/songbookdipduration.mdx index 3a871a8..09e1568 100644 --- a/docs/reference/settings/player/songbookdipduration.mdx +++ b/docs/reference/settings/player/songbookdipduration.mdx @@ -5,31 +5,48 @@ sidebar_custom_props: category: Player since: 0.9.6 --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; import { SinceBadge } from '@site/src/components/SinceBadge'; +import { CodeBadge } from '@site/src/components/CodeBadge'; +import { PropertyDescription } from '@site/src/components/PropertyDescription'; +import { TypeTable, TypeRow } from '@site/src/components/TypeTable'; -import { PropertyDescription } from '@site/src/components/PropertyDescription'; -import {TypeTable, TypeRow} from '@site/src/components/TypeTable'; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefault
150
150
150
150
## Description - -If the display mode `songbook` is enabled, this has an effect on the way whammy dips are played. For songbook dips the whammy is pressed very quickly at the start of the beat. -This setting defines the play duration for those whammy bars in milliseconds. This duration is in milliseconds unlike some other settings which are in midi ticks. The reason is that on songbook dips, -the whammy should always be pressed in the same speed, regardless of the song tempo. Midi ticks are tempo dependent. - - - -## Types - - - - `75`
- `120`
- `250` -
-
- -## Default Value - -`150` \ No newline at end of file +If the display mode `songbook` is enabled, this has an effect on the way whammy dips are played. For songbook dips the whammy is pressed very quickly at the start of the beat. +This setting defines the play duration for those whammy bars in milliseconds. This duration is in milliseconds unlike some other settings which are in midi ticks. The reason is that on songbook dips, +the whammy should always be pressed in the same speed, regardless of the song tempo. Midi ticks are tempo dependent. diff --git a/docs/reference/settings/player/soundfont.mdx b/docs/reference/settings/player/soundfont.mdx index 0f298f6..ece98a6 100644 --- a/docs/reference/settings/player/soundfont.mdx +++ b/docs/reference/settings/player/soundfont.mdx @@ -6,25 +6,36 @@ sidebar_custom_props: category: Player - JavaScript Specific since: 0.9.6 --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; import { SinceBadge } from '@site/src/components/SinceBadge'; +import { CodeBadge } from '@site/src/components/CodeBadge'; +import { PropertyDescription } from '@site/src/components/PropertyDescription'; +import { TypeTable, TypeRow } from '@site/src/components/TypeTable'; -import { PropertyDescription } from '@site/src/components/PropertyDescription'; -import {TypeTable, TypeRow} from '@site/src/components/TypeTable'; + + + + + + + + + + + + + + + + + + + + +
NameTypeDefault
null
null
## Description - -When the player is enabled the soundfont from this URL will be loaded automatically after the player is ready. - - - -## Types - - - - - -## Default Value - -`null` \ No newline at end of file +When the player is enabled the soundfont from this URL will be loaded automatically after the player is ready. diff --git a/docs/reference/settings/player/vibrato.mdx b/docs/reference/settings/player/vibrato.mdx index 374527d..24eb4b4 100644 --- a/docs/reference/settings/player/vibrato.mdx +++ b/docs/reference/settings/player/vibrato.mdx @@ -1,118 +1,317 @@ --- title: player.vibrato -description: The Vibrato settings allow control how the different vibrato types are generated for audio. +description: The Vibrato settings allow control how the different vibrato types are generated for audio. sidebar_custom_props: - domWildCard: true category: Player since: 0.9.6 --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; import { SinceBadge } from '@site/src/components/SinceBadge'; - - - -import { PropertyDescription } from '@site/src/components/PropertyDescription'; -import {TypeTable, TypeRow} from '@site/src/components/TypeTable'; import { CodeBadge } from '@site/src/components/CodeBadge'; +import { PropertyDescription } from '@site/src/components/PropertyDescription'; +import { TypeTable, TypeRow } from '@site/src/components/TypeTable'; -export var VibratoSettings = [ - { - name: 'beatSlightAmplitude', - defaultValue: 3, - description: 'The amplitude for the beat-slight vibrato in semitones.' - }, - { - name: 'beatSlightLength', - defaultValue: 240, - description: 'The wavelength of the beat-slight vibrato in midi ticks.' - }, - { - name: 'beatWideAmplitude', - defaultValue: 3, - description: 'The amplitude for the beat-wide vibrato in semitones.' - }, - { - name: 'beatWideLength', - defaultValue: 240, - description: 'The wavelength of the beat-wide vibrato in midi ticks.' - }, - { - name: 'noteSlightAmplitude', - defaultValue: 2, - description: 'The amplitude for the note-slight vibrato in semitones.' - }, - { - name: 'noteSlightLength', - defaultValue: 480, - description: 'The wavelength of the note-slight vibrato in midi ticks.' - }, - { - name: 'noteWideAmplitude', - defaultValue: 2, - description: 'The amplitude for the note-wide vibrato in semitones.' - }, - { - name: 'noteWideLength', - defaultValue: 480, - description: 'The wavelength of the note-wide vibrato in midi ticks.' - } -]; - -export function toPascalCase(v) { - return v.substr(0, 1).toUpperCase() + v.substr(1); -} - -export function VibratoRow({setting}) { - return ( - - -
-
-
-
- - - - - - {setting.defaultValue} - - {setting.description} - - - ); -} - -export function VibratoTable() { - const settings = VibratoSettings.map(c => ); - return ( - - - - - - - - - - - {settings} - -
SettingTypeDefaultSummary
- ); -} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefault
## Description - AlphaTab supports 4 types of vibratos, for each vibrato the amplitude and the wavelength can be configured. The amplitude controls how many semitones the vibrato changes the pitch up and down while playback. The wavelength controls how many midi ticks it will take to complete one up and down vibrato. -The 4 vibrato types are: +The 4 vibrato types are: 1. Beat Slight - A fast vibrato on the whole beat. This vibrato is usually done with the whammy bar. 2. Beat Wide - A slow vibrato on the whole beat. This vibrato is usually done with the whammy bar. 3. Note Slight - A fast vibrato on a single note. This vibrato is usually done with the finger on the fretboard. 4. Note Wide - A slow vibrato on a single note. This vibrato is usually done with the finger on the fretboard. -## Vibrato Settings +## Related Types + +### `class alphaTab.VibratoPlaybackSettings` - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PropertyTypeDefaultSummary
number480The wavelength of the note-wide vibrato in midi ticks.
number2The amplitude for the note-wide vibrato in semitones.
number480The wavelength of the note-slight vibrato in midi ticks.
number2The amplitude for the note-slight vibrato in semitones.
number240The wavelength of the beat-wide vibrato in midi ticks.
number3The amplitude for the beat-wide vibrato in semitones.
number240The wavelength of the beat-slight vibrato in midi ticks.
number3The amplitude for the beat-slight vibrato in semitones.
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SettingTypeDefaultSummary
number480The wavelength of the note-wide vibrato in midi ticks.
number2The amplitude for the note-wide vibrato in semitones.
number480The wavelength of the note-slight vibrato in midi ticks.
number2The amplitude for the note-slight vibrato in semitones.
number240The wavelength of the beat-wide vibrato in midi ticks.
number3The amplitude for the beat-wide vibrato in semitones.
number240The wavelength of the beat-slight vibrato in midi ticks.
number3The amplitude for the beat-slight vibrato in semitones.
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SettingTypeDefaultSummary
double480The wavelength of the note-wide vibrato in midi ticks.
double2The amplitude for the note-wide vibrato in semitones.
double480The wavelength of the note-slight vibrato in midi ticks.
double2The amplitude for the note-slight vibrato in semitones.
double240The wavelength of the beat-wide vibrato in midi ticks.
double3The amplitude for the beat-wide vibrato in semitones.
double240The wavelength of the beat-slight vibrato in midi ticks.
double3The amplitude for the beat-slight vibrato in semitones.
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SettingTypeDefaultSummary
Double480The wavelength of the note-wide vibrato in midi ticks.
Double2The amplitude for the note-wide vibrato in semitones.
Double480The wavelength of the note-slight vibrato in midi ticks.
Double2The amplitude for the note-slight vibrato in semitones.
Double240The wavelength of the beat-wide vibrato in midi ticks.
Double3The amplitude for the beat-wide vibrato in semitones.
Double240The wavelength of the beat-slight vibrato in midi ticks.
Double3The amplitude for the beat-slight vibrato in semitones.
+
+
\ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 5bff429..57dd6ff 100644 --- a/package-lock.json +++ b/package-lock.json @@ -32,6 +32,7 @@ "copy-webpack-plugin": "^12.0.2", "docusaurus-plugin-sass": "^0.2.5", "sass": "^1.77.1", + "tsx": "^4.16.0", "typescript": "^5.4.5" }, "engines": { @@ -2877,6 +2878,374 @@ "node": ">=18.0" } }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", + "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", + "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", + "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", + "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", + "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", + "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", + "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", + "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", + "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", + "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", + "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", + "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", + "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", + "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", + "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", + "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", + "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", + "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", + "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", + "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", + "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", + "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", + "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, "node_modules/@fortawesome/fontawesome-common-types": { "version": "6.5.2", "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-6.5.2.tgz", @@ -6772,6 +7141,44 @@ "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.4.1.tgz", "integrity": "sha512-cXLGjP0c4T3flZJKQSuziYoq7MlT+rnvfZjfp7h+I7K9BNX54kP9nyWvdbwjQ4u1iWbOL4u96fgeZLToQlZC7w==" }, + "node_modules/esbuild": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", + "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.21.5", + "@esbuild/android-arm": "0.21.5", + "@esbuild/android-arm64": "0.21.5", + "@esbuild/android-x64": "0.21.5", + "@esbuild/darwin-arm64": "0.21.5", + "@esbuild/darwin-x64": "0.21.5", + "@esbuild/freebsd-arm64": "0.21.5", + "@esbuild/freebsd-x64": "0.21.5", + "@esbuild/linux-arm": "0.21.5", + "@esbuild/linux-arm64": "0.21.5", + "@esbuild/linux-ia32": "0.21.5", + "@esbuild/linux-loong64": "0.21.5", + "@esbuild/linux-mips64el": "0.21.5", + "@esbuild/linux-ppc64": "0.21.5", + "@esbuild/linux-riscv64": "0.21.5", + "@esbuild/linux-s390x": "0.21.5", + "@esbuild/linux-x64": "0.21.5", + "@esbuild/netbsd-x64": "0.21.5", + "@esbuild/openbsd-x64": "0.21.5", + "@esbuild/sunos-x64": "0.21.5", + "@esbuild/win32-arm64": "0.21.5", + "@esbuild/win32-ia32": "0.21.5", + "@esbuild/win32-x64": "0.21.5" + } + }, "node_modules/escalade": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", @@ -7641,6 +8048,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/get-tsconfig": { + "version": "4.7.5", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.5.tgz", + "integrity": "sha512-ZCuZCnlqNzjb4QprAzXKdpp/gh6KTxSJuw3IBsPnV/7fV4NxC9ckB+vPTt8w7fJA0TaSD7c55BR47JD6MEDyDw==", + "dev": true, + "dependencies": { + "resolve-pkg-maps": "^1.0.0" + }, + "funding": { + "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" + } + }, "node_modules/github-slugger": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/github-slugger/-/github-slugger-1.5.0.tgz", @@ -14527,6 +14946,15 @@ "resolved": "https://registry.npmjs.org/resolve-pathname/-/resolve-pathname-3.0.0.tgz", "integrity": "sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng==" }, + "node_modules/resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true, + "funding": { + "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" + } + }, "node_modules/responselike": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/responselike/-/responselike-3.0.0.tgz", @@ -15802,6 +16230,25 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" }, + "node_modules/tsx": { + "version": "4.16.0", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.16.0.tgz", + "integrity": "sha512-MPgN+CuY+4iKxGoJNPv+1pyo5YWZAQ5XfsyobUG+zoKG7IkvCPLZDEyoIb8yLS2FcWci1nlxAqmvPlFWD5AFiQ==", + "dev": true, + "dependencies": { + "esbuild": "~0.21.5", + "get-tsconfig": "^4.7.5" + }, + "bin": { + "tsx": "dist/cli.mjs" + }, + "engines": { + "node": ">=18.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + } + }, "node_modules/type-fest": { "version": "2.19.0", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", diff --git a/package.json b/package.json index d11f6eb..0dfce1b 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "version": "0.0.0", "private": true, "scripts": { + "jsdoc": "tsx scripts/jsdoc-to-reference.ts", "docusaurus": "docusaurus", "start": "docusaurus start", "build": "docusaurus build", @@ -39,6 +40,7 @@ "copy-webpack-plugin": "^12.0.2", "docusaurus-plugin-sass": "^0.2.5", "sass": "^1.77.1", + "tsx": "^4.16.0", "typescript": "^5.4.5" }, "browserslist": { diff --git a/scripts/jsdoc-to-reference.ts b/scripts/jsdoc-to-reference.ts new file mode 100644 index 0000000..9a32c80 --- /dev/null +++ b/scripts/jsdoc-to-reference.ts @@ -0,0 +1,162 @@ +import ts from "typescript"; +import url from "url"; +import path from "path"; +import fs from "fs"; +import { generateSettingsPages } from "./jsdoc-to-settings"; + +const __dirname = url.fileURLToPath(new URL(".", import.meta.url)); + +function reformatDocs(code: string): string { + // https://github.com/microsoft/TypeScript/issues/15749 + + code = code.replace( + /([ \t]+)\* @example[ ]+([^\r\n]+)/g, + "$1* @example\n$1* $2" + ); + + return code; +} + +function createDiagnosticReporter(pretty?: boolean): ts.DiagnosticReporter { + const host: ts.FormatDiagnosticsHost = { + getCurrentDirectory: () => ts.sys.getCurrentDirectory(), + getNewLine: () => ts.sys.newLine, + getCanonicalFileName: ts.sys.useCaseSensitiveFileNames + ? (x) => x + : (x) => x.toLowerCase(), + }; + + if (!pretty) { + return (diagnostic) => ts.sys.write(ts.formatDiagnostic(diagnostic, host)); + } + + return (diagnostic) => { + ts.sys.write( + ts.formatDiagnosticsWithColorAndContext([diagnostic], host) + + host.getNewLine() + ); + }; +} + +function handleErrors(program: ts.Program) { + let allDiagnostics: ts.Diagnostic[] = []; + allDiagnostics = program.getConfigFileParsingDiagnostics().slice(); + const syntacticDiagnostics = program.getSyntacticDiagnostics(); + if (syntacticDiagnostics.length) { + allDiagnostics.push(...syntacticDiagnostics); + } else { + allDiagnostics.push(...program.getOptionsDiagnostics()); + allDiagnostics.push(...program.getGlobalDiagnostics()); + allDiagnostics.push(...program.getSemanticDiagnostics()); + } + + program.getTypeChecker(); + + const pretty = !!ts.sys.writeOutputIsTTY?.(); + let reportDiagnostic = createDiagnosticReporter(); + if (pretty) { + reportDiagnostic = createDiagnosticReporter(true); + } + + let diagnostics = ts.sortAndDeduplicateDiagnostics(allDiagnostics); + let errorCount = 0; + let warningCount = 0; + for (const d of diagnostics) { + switch (d.category) { + case ts.DiagnosticCategory.Error: + errorCount++; + break; + case ts.DiagnosticCategory.Warning: + warningCount++; + break; + } + reportDiagnostic(d); + } + + if (pretty) { + reportDiagnostic({ + file: undefined, + start: undefined, + length: undefined, + code: 6194, + messageText: `Compilation completed with ${errorCount} errors and ${warningCount} warnings${ts.sys.newLine}`, + category: + errorCount > 0 + ? ts.DiagnosticCategory.Error + : warningCount > 0 + ? ts.DiagnosticCategory.Warning + : ts.DiagnosticCategory.Message, + }); + } + + if (errorCount > 0) { + ts.sys.exit(ts.ExitStatus.DiagnosticsPresent_OutputsGenerated); + } +} + +async function collectTypes(): Promise< + [Map, ts.Program] +> { + const dts = path.join( + __dirname, + "..", + "node_modules", + "@coderline", + "alphatab", + "dist", + "alphaTab.d.ts" + ); + + console.log(`Reading types from ${dts}`); + const dtsSource = reformatDocs(await fs.promises.readFile(dts, "utf-8")); + const reformattedFile = dts + ".reformatted.d.ts"; + + await fs.promises.writeFile(reformattedFile, dtsSource); + + const compilerOptions: ts.CompilerOptions = { + moduleResolution: ts.ModuleResolutionKind.NodeNext, + module: ts.ModuleKind.NodeNext, + target: ts.ScriptTarget.Latest, + }; + + const program = ts.createProgram({ + rootNames: [reformattedFile], + options: compilerOptions, + host: ts.createCompilerHost(compilerOptions, true), + }); + + program.getTypeChecker(); + + const ast = program.getSourceFile(reformattedFile); + + handleErrors(program); + + const declarations = new Map(); + + for (const stmt of ast.statements) { + switch (stmt.kind) { + case ts.SyntaxKind.ClassDeclaration: + case ts.SyntaxKind.EnumDeclaration: + case ts.SyntaxKind.InterfaceDeclaration: + case ts.SyntaxKind.TypeAliasDeclaration: + const declaration = stmt as ts.DeclarationStatement; + if (declarations.has(declaration.name.text)) { + console.warn("Duplicate declaration of ", declaration.name.text); + } + declarations.set(declaration.name.text, declaration); + break; + } + } + + console.log(`${declarations.size} types loaded`); + + return [declarations, program]; +} + +async function run() { + const [declarations, program] = await collectTypes(); + + await generateSettingsPages(program, declarations); +} + +run(); diff --git a/scripts/jsdoc-to-settings.ts b/scripts/jsdoc-to-settings.ts new file mode 100644 index 0000000..37784b0 --- /dev/null +++ b/scripts/jsdoc-to-settings.ts @@ -0,0 +1,993 @@ +import ts from "typescript"; +import url from "url"; +import path from "path"; +import fs from "fs"; +import { EOL } from "node:os"; +import { buildNames, toCamelCase, toPascalCase } from "@site/src/names"; + +const __dirname = url.fileURLToPath(new URL(".", import.meta.url)); + +type Category = { + type: string; + settingsProperty: string; + category: string; + jsOnParent: boolean; +}; + +type JSDocText = ts.JSDoc["comment"]; + +type ParsedExample = { + label: string; + key: string; + text: string; +}; + +type ParsedJSDoc = { + text: JSDocText; + summary?: JSDocText; + default?: string; + since?: string; + webOnly: boolean; + examples?: ParsedExample[]; +}; + +function parseExample(text: JSDocText): ParsedExample { + const markdown = jsDocToMarkdown(text); + + const firstLineEnd = markdown.indexOf("\n"); + if (firstLineEnd === -1) { + return { label: "General", key: "general", text: markdown }; + } + + const marker = markdown.substring(0, firstLineEnd).trim(); + const code = markdown.substring(firstLineEnd + 1); + switch (marker) { + case "web": + return { label: "JavaScript", key: marker, text: code }; + case "html": + return { label: "HTML", key: marker, text: code }; + case "jquery": + return { label: "jQuery", key: marker, text: code }; + case "net": + return { label: "C#", key: marker, text: code }; + case "android": + return { label: "Kotlin (Android)", key: marker, text: code }; + default: + return { label: "General", key: "general", text: code }; + } +} + +function parseJsDoc(doc: ts.JSDoc): ParsedJSDoc { + const parsed: ParsedJSDoc = { + text: "", + webOnly: false, + }; + + if (doc.comment !== undefined) { + parsed.text = doc.comment; + } + + if (doc.tags) { + for (const tag of doc.tags) { + switch (tag.tagName.text) { + case "summary": + parsed.summary = tag.comment; + break; + case "default": + parsed.default = tag.comment as string; + break; + case "since": + parsed.since = tag.comment as string; + break; + case "target": + if (tag.comment === "web") { + parsed.webOnly = true; + } + break; + case "example": + if (tag.comment) { + parsed.examples ??= []; + parsed.examples.push(parseExample(tag.comment)); + } + + break; + } + } + } + + return parsed; +} + +function jsDocIdentifierToText( + identifier: ts.JSDocMemberName | ts.EntityName +): string { + switch (identifier.kind) { + case ts.SyntaxKind.JSDocMemberName: + return ( + jsDocIdentifierToText(identifier.left) + + "." + + jsDocIdentifierToText(identifier.right) + ); + case ts.SyntaxKind.Identifier: + return identifier.text; + case ts.SyntaxKind.QualifiedName: + return ( + jsDocIdentifierToText(identifier.left) + + "." + + jsDocIdentifierToText(identifier.right) + ); + } +} + +function transformRawJsDocText(str: string): string { + str = str.replace(/\{@([^ \}]+)([^\}]+)\}/g, (match, tag, value) => { + switch (tag) { + case "since": + return `Since ${value}`; + } + console.warn("Unknown JSDoc inline tag " + tag + " -> " + match); + return "`" + match + "`"; + }); + + + + str = str.replaceAll("https://alphatab.net/", "/"); + + return str; +} + +function jsDocToMarkdown(textOrNode?: JSDocText | ts.Node): string | undefined { + if (textOrNode === undefined) { + return undefined; + } + + if (typeof textOrNode === "string") { + return transformRawJsDocText(textOrNode); + } + + if ("kind" in textOrNode) { + const jsDoc = ts + .getJSDocCommentsAndTags(textOrNode) + .find((o) => ts.isJSDoc(o)) as ts.JSDoc; + if (!jsDoc) { + return undefined; + } + return jsDocToMarkdown( + jsDoc.tags?.find((t) => t.tagName.text === "summary")?.comment ?? + jsDoc.comment + ); + } + + let fullText = ""; + + for (const t of textOrNode) { + switch (t.kind) { + case ts.SyntaxKind.JSDocText: + fullText += transformRawJsDocText((t as ts.JSDocText).text); + break; + case ts.SyntaxKind.JSDocLink: + const link = t as ts.JSDocLink; + if (link.name) { + fullText += "`" + jsDocIdentifierToText(link.name) + "`"; + } else { + fullText += "`" + link.text + "`"; + } + break; + case ts.SyntaxKind.JSDocLinkCode: + break; + case ts.SyntaxKind.JSDocLinkPlain: + break; + } + } + + return fullText; +} + +function generateSettingsPageFrontMatter( + category: Category, + prop: ts.PropertyDeclaration, + doc: ParsedJSDoc +): string[] { + const lines: string[] = []; + + lines.push("---"); + lines.push(`title: ${category.settingsProperty}.${prop.name.getText()}`); + + const description = + jsDocToMarkdown(doc.summary) ?? + jsDocToMarkdown(doc.text)?.split("\n")[0] ?? + ""; + if (description) { + lines.push(`description: ${description}`); + } + + lines.push("sidebar_custom_props:"); + + if (doc.webOnly) { + lines.push(" javaScriptOnly: true"); + } + + if (category.jsOnParent) { + lines.push(" jsOnParent: true"); + } + + let categoryTitle = category.category; + if (doc.webOnly) { + categoryTitle += " - JavaScript Specific"; + } + lines.push(` category: ${categoryTitle}`); + + if (doc.since) { + lines.push(` since: ${doc.since}`); + } + + lines.push("---"); + + return lines; +} + +function generateSettingsPageDescription( + category: Category, + prop: ts.PropertyDeclaration, + doc: ParsedJSDoc +): string[] { + const lines: string[] = []; + + lines.push("import Tabs from '@theme/Tabs';"); + lines.push("import TabItem from '@theme/TabItem';"); + lines.push(`import { SinceBadge } from '@site/src/components/SinceBadge';`); + lines.push(`import { CodeBadge } from '@site/src/components/CodeBadge';`); + lines.push( + `import { PropertyDescription } from '@site/src/components/PropertyDescription';` + ); + lines.push( + `import { TypeTable, TypeRow } from '@site/src/components/TypeTable';` + ); + lines.push(""); + + if (doc.since) { + lines.push(``); + lines.push(""); + } + + lines.push( + '' + ); + lines.push(" "); + lines.push(" "); + lines.push(" "); + lines.push(" "); + lines.push(" "); + lines.push(" "); + lines.push(" "); + lines.push(" "); + + const jsName = prop.name.getText(); + const jsType = prop.type.getText(); + + const jsDefaultValue = `${doc.default ?? ''}`; + const doubleQuoteDefaultValue = `${doc.default?.replaceAll("'", '"') ?? ''}`; + + lines.push(" "); + lines.push( + ` ` + ); + lines.push( + ` ` + ); + lines.push(` `); + lines.push(" "); + + if (category.jsOnParent) { + lines.push(" "); + lines.push( + ` ` + ); + lines.push( + ` ` + ); + lines.push(` `); + lines.push(" "); + } + + lines.push(" "); + lines.push( + ` ` + ); + lines.push( + ` ` + ); + lines.push(` `); + lines.push(" "); + + if (category.jsOnParent) { + lines.push(" "); + lines.push( + ` ` + ); + lines.push( + ` ` + ); + lines.push(` `); + lines.push(" "); + } + + if (!doc.webOnly) { + lines.push(" "); + lines.push( + ` ` + ); + lines.push( + ` ` + ); + lines.push(` `); + lines.push(" "); + + lines.push(" "); + lines.push( + ` ` + ); + lines.push( + ` ` + ); + lines.push(` `); + lines.push(" "); + } + + lines.push(" "); + lines.push("
NameTypeDefault
${jsDefaultValue}
${jsDefaultValue}
${doubleQuoteDefaultValue}
${doubleQuoteDefaultValue}
${doubleQuoteDefaultValue}
${doubleQuoteDefaultValue}
"); + lines.push(""); + + lines.push("## Description"); + lines.push(jsDocToMarkdown(doc.text)); + lines.push(""); + + return lines; +} + +function translateToDotNetType( + type: ts.TypeNode | ts.EntityName, + propertyOptional: boolean +): string { + if (propertyOptional) { + return translateToDotNetType(type, false) + "?"; + } + + if (ts.isIdentifier(type)) { + return toPascalCase(type.text); + } else if (ts.isQualifiedName(type)) { + return ( + translateToDotNetType(type.left, false) + + "." + + translateToDotNetType(type.right, false) + ); + } else if (ts.isTypeReferenceNode(type)) { + const name = translateToDotNetType(type.typeName, false); + if (!type.typeArguments || type.typeArguments.length === 0) { + return name; + } + + return ( + name + + "<" + + type.typeArguments + .map((a) => translateToDotNetType(a, false)) + .join(", ") + + ">" + ); + } else if (ts.isArrayTypeNode(type)) { + return `IList<${translateToDotNetType(type.elementType, false)}>`; + } else { + switch (type.kind) { + case ts.SyntaxKind.NumberKeyword: + return "double"; + case ts.SyntaxKind.StringKeyword: + return "string"; + case ts.SyntaxKind.BooleanKeyword: + return "bool"; + default: + throw new Error( + `Type node ${ + ts.SyntaxKind[type.kind] + } is unsupproted for translation, extend doc generator` + ); + } + } +} + +function translateToKotlinType(type: ts.TypeNode, propertyOptional: boolean) { + if (propertyOptional) { + return translateToDotNetType(type, false) + "?"; + } + + if (ts.isIdentifier(type)) { + return toPascalCase(type.text); + } else if (ts.isQualifiedName(type)) { + return ( + translateToDotNetType(type.left, false) + + "." + + translateToDotNetType(type.right, false) + ); + } else if (ts.isTypeReferenceNode(type)) { + const name = translateToDotNetType(type.typeName, false); + if (!type.typeArguments || type.typeArguments.length === 0) { + return name; + } + + return ( + name + + "<" + + type.typeArguments + .map((a) => translateToDotNetType(a, false)) + .join(", ") + + ">" + ); + } else if (ts.isArrayTypeNode(type)) { + const elementType = translateToDotNetType(type.elementType, false); + + if (elementType === "Boolean") { + return "alphaTab.collections.BooleanList"; + } else if (elementType === "Double") { + return "alphaTab.collections.DoubleList"; + } else { + return "alphaTab.collections.List<" + elementType + ">"; + } + } else { + switch (type.kind) { + case ts.SyntaxKind.NumberKeyword: + return "Double"; + case ts.SyntaxKind.StringKeyword: + return "String"; + case ts.SyntaxKind.BooleanKeyword: + return "Boolean"; + default: + throw new Error( + `Type node ${ + ts.SyntaxKind[type.kind] + } is unsupproted for translation, extend doc generator` + ); + break; + } + } +} + +function unwrapNullableType(type: ts.TypeNode): ts.TypeNode { + if (ts.isUnionTypeNode(type)) { + let wrappedType: ts.TypeNode | null = null; + + for (const t of type.types) { + // nullable markers + if ( + t.kind === ts.SyntaxKind.NullKeyword || + t.kind === ts.SyntaxKind.UndefinedKeyword + ) { + continue; + } else { + if (wrappedType == null) { + wrappedType = t; + } else { + return type; // real union type, return as is + } + } + } + + return wrappedType; + } + + return type; +} + +function generateTypeDocs( + ctx: SettingsGenContext, + type: ts.TypeNode | undefined +): string[] { + const lines: string[] = []; + + if (type) { + const notNullable = unwrapNullableType(type); + + if (ts.isTypeReferenceNode(notNullable)) { + const identifier = jsDocIdentifierToText(notNullable.typeName); + const referencedType = ctx.declarations.get(identifier); + + const displayName = ctx.exportNameLookup.get(identifier) ?? identifier; + + if (referencedType) { + switch (referencedType.kind) { + case ts.SyntaxKind.EnumDeclaration: + const enumMembers = (referencedType as ts.EnumDeclaration).members; + const docs = new Map( + enumMembers.map((m) => [m.name.getText(), jsDocToMarkdown(m)]) + ); + + lines.push(`### \`enum ${displayName}\``); + lines.push(""); + + lines.push(``); + + lines.push(``); + + lines.push(`\`import * as alphaTab from '@coderline/alphaTab';\``); + lines.push(``); + + for (const enumValue of enumMembers) { + lines.push( + `* \`${displayName}.${enumValue.name.getText()}\` - ${docs.get( + enumValue.name.getText() + )}` + ); + } + + lines.push(``); + + lines.push(``); + + for (const enumValue of enumMembers) { + lines.push( + `* \`"${enumValue.name.getText()}"\` - ${docs.get( + enumValue.name.getText() + )}` + ); + } + + lines.push(``); + + lines.push(``); + + for (const enumValue of enumMembers) { + lines.push( + `* \`${toPascalCase( + displayName + "." + enumValue.name.getText() + )}\` - ${docs.get(enumValue.name.getText())}` + ); + } + + lines.push(``); + + lines.push(``); + + for (const enumValue of enumMembers) { + lines.push( + `* \`${toCamelCase( + displayName + "." + enumValue.name.getText() + )}\` - ${docs.get(enumValue.name.getText())}` + ); + } + + lines.push(``); + + lines.push(""); + + break; + + case ts.SyntaxKind.ClassDeclaration: + const clz = referencedType as ts.ClassDeclaration; + + lines.push(`### \`class ${displayName}\``); + lines.push(""); + + lines.push(``); + + lines.push(``); + lines.push( + `` + ); + lines.push(` `); + lines.push(` `); + lines.push(` `); + lines.push(` `); + lines.push(` `); + lines.push(` `); + lines.push(` `); + lines.push(` `); + lines.push(` `); + + for (const prop of clz.members.filter(isMemberProperty)) { + lines.push(` `); + lines.push( + ` ` + ); + lines.push( + ` ` + ); + lines.push( + ` ` + ); + lines.push(` `); + lines.push(` `); + } + + lines.push(` `); + lines.push(`
PropertyTypeDefaultSummary
${prop.type.getText()}${getDefaultValue(prop)}${jsDocToMarkdown(prop)}
`); + lines.push(`
`); + + lines.push(``); + lines.push( + `` + ); + lines.push(` `); + lines.push(` `); + lines.push(` `); + lines.push(` `); + lines.push(` `); + lines.push(` `); + lines.push(` `); + lines.push(` `); + lines.push(` `); + + for (const prop of clz.members.filter(isMemberProperty)) { + lines.push(` `); + lines.push( + ` ` + ); + lines.push( + ` ` + ); + lines.push( + ` ` + ); + lines.push(` `); + lines.push(` `); + } + + lines.push(` `); + lines.push(`
SettingTypeDefaultSummary
${prop.type.getText()}${getDefaultValue(prop)}${jsDocToMarkdown(prop)}
`); + lines.push(`
`); + + lines.push(``); + lines.push( + `` + ); + lines.push(` `); + lines.push(` `); + lines.push(` `); + lines.push(` `); + lines.push(` `); + lines.push(` `); + lines.push(` `); + lines.push(` `); + lines.push(` `); + + for (const prop of clz.members.filter(isMemberProperty)) { + lines.push(` `); + lines.push( + ` ` + ); + lines.push( + ` ` + ); + lines.push( + ` ` + ); + lines.push(` `); + lines.push(` `); + } + + lines.push(` `); + lines.push(`
SettingTypeDefaultSummary
${translateToDotNetType( + prop.type, + prop.questionToken !== undefined + )}${getDefaultValue(prop)}${jsDocToMarkdown(prop)}
`); + lines.push(`
`); + + lines.push(``); + lines.push( + `` + ); + lines.push(` `); + lines.push(` `); + lines.push(` `); + lines.push(` `); + lines.push(` `); + lines.push(` `); + lines.push(` `); + lines.push(` `); + lines.push(` `); + + for (const prop of clz.members.filter(isMemberProperty)) { + lines.push(` `); + lines.push( + ` ` + ); + lines.push( + ` ` + ); + lines.push( + ` ` + ); + lines.push(` `); + lines.push(` `); + } + + lines.push(` `); + lines.push(`
SettingTypeDefaultSummary
${translateToKotlinType( + prop.type, + prop.questionToken !== undefined + )}${getDefaultValue(prop)}${jsDocToMarkdown(prop)}
`); + lines.push(`
`); + + lines.push("
"); + break; + } + } + } + } + + return lines; +} + +function generateSettingsPageTypes( + ctx: SettingsGenContext, + prop: ts.PropertyDeclaration, + doc: ParsedJSDoc +): string[] { + const lines: string[] = []; + + const typeDocs = generateTypeDocs(ctx, prop.type); + + if (typeDocs.length > 0) { + lines.push("## Related Types"); + lines.push(""); + lines.push(...typeDocs); + } + + return lines; +} + +function generateSettingsPageExamples(doc: ParsedJSDoc): string[] { + const lines: string[] = []; + + if (doc.examples && doc.examples.length > 0) { + lines.push("## Examples"); + lines.push(""); + + const defaultValue = doc.examples[0].key; + const tabValues = doc.examples.map((e) => ({ + label: e.label, + value: e.key, + })); + + lines.push( + `` + ); + + for (const example of doc.examples) { + lines.push(``); + lines.push(""); + lines.push(example.text); + lines.push(""); + lines.push(``); + } + + lines.push(""); + } + + return lines; +} + +async function generateSettingsPage( + ctx: SettingsGenContext, + folder: string, + category: Category, + prop: ts.PropertyDeclaration, + doc: ParsedJSDoc +) { + const fileName = path.join( + folder, + prop.name.getText().toLowerCase() + ".mdx" + ); + + const lines: string[] = [ + ...generateSettingsPageFrontMatter(category, prop, doc), + ...generateSettingsPageDescription(category, prop, doc), + ...generateSettingsPageTypes(ctx, prop, doc), + ...generateSettingsPageExamples(doc), + ]; + + await fs.promises.writeFile(fileName, lines.join(EOL)); +} + +interface SettingsGenContext { + program: ts.Program; + declarationFile: ts.SourceFile; + declarations: Map; + exportNameLookup: Map; + checker: ts.TypeChecker; +} + +function walkSymbolExports( + ctx: SettingsGenContext, + prefix: string, + symbol: ts.Symbol +) { + if (symbol.exports) { + for (const [k, v] of symbol.exports) { + const name = k.toString(); + + // direct exports + if (ctx.declarations.has(name)) { + ctx.exportNameLookup.set(name, prefix + name); + } else { + // declare namespace index_d$3 { + // export { index_d$3_AlphaSynthMidiFileHandler as AlphaSynthMidiFileHandler, index_d$3_AlphaTabMetronomeEvent as AlphaTabMetronomeEvent, index_d$3_AlphaTabRestEvent as AlphaTabRestEvent, index_d$3_BeatTickLookup as BeatTickLookup, index_d$3_ControlChangeEvent as ControlChangeEvent, index_d$3_ControllerType as ControllerType, index_d$3_EndOfTrackEvent as EndOfTrackEvent, index_d$3_MasterBarTickLookup as MasterBarTickLookup, index_d$3_MidiEvent as MidiEvent, index_d$3_MidiEventType as MidiEventType, index_d$3_MidiFile as MidiFile, index_d$3_MidiFileFormat as MidiFileFormat, index_d$3_MidiFileGenerator as MidiFileGenerator, index_d$3_MidiTickLookup as MidiTickLookup, index_d$3_MidiTickLookupFindBeatResult as MidiTickLookupFindBeatResult, index_d$3_NoteBendEvent as NoteBendEvent, index_d$3_NoteEvent as NoteEvent, index_d$3_NoteOffEvent as NoteOffEvent, index_d$3_NoteOnEvent as NoteOnEvent, index_d$3_PitchBendEvent as PitchBendEvent, index_d$3_ProgramChangeEvent as ProgramChangeEvent, index_d$3_TempoChangeEvent as TempoChangeEvent, index_d$3_TimeSignatureEvent as TimeSignatureEvent }; + // } + + // export { index_d$1 as platform } + if (v.declarations) { + for (const declaration of v.declarations) { + if (ts.isExportSpecifier(declaration) && declaration.propertyName) { + // resolve namespace + const symbol = ctx.checker.getSymbolAtLocation( + declaration.propertyName + ); + if (symbol) { + walkSymbolExports( + ctx, + prefix + declaration.name.text + ".", + symbol + ); + } + } + } + } + } + } + } +} + +function fillExportNameLookup(ctx: SettingsGenContext) { + const symbol = ctx.checker.getSymbolAtLocation(ctx.declarationFile); + const prefix = "alphaTab."; + walkSymbolExports(ctx, prefix, symbol); +} + +export async function generateSettingsPages( + program: ts.Program, + declarations: Map +) { + const checker = program.getTypeChecker(); + const declarationFile = program.getSourceFile(program.getRootFileNames()[0]); + + const context: SettingsGenContext = { + program, + declarationFile, + declarations, + exportNameLookup: new Map(), + checker, + }; + fillExportNameLookup(context); + + const categories: Category[] = [ + { + type: "CoreSettings", + settingsProperty: "core", + category: "Core", + jsOnParent: true, + }, + { + type: "DisplaySettings", + settingsProperty: "display", + category: "Display", + jsOnParent: false, + }, + { + type: "ImporterSettings", + settingsProperty: "importer", + category: "Importer", + jsOnParent: false, + }, + { + type: "NotationSettings", + settingsProperty: "notation", + category: "Notation", + jsOnParent: false, + }, + { + type: "PlayerSettings", + settingsProperty: "player", + category: "Player", + jsOnParent: false, + }, + ]; + + for (const category of categories) { + const folder = path.join( + __dirname, + "..", + "docs", + "reference", + "settings", + category.settingsProperty + ); + + const type = declarations.get(category.type) as ts.ClassDeclaration; + if (!type) { + throw new Error(`Could not find declaration ${category.type}`); + } + + await fs.promises.rm(folder, { recursive: true, force: true }); + await fs.promises.mkdir(folder, { recursive: true }); + + for (const prop of type.members) { + if (isMemberProperty(prop)) { + const jsDoc = ts + .getJSDocCommentsAndTags(prop) + .find((d) => ts.isJSDoc(d)); + if (jsDoc) { + await generateSettingsPage( + context, + folder, + category, + prop, + parseJsDoc(jsDoc as ts.JSDoc) + ); + } else { + console.warn( + `Skipping ${ + category.settingsProperty + }.${prop.name?.getText()}, no jsdoc found` + ); + } + } + } + } +} +function isMemberProperty( + prop: ts.ClassElement +): prop is ts.PropertyDeclaration { + return ( + ts.isPropertyDeclaration(prop) && + (!prop.modifiers || + !prop.modifiers.find((m) => m.kind === ts.SyntaxKind.StaticKeyword)) + ); +} + +function getDefaultValue(prop: ts.PropertyDeclaration) { + const jsDoc = ts + .getJSDocCommentsAndTags(prop) + .find((o) => ts.isJSDoc(o)) as ts.JSDoc; + if (!jsDoc) { + return ""; + } + return jsDocToMarkdown( + jsDoc.tags?.find((t) => t.tagName.text === "default")?.comment ?? "" + ); +} diff --git a/src/components/EventDescription/index.tsx b/src/components/EventDescription/index.tsx index 59d01b0..be2838f 100644 --- a/src/components/EventDescription/index.tsx +++ b/src/components/EventDescription/index.tsx @@ -18,7 +18,7 @@ export class EventDescription extends React.Component { public render() { const page = new Page(this.props.metadata, this.props.doc); - const { jsNames, csNames, jQueryNames, domNames, androidNames } = buildNames(page); + const { jsNames, csNames, jQueryNames, androidNames } = buildNames(page); return ( @@ -33,11 +33,6 @@ export class EventDescription extends React.Component { ))} - {domNames.map((name, index) => ( - - - - ))} {csNames.map((name, index) => ( diff --git a/src/components/PropertyDescription/index.tsx b/src/components/PropertyDescription/index.tsx index 0b75e3c..255a9c5 100644 --- a/src/components/PropertyDescription/index.tsx +++ b/src/components/PropertyDescription/index.tsx @@ -16,7 +16,7 @@ export class PropertyDescription extends React.Component @@ -36,11 +36,6 @@ export class PropertyDescription extends React.Component ))} - {domNames.map(n => ( - - - - ))} {csNames.map(n => ( diff --git a/src/components/ReferenceTable/index.tsx b/src/components/ReferenceTable/index.tsx index 78e9275..fd34526 100644 --- a/src/components/ReferenceTable/index.tsx +++ b/src/components/ReferenceTable/index.tsx @@ -17,7 +17,7 @@ function buildPropertyUrl(property: Page) { class ReferenceRow extends React.Component<{ property: Page, showJson: boolean }> { public render() { - const { jsNames, csNames, jQueryNames, domNames, androidNames } = buildNames(this.props.property); + const { jsNames, csNames, jQueryNames, androidNames } = buildNames(this.props.property); const jsonNames = this.props.showJson ? jsNames : []; return ( @@ -31,9 +31,6 @@ class ReferenceRow extends React.Component<{ property: Page, showJson: boolean } {(jsonNames.length > 0 || jsonNames.length > 0) && jQueryNames.length > 0 &&
} {jQueryNames.map(n => ())} - {domNames.length > 0 &&
} - {domNames.map(n => ())} - {csNames.length > 0 &&
} {csNames.map(n => ())} diff --git a/src/names.ts b/src/names.ts index 675f18f..390bcda 100644 --- a/src/names.ts +++ b/src/names.ts @@ -65,7 +65,6 @@ export function tojQueryPropertyNames(jsNames: string[]) { export function buildNames(property: Page) { const javaScriptOnly = property.prop("javaScriptOnly", false); const jQueryOnly = property.prop("jQueryOnly", false); - const domWildcard = property.prop("domWildcard", false); const category = property.prop("category", ""); let jsNames = jQueryOnly ? [] : property.props("title"); @@ -97,19 +96,6 @@ export function buildNames(property: Page) { } } - let domNames = property.props("domName"); - if (property.prop("dom", true) && domNames.length === 0) { - if (category.startsWith("Events")) { - domNames = toDomEventNames(jsNames); - } else if (category.startsWith("Methods")) { - // no DOM method names on API - } else if (category.startsWith("Properties")) { - // no DOM properties on API - } else { - domNames = toDomSettingNames(jsNames, domWildcard); - } - } - if (category.startsWith("Methods")) { jsNames = jsNames.map((v) => `${v}()`); csNames = csNames.map((v) => `${v}()`); @@ -120,7 +106,6 @@ export function buildNames(property: Page) { jsNames, csNames, jQueryNames, - domNames, androidNames }; } diff --git a/tsconfig.json b/tsconfig.json index 314eab8..1403db0 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,6 +2,8 @@ // This file is not used in compilation. It is here just for a nice editor experience. "extends": "@docusaurus/tsconfig", "compilerOptions": { + "lib": ["DOM", "ES2021"], + "downlevelIteration": true, "baseUrl": "." } }