Dynamics, hairpins, and accents
Dynamics tell the reader how loud each passage is and how the volume changes over time. alphaTab renders the standard set โ from ppp to fff, plus hairpins and per-note accents โ below the notation staff.
Static dynamicsโ
Dynamic markings โ ppp, pp, p, mp, mf, f, ff, fff โ are the italic Italian labels a composer uses to fix a passage's loudness. alphaTab renders them in the dynamics font below the staff at the beat where the volume changes.
Crescendo and decrescendo hairpinsโ
Crescendo (<) and decrescendo (>) hairpins draw the "grow louder" and "grow softer" contour between two dynamic marks โ the standard way to score a swell or a fade. alphaTab renders each hairpin below the staff, spanning every beat between its start and end.
Accentsโ
Single-note accents mark one note as louder or longer than its neighbours โ the sudden punch on a syncopated beat, the tenuto sustain on a legato line. alphaTab renders them as marks above or below the notehead and supports three levels: normal accent (>), heavy accent (^), and tenuto (โ).
Show it in codeโ
Dynamics are score-wide visible by default. To hide them โ a common request for print layouts โ set the stylesheet policy on the score model in a scoreLoaded handler:
import * as alphaTab from '@coderline/alphatab';
const container = getAlphaTabContainer();
const api = new alphaTab.AlphaTabApi(container, {
core: { file: '/scores/song.gp' },
});
api.scoreLoaded.on((score) => {
score.stylesheet.hideDynamics = true;
api.render();
});
getAlphaTabContainer() is a placeholder for the platform-specific render target โ a <div> on Web, an AlphaTab control on .NET, or an AlphaTabView on Android.
Where to look nextโ
- Hiding dynamics โ the score-wide toggle in detail, with a live checkbox.
- Toggling notation elements off โ hide accents or hairpins independently via
notation.elements. hideDynamicson theRenderStylesheetreference.notation.elementsandNotationElementโ the map and enum, includingEffectDynamicsandEffectCrescendo.