paulrosen / abcjs

javascript for rendering abc music notation
Other
1.94k stars 285 forks source link

Incorrect bar numbering when using multi-bar rests #1039

Open AGBrown opened 2 months ago

AGBrown commented 2 months ago

Thank you for the software, it's really fun to build with.

I've stumbled across this issue. Bar numbering is counted incorrectly if both staves in the grand staff use a multi-bar rest at the start - at least I think it's incorrect?

let me know if you need more info

%abc-2.1

X:0
T:Multi-bar rest test fail
%%barnumbers 1 % bar number every 1 bar, if bar no. is shown
%%measurenb 0 % measure numbers at first measure
%%score {R|L} % draw continued bar lines in a grand staff
M:4/4
L:1/4
V:R clef=treble
V:L clef=bass octave=-1
K:Cmaj
[V:R] Z2 | c4 | c4 |
[V:L] Z2 | c4 | c4 |
%
%%vskip 40
[V:R] "^<-- annotated as bar 4, but its bar 5"c4 | c4 | c4 | c4 |]
[V:L] c4 | c4 | c4 | c4 |]

X:1
T:Multi-bar rest test pass
%%barnumbers 1 % bar number every 1 bar, if bar no. is shown
%%measurenb 0 % measure numbers at first measure
%%score {R|L} % draw continued bar lines in a grand staff
M:4/4
L:1/4
V:R clef=treble
V:L clef=bass octave=-1
K:Cmaj
[V:R] z4 | z4 | c4 | c4 |
[V:L] z4 | z4 | c4 | c4 |
%
%%vskip 40
[V:R] "^<-- annotated correctly as bar 5"c4 | c4 | c4 | c4 |]
[V:L] c4 | c4 | c4 | c4 |]

image

image

paulrosen commented 2 months ago

Yes, definitely a bug. Thanks for the report.