paulrosen / abcjs

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

Multi-measure rests don't contribute to bar number incrementing (may be same as 1039) #1053

Open seisiuneer opened 1 month ago

seisiuneer commented 1 month ago

This ignores the Z24 in the measure count and puts the bar 5 marker on the 5th bar indicated with a |

X:1 T:song C:composer L:1/4 M:2/4 K:BbMaj %%barnumbers 5 Z24 | !p! F2- | F2- | F2- | F2 | B2- | B2- | !>(!B2-!>)! | B2- |

Workaround is to manually set the bar number when required:

X:1 T:song C:composer L:1/4 M:2/4 K:BbMaj %%barnumbers 5 %%setbarnb 24 Z24 | !p! F2- | F2- | F2- | F2 | B2- | B2- | !>(!B2-!>)! | B2- |

seisiuneer commented 1 month ago

Interestingly, if you stick a second T: tag at the top of that, it crashes the renderer:

X:1 T:song T:subtitle C:composer L:1/4 M:2/4 K:BbMaj %%barnumbers 5 %%setbarnb 24 Z24 | !p! F2- | F2- | F2- | F2 | B2- | B2- | !>(!B2-!>)! | B2- |

but not if you remove the %%setbarnb (but the bar numbers are wrong):

X:1 T:song T:subtitle C:composer L:1/4 M:2/4 K:BbMaj %%barnumbers 5 Z24 | !p! F2- | F2- | F2- | F2 | B2- | B2- | !>(!B2-!>)! | B2- |

and it works if you move the second T: tag down:

X:1 T:song L:1/4 M:2/4 K:BbMaj %%barnumbers 5 %%setbarnb 24 T:subtitle Z24 | !p! F2- | F2- | F2- | F2 | B2- | B2- | !>(!B2-!>)! | B2- |