paulrosen / abcjs

javascript for rendering abc music notation
Other
1.9k stars 281 forks source link

Time signature change in grand staff causes rendering issue (using `%%score {R|L}`) #1043

Open AGBrown opened 1 month ago

AGBrown commented 1 month ago

Environment:

Issue:

If you add a time signature change at the start of both staves in a grand staff that is set up using %%score {R|L}, then it causes a rendering issue with that line of the staff.

(expand for test tune).

``` %abc-2.1 X:0 T:Time sig change test %%barnumbers 1 %%measurenb 0 %%score {R|L} %%stretchlast 1 Q:"Misterioso" 1/4=80 M:2/4 L:1/4 V:R clef=treble V:L clef=bass K:Gmaj [V:R] x x/ G/ | G2 | G2 | G2 | [V:L] x x/ z/ | C2 | C2 | C2 | % %%vskip 40 [V:R] [M:4/4] G4 | G4 | G4 | G4 | [V:L] [M:4/4] C4 | C4 | C4 | C4 | % %%vskip 40 [V:R] G4 | G4 | G4 | G4 |] [V:L] C4 | C4 | C4 | C4 |] ```

Expected output

The grand staff should be rendered normally.

(e.g. from abc2svg ):

(expand for image of expected output).

![image](https://github.com/user-attachments/assets/b346d076-6df8-4d62-b96f-01a480ba9c82)

Actual output

The grand staff rendering fails on the line with the time signature change at the start

(expand for image of actual output).

![image](https://github.com/user-attachments/assets/75eea1cf-670d-4607-8440-f9ae47eab143)

Other notes

§ 7.3 of abc v2.1 standard:

To avoid ambiguity, inline fields that specify music properties should be repeated in every voice to which they apply.

Example:

[V:1] C4|[M:3/4]CEG|Gce|
[V:2] E4|[M:3/4]G3 |E3 |
paulrosen commented 1 week ago

Definitely a bug. Thanks for the report.