MusicXML
Interop with Sibelius, Finale, Dorico, MuseScore, and every other notation editor is what MusicXML exists for. alphaTab imports it with mature coverage of notation, playback, and layout hints โ so a .musicxml file from any of those tools opens in the same viewer as your Guitar Pro sources.
Point core.file at a .musicxml file and it just loads โ same one-line setup as a Guitar Pro source. The preview below reads Mozart's Twinkle theme (K.265, PD) as a piano grand staff.
What alphaTab reads from a MusicXML fileโ
MusicXML lets any tool encode the same music in multiple ways, so the importer is intentionally permissive. It walks both the visual and the sound branches of the file and populates the alphaTab model from whichever the file supplies.
- Notes, rests, ties, and voices โ full support, including tied-note chains across bars and multi-voice parts. Tie handling was expanded in the 1.3 series.
- Chord diagrams โ the fretboard grids under chord symbols, read from
harmonyandframeelements. Coverage arrived in 1.3. - Track volume, pan, and program โ per-instrument mixer settings from the
score-instrumentandmidi-instrumentblocks feed straight into the alphaTab mixer. - Tempo and tempo changes โ read from
soundandmetronomemarkers so the score plays back at the intended feel. - Guitar techniques โ string and fret from
technical, string numbers on standard notation staves, dead notes, harmonics, fingering, and let ring or palm mute lines. Coverage extended in 1.9. - Jumps and measure numbers โ D.C., D.S., coda, segno, and fine from
soundelements play back. Since 1.9 this includes asoundinside adirection, as MuseScore writes it, and the measure numbers from the file are shown as bar numbers. - Lyrics โ multiple verses attached to notes via
lyricelements are aligned to beats on import. - Part groups โ braces and brackets grouping multiple parts. By default each part becomes a track. Set
importer.mergePartGroupsInMusicXmltotrueto merge grouped parts into a single track with multiple staves (piano-style grand staff, for example).
For the exhaustive element table, see the MusicXML compatibility page.
Show it in codeโ
import * as alphaTab from '@coderline/alphatab';
const container = getAlphaTabContainer();
const api = new alphaTab.AlphaTabApi(container, {
core: { file: '/scores/song.musicxml' },
importer: {
mergePartGroupsInMusicXml: true,
},
});
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โ
- MusicXML compatibility โ the full element-by-element support matrix.
- Tuning importer behavior โ the encoding hint, part-group merge flag, and other importer knobs in one place.
- Load from bytes โ pass MusicXML content that already sits in memory rather than fetching a URL.
importer.mergePartGroupsInMusicXmlandimporter.encodingin the reference.