Since: 1.2.0

Export Data Model

After alphaTab has loaded a full Score object from any input source, it can also be exported again to one of the supported export formats. Supported export formats:

  • Guitar Pro 7 (alphaTab.exporter.Gp7Exporter) since 1.2.0-alpha.75
note

More exporters are planned for the 1.5 release unless special feature requests of users are incoming.

To export a Score object the corresponding exporter needs to be created and called. Then the resulting binary array can be used further to trigger a download, sent it to a server, save it to a file etc.

const exporter = new alphaTab.exporter.Gp7Exporter();
const data = exporter.export(api.score, api.settings); // will return a Uint8Array
// trigger download
const a = document.createElement('a');
a.download = api.score.title.length > 0 ? api.score.title + '.gp' : 'Untitled.gp';
a.href = URL.createObjectURL(new Blob([data]));
document.body.appendChild(a);
a.click();
document.body.removeChild(a);