Toggling notation elements off
alphaTab draws every notation category by default. The notation.elements map lets you flip individual categories off โ score title, tuning, bar numbers, palm-mute brackets, whammy annotations, lyrics, or any of the other entries in the NotationElement enumeration. Reach for it when a chart needs a compact printout, when your renderer already provides its own title bar, or when an editor UI needs to preview one element at a time.
Flip a checkbox to remove that category from the score. Each toggle maps to one NotationElement key on the notation.elements map.
What you can toggleโ
Every enum entry maps to one rendered piece of the score. The categories fall into four groups:
- Score info โ
ScoreTitle,ScoreSubTitle,ScoreArtist,ScoreAlbum,ScoreWords,ScoreMusic,ScoreWordsAndMusic,ScoreCopyright. - Track chrome โ
TrackNames,GuitarTuning,BarNumber,ChordDiagrams,ChordDiagramFretboardNumbers,RepeatCount. - Effect bands โ
EffectAlternateEndings,EffectChordNames,EffectDynamics,EffectFermata,EffectFingering,EffectHarmonics,EffectLetRing,EffectLyrics,EffectMarker,EffectOttavia,EffectPalmMute,EffectPickSlide,EffectPickStroke,EffectSlightBeatVibrato,EffectSlightNoteVibrato,EffectTap,EffectTempo,EffectText,EffectTrill,EffectTripletFeel,EffectWhammyBar,EffectWideBeatVibrato,EffectWideNoteVibrato,EffectLeftHandTap,EffectFreeTime,EffectSustainPedal,EffectGolpe,EffectWahPedal,EffectBeatBarre,EffectNoteOrnament,EffectRasgueado,EffectDirections,EffectBeatTimer,EffectCapo,EffectCrescendo,EffectFadeIn. - Notation glyphs โ
ScoreBendSlur,EffectWhammyBarLine,EffectNumberedNotationKeySignature,EffectHammerOnPullOffText,EffectSlideText,ParenthesisOnTiedBends,TabNotesOnTiedBends,ZerosOnDiveWhammys.
ZerosOnDiveWhammys is off by default; every other entry is on by default.
Show it in codeโ
Pass a Map (JavaScript / TypeScript) or a dictionary (JSON, .NET, Kotlin) keyed by the enum. Values are booleans:
import * as alphaTab from '@coderline/alphatab';
const container = getAlphaTabContainer();
const api = new alphaTab.AlphaTabApi(container, {
core: { file: '/scores/song.gp' },
notation: {
elements: new Map([
[alphaTab.NotationElement.EffectWhammyBar, false],
[alphaTab.NotationElement.BarNumber, false],
[alphaTab.NotationElement.TrackNames, false],
]),
},
});
getAlphaTabContainer() is a placeholder for the platform-specific render target โ a <div> on Web, an AlphaTab control on .NET, or an AlphaTabView on Android.
For JSON input, use the camelCase enum name as the key:
{
"notation": {
"elements": {
"effectWhammyBar": false,
"barNumber": false
}
}
}
To flip an entry at runtime, mutate the map on api.settings.notation.elements and call api.render():
api.settings.notation.elements.set(alphaTab.NotationElement.EffectLyrics, false);
api.render();
Where to look nextโ
- Staff element display โ control clefs, key and time signatures, bar numbers and tab rests per staff type, staff or bar instead of score-wide.
NotationElementโ the full enumeration with every value.notation.elementsโ the setting reference.- Effects and articulations โ the effect bands you can flip individually.
- Dynamics, hairpins, and accents โ hide dynamics with the granular
EffectDynamicstoggle, or use the stylesheet-widehideDynamicsshortcut. - Hiding dynamics โ the score-wide stylesheet shortcut for the dynamics category.
updateSettingsandrenderโ the API surface used when flipping toggles after load.