paulrosen / abcjs

javascript for rendering abc music notation
Other
1.91k stars 282 forks source link

Slur placement for SATB #1049

Open nbruley opened 2 weeks ago

nbruley commented 2 weeks ago

Slur placement is not consistent (v6.4.3) image



X:1
T:Knecht
T:7.6.7.6
C:Justin Heinrich Knecht(1791)
L:1/8
M:4/4
Q:1/4=100
K:D
%%score (S A) (T B)
V:S clef=treble middle=B stem=up
V:A clef=treble middle=B stem=down
V:T clef=bass,, stem=up
V:B clef=bass,, stem=down
[V:S]D2|D2 (CD) E2 E2| E2 D4||
F2|F2 (EF) G2 E2|C6||
D2|D2 E2 E2 F2|G2 B4||
B2|A2 F2 E2 E2|D6|]
[V:A]A,2|A,2 (A,A,) C2 C2| C2 A,4||
D2|D2 (C=C) B,2 B,2|A,6||
A,2|A,2 C2 C2 =C2|B,2 D4||
G2|F2 D2 C2 C2|A,6|]
[V:T]F,2|F,2(F,F,)A,2G,2|G,2F,4||
A,2|A,2(G,A,)G,2G,2|G,6||
F,2|F,2A,2G,2A,2|G,2G,4||
G,2|A,2A,2A,2G,2|F,6|]
[V:B]D,2|D,2(D,D,)A,,2A,,2|A,,2D,4||
D,2|D,2(A,,A,,)G,,2G,,2|A,,6||
D,2|D,2A,,2A,,2D,2|G,,2G,,4||
G,,2|D,2D,2A,,2A,,2|D,6|]```
seisiuneer commented 2 weeks ago

nbruley, can you be more specific about what isn't consistent? I'm not seeing it.

nbruley commented 2 weeks ago

Yellow is outside the beam, blue is inside. image

seisiuneer commented 2 weeks ago

Thanks! I see it now.

seisiuneer commented 2 weeks ago

Interestingly, if you don't group the voices, I think it may consistent:

X:1 T:Knecht T:7.6.7.6 C:Justin Heinrich Knecht(1791) L:1/8 M:4/4 Q:1/4=100 K:D %%stretchlast true %%score S A T B V:S clef=treble middle=B stem=up V:A clef=treble middle=B stem=down V:T clef=bass,, stem=up V:B clef=bass,, stem=down [V:S]D2|D2 (CD) E2 E2| E2 D4|| F2|F2 (EF) G2 E2|C6|| D2|D2 E2 E2 F2|G2 B4|| B2|A2 F2 E2 E2|D6|] [V:A]A,2|A,2 (A,A,) C2 C2| C2 A,4|| D2|D2 (C=C) B,2 B,2|A,6|| A,2|A,2 C2 C2 =C2|B,2 D4|| G2|F2 D2 C2 C2|A,6|] [V:T]F,2|F,2(F,F,)A,2G,2|G,2F,4|| A,2|A,2(G,A,)G,2G,2|G,6|| F,2|F,2A,2G,2A,2|G,2G,4|| G,2|A,2A,2A,2G,2|F,6|] [V:B]D,2|D,2(D,D,)A,,2A,,2|A,,2D,4|| D,2|D,2(A,,A,,)G,,2G,,2|A,,6|| D,2|D,2A,,2A,,2D,2|G,,2G,,4|| G,,2|D,2D,2A,,2A,,2|D,6|]

image

I'm going to keep messing with this to see if can provide any more insight.

seisiuneer commented 2 weeks ago

If you take away the specific stem directions, you get this, which seems consistent while still providing proper stem directions:

X:1 T:Knecht T:7.6.7.6 C:Justin Heinrich Knecht(1791) L:1/8 M:4/4 Q:1/4=100 K:D %%stretchlast true %%score (S A) (T B) V:S clef=treble middle=B V:A clef=treble middle=B V:T clef=bass,, V:B clef=bass,, [V:S]D2|D2 (CD) E2 E2| E2 D4|| F2|F2 (EF) G2 E2|C6|| D2|D2 E2 E2 F2|G2 B4|| B2|A2 F2 E2 E2|D6|] [V:A]A,2|A,2 (A,A,) C2 C2| C2 A,4|| D2|D2 (C=C) B,2 B,2|A,6|| A,2|A,2 C2 C2 =C2|B,2 D4|| G2|F2 D2 C2 C2|A,6|] [V:T]F,2|F,2(F,F,)A,2G,2|G,2F,4|| A,2|A,2(G,A,)G,2G,2|G,6|| F,2|F,2A,2G,2A,2|G,2G,4|| G,2|A,2A,2A,2G,2|F,6|] [V:B]D,2|D,2(D,D,)A,,2A,,2|A,,2D,4|| D,2|D,2(A,,A,,)G,,2G,,2|A,,6|| D,2|D,2A,,2A,,2D,2|G,,2G,,4|| G,,2|D,2D,2A,,2A,,2|D,6|]

image
nbruley commented 2 weeks ago

I'm just assuming that the slur should go outside of the beams, but I am not clear on the rules for this. Paul said it is complex, https://github.com/paulrosen/abcjs/issues/988

paulrosen commented 1 week ago

I'm in the process of reworking this area. The technical reason is the order that things are calculated. If a note is not beamed I know immediately how tall it is. If it is beamed then I don't know until after some other things are placed. I need to change the order of some of this, but it is difficult because of the way the code is currently structured. Also, for no good reason, the space above and the space below are handled a little differently.

Another thing is in the fifth measure the bass staff should have been placed lower - that is the bug I just fixed but I guess there is another case.

nbruley commented 1 week ago

I must have used an old screen shot. The spacing may be OK.

image