Skip to main content

Hiding dynamics

Hide every dynamics marking โ€” ppp through fff and the crescendo / decrescendo hairpins โ€” with a single stylesheet flag. Reach for it when you are generating a chord chart for a rhythm section where the dynamics are noise, a beginner-friendly view of a lesson score, or a print handout that leaves interpretation to the teacher.

What the flag doesโ€‹

score.stylesheet.hideDynamics is a score-wide boolean. When true, the renderer skips every dynamics glyph and hairpin during layout. Notes, rests, and articulations stay put; only the volume script disappears. The change is visual โ€” playback still honors the underlying velocity data.

The flag lives on the stylesheet, so it belongs to the loaded Score, not to Settings. Set it after the score is parsed, then call api.render() to redraw.

Show it in codeโ€‹

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 step of obtaining the render target โ€” a <div> on Web, an AlphaTab control on .NET, or an AlphaTabView on Android. Every other line runs unchanged on all three runtimes.

Where to look nextโ€‹