Skip to main content

core.includeNoteBounds

since 0.9.6
core.includeNoteBoundsJavaScriptincludeNoteBoundsJavaScriptcore.includeNoteBoundsJSONincludeNoteBoundsJSONCore.IncludeNoteBounds.netcore.includeNoteBoundsAndroid

Description​

Whether in the BoundsLookup also the position and area of each individual note is provided. 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.

includeNoteBounds: boolean = false;

Example - JavaScript​

const settings = new alphaTab.model.Settings();
settings.core.includeNoteBounds = true;
const api = new alphaTab.AlphaTabApi(document.querySelector('#alphaTab'), settings);
api.renderFinished.on(() => {
const lookup = api.renderer.boundsLookup;
const x = 100;
const y = 100;
const beat = lookup.getBeatAtPos(x, y);
const note = lookup.getNoteAtPos(beat, x, y);
});