abcjs icon indicating copy to clipboard operation
abcjs copied to clipboard

first `P:` is ignored after `V:` definition

Open chrisfargen opened this issue 5 years ago • 5 comments

The ABC code below is printed without the first P: A.

T: Swing guitars
M: 4/4
L: 1/8
K: Cmaj
%
V: chords
P: A
"C"x4 "Eb°7"x4 | "D-7"x4 "G7"x4 | "C"x4 "Eb°7"x4 | "D-7"x4 "G7"x4 |
"C"x4 "C7"x4 | "F"x4 "F-"x4 | "D-7"x4 "G7"x4 | "C"x4 "G7"x4 ||
P: A
"C"x4 "Eb°7"x4 | "D-7"x4 "G7"x4 | "C"x4 "Eb°7"x4 | "D-7"x4 "G7"x4 |
"C"x4 "C7"x4 | "F"x4 "F-"x4 | "D-7"x4 "G7"x4 | "C"x4 "C7"x4 ||

However, inline [P: A] works fine:

T: Swing guitars
M: 4/4
L: 1/8
K: Cmaj
%
V: chords
[P: A] "C"x4 "Eb°7"x4 | "D-7"x4 "G7"x4 | "C"x4 "Eb°7"x4 | "D-7"x4 "G7"x4 |
"C"x4 "C7"x4 | "F"x4 "F-"x4 | "D-7"x4 "G7"x4 | "C"x4 "G7"x4 ||
P: A
"C"x4 "Eb°7"x4 | "D-7"x4 "G7"x4 | "C"x4 "Eb°7"x4 | "D-7"x4 "G7"x4 |
"C"x4 "C7"x4 | "F"x4 "F-"x4 | "D-7"x4 "G7"x4 | "C"x4 "C7"x4 ||

chrisfargen avatar May 30 '20 22:05 chrisfargen

Related, lower priority issue: [P: B] on its own line sometimes results in a formatting error.

asdfqw

T: Swing guitars
M: 4/4
L: 1/8
K: Cmaj
%
V: chords
[P: A]
"C"x4 "Eb°7"x4 | "D-7"x4 "G7"x4 | "C"x4 "Eb°7"x4 | "D-7"x4 "G7"x4 |
"C"x4 "C7"x4 | "F"x4 "F-"x4 | "D-7"x4 "G7"x4 | "C"x4 "G7"x4 ||
[P: B]
"C"x4 "Eb°7"x4 | "D-7"x4 "G7"x4 | "C"x4 "Eb°7"x4 | "D-7"x4 "G7"x4 |
"C"x4 "C7"x4 | "F"x4 "F-"x4 | "D-7"x4 "G7"x4 | "C"x4 "C7"x4 ||

chrisfargen avatar May 30 '20 22:05 chrisfargen

Agree that's a bug. A work around is to switch these two lines:

P: A
V: chords

paulrosen avatar May 31 '20 19:05 paulrosen

Another way to do the second example is to leave off the brackets:

P: B

Having the part inline makes the music want to put it right at the end of the last line.

paulrosen avatar May 31 '20 19:05 paulrosen

Hey Paul,

I'm still hoping for a solution to this. It seems that the relationship between P and V is not entirely clear in the 2.2 standard. However, I believe it is common for V to have multiple P.

Testing using beta.21, this doesn't look right:

X:1
K:C
%
V:1
[P:A] C8 |
[P:B] C8 |

and neither does this:

X:1
K:C
%
V:1
P:A
C8 |
P:B
C8 |

It would be really nice to be able to rely on one or the other syntax and to have it display as expected.

Thanks for your help.

chrisfargen avatar Dec 06 '20 20:12 chrisfargen

Ok, look for it in a couple weeks.

paulrosen avatar Dec 19 '20 15:12 paulrosen