Fix GP7 score system layout serialization for multitrack view#2774
Conversation
Keep Guitar Pro's native MultiVoice value unchanged and strengthen the regression test with explicit score layout values.\n\nResearch and implementation generated by gpt5.6sol-max.
|
Thanks for pointing this out. You are right about I ran an isolated ablation on Guitar Pro 8.1.5 using the same exported score and a cold launch for each variant:
This isolates the problem to the two score-level system-layout fields. I pushed The CDATA safety concern does not apply to these two fields because they are serialized from I also noticed that GPIF Research and content generated by |
# Conflicts: # packages/alphatab/src/exporter/GpifWriter.ts # packages/alphatab/test/exporter/Gp7Exporter.test.ts
|
I just digged into this topic and detected some other issue around exporting which I fixed. Actually it was a bug in the Guitar Pro 3-5 importer which could lead to invalid midi port and channel configurations leading also to crashes. This happened often on GP3-5 to GP8 conversions. |
024f137 to
3811071
Compare
|
Thanks a lot for your contribution, fix is merged 🥳 |




Summary
Fixes #2775
This PR fixes Guitar Pro multitrack layout instability by changing only two numeric score-level GPIF fields from CDATA to text:
ScoreSystemsDefaultLayoutScoreSystemsLayoutFree-form metadata remains CDATA.
MultiVoiceis intentionally left unchanged after maintainer feedback and isolated testing showed that it is unrelated to this issue.Root cause
alphaTab previously exported the score-level layout fields as:
The equivalent per-track layout fields, and the score-level fields in the repository's Guitar Pro fixtures, use text:
The distinction matches the failure boundary: single-track layout uses the track-level fields, while multitrack layout uses the score-level fields. Guitar Pro 8.1.5 on macOS can open the CDATA form, but switching to multitrack view can cause malformed layout and abnormal memory growth.
Although CDATA and text represent character data at the XML data-model level, the isolated results below show that Guitar Pro's multitrack layout path is sensitive to this representation.
Isolated Guitar Pro 8.1.5 validation
All variants used the same exported score and were tested with a cold Guitar Pro launch:
MultiVoiceXML / binary1>/0461.9 -> 2188.1 MB1>/0461.7 -> 472.6 MB1>/0458.2 -> 467.1 MBMultiVoice-only change0>/02183.9 MBMultiVoicechange0>/0MultiVoice1>/12227.7 MBThis isolates the fix to the two score layout fields: changing them to text is sufficient, while changing
MultiVoiceis neither necessary nor sufficient.Fixture evidence and safety
A scan of all 210
.gpfixtures underpackages/alphatab/test-datafound:MultiVoicevalues with the trailing>, so this PR preserves the existing valueThe CDATA safety concern for arbitrary strings does not apply here: these fields are generated from
numberandnumber[]. Titles, artists, lyrics, and other free-form fields are not changed.Regression coverage
The exporter regression test now uses explicit non-default layout values and verifies:
It also verifies that neither field is emitted as CDATA.
Validation on this branch:
Gp7Exporter.test.ts: 19 passedAI disclosure
Research and content generated by
gpt5.6sol-max.