Special tracks
Not every track is a six-string guitar. alphaTab detects drum kits, percussion staves, keyboards, and alternate tunings and renders each with the convention its instrument expects.
Drum notationโ
Drum tracks are the five-line staves that show a kit part with piece-specific noteheads โ x-heads for cymbals, normal heads for toms, slashed heads for the snare โ so a drummer can identify each piece without a legend. alphaTab hides the tab staff on drum tracks because it carries no useful information.
Percussion multi-line stavesโ
Percussion tracks other than the full kit render on staves with one, two, three, or five lines, matching the number of distinct pitches the part uses โ the single-line staff for a shaker, the five-line staff for a mallet part. Each line maps to a percussion instrument defined in the source file.
Piano grand staffโ
Piano tracks render as a grand staff โ treble clef above, bass clef below, joined by a brace. The brace is the curly SMuFL glyph that ties the two hands into a single instrument. Voices split across the two staves as the source file specifies.
Unusual tunings and multi-track tuning displayโ
Alternate tunings โ drop D on a rock rhythm guitar, DADGAD on a Celtic fingerstyle line, open G on a slide part, or seven- and eight-string layouts on metal charts โ render with the string pitches listed above the first system. Every track shows its own tuning, so a multi-track score with mixed tunings stays legible.
Show it in codeโ
The instrument-specific rendering is automatic โ alphaTab reads the track's channel and staff configuration from the source file. To hide the tuning label above a stringed track, flip the GuitarTuning element off:
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.GuitarTuning, false],
]),
},
});
getAlphaTabContainer() is a placeholder for the platform-specific render target.
Where to look nextโ
- Drum and percussion notation โ deeper coverage of the drum staff itself.
- Multi-track and grand staff โ how alphaTab lays out several tracks together.
- Tuning display โ the stylesheet knobs that control where the tuning label lives.
- Bracket extend mode โ how the accolade groups mixed-instrument tracks.
- Toggling notation elements off โ hide any category globally.
notation.elementsโ the settings entry point for the element map.NotationElementโ the enumeration of togglable elements.