Commit b79341b
committed
gp3/gp4: extract note accent flags (0x02 heavy, 0x40 normal)
`GP3File.readNote` never read flag bits 0x02 (heavy accent) and 0x40
(normal accent) from the note flags byte, even though the docstring
documented them. GP4 inherited this broken read path; only GP5 read
them correctly.
The writer side was asymmetric too: `GP3File.packNoteFlags` emitted
0x02 but not 0x40, while GP4 overrode it to add 0x40 only. Round-tripping
a note with `accentuatedNote=True` through PGP silently dropped the flag.
This change:
* reads both flags in `GP3File.readNote` (inherited by GP4)
* writes flag 0x40 in `GP3File.packNoteFlags`
* drops the now-redundant override in `GP4File.packNoteFlags`
* adds a round-trip regression test for all three formats
Cross-checked against alphaTab's `Gp3To5Importer.ts:1203-1207` which
extracts both flags universally.
Closes #11 parent 43de65f commit b79341b
3 files changed
Lines changed: 35 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
899 | 899 | | |
900 | 900 | | |
901 | 901 | | |
| 902 | + | |
902 | 903 | | |
| 904 | + | |
903 | 905 | | |
904 | 906 | | |
905 | 907 | | |
| |||
1443 | 1445 | | |
1444 | 1446 | | |
1445 | 1447 | | |
| 1448 | + | |
| 1449 | + | |
1446 | 1450 | | |
1447 | 1451 | | |
1448 | 1452 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
655 | 655 | | |
656 | 656 | | |
657 | 657 | | |
658 | | - | |
659 | | - | |
660 | 658 | | |
661 | 659 | | |
662 | 660 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
129 | 160 | | |
130 | 161 | | |
131 | 162 | | |
| |||
0 commit comments