abcjs
abcjs copied to clipboard
Feature request: writing chords symbols in their own lines
This is a feature that is not in the standard of abc notation.
I think it will be more convenient and readable if we can write the chord symbols in their own lines rather than interleave the chord symbols with the melodies. This is especially useful when we want to put some chords at places without notes.
For example, consider the case that we want to add two chords to each measure in this line
M: 4/4
L: 1/8
E6 D2 |C8 |
to make this line
become
It will be clear to write the chords symbol in an isolated line in some syntax like
M: 4/4
L: 1/8
c: "C" y4 "G/B" y4 |"Am" y4 "C/G" y4 |
E6 D2 | C8 |
The line started with c: holds the chord symbols. The chord symbols are followed by a spacer to specify the position of the chords.
I think the above syntax is a good extension of the standard.
In the original syntax, the same result can be only achieved with less readable codes.
For example, I usually add some extra y spacers for the chord symbols not aligned with any notes
M: 4/4
L: 1/8
"C" E6 "G/B" y2 D2 | "Am" C8 "C/G" y4 |
or use the voice overlay
M: 4/4
L: 1/8
E6 D2 & "C" y4 "G/B" y4 | C8 & "Am" y4 "C/G" y4 |
These lines look messy, and the chord symbols interrupt the melody codes.
I completely agree that writing chords in measures where there isn't a melody note is messy. There is an ambiguity to chords anyway - when you look at a written chart it sometimes isn't clear if a chord is on the 3rd beat or the 4th beat.
But I want to tread carefully when extending the standard.
What you describe above can already be done by using multiple voices:
%%staves (chords melody)
M:C
L:1/4
K:C
V:chords
"C"y2 "Fm7"y2|"C"y "C#dim7"y "Dm7"y "G7"y||
V:melody
c4-|c4||
Hi, I agree that extensions to the standard should be made carefully. So thank you for providing an alternative way to separate the chords from the melody.
However, when I use two voices for the chords and melody (as your example above), the stems and the slurs will be forced to point down. Are there some ways to make the stems and the slurs rendered as there is no other voice?
By the way, I found that I can make the stems ignore the other voice by using the & notation, but the slurs are still affected.
X: 1
M: 4/4
L: 1/8
K: G
AG AB- B(A GG-) & "G" x8 |G4 z4|]

Oh - that's a bug. Let me look into it and get you a recommendation.
Just to add my two cents, I find using a separate voice for writing chords is a much cleaner and simpler way than to blend them with the notes. It also gives more flexibility in hiding/showing/muting chords etc. and you avoid the slur problem. It also allows for deciding what voice should have the chords shown in arrangements.
Just to chime in on this old thread, I use two voices in a similar way.
X:1
K:Cmin clef=none
%
%%score (R L) % rhythm (chords) and lead (melody)
%
P:A
%
[V:R] "C-" x4 "/Bb" x4 | "Ab7" x4 "G7" x4 | "C-" x4 "/Bb" x4 | "Ab7" x4 "G7" x4 |
[V:L] .g2 .e2 fe zf | ze fg f2 ec- | c4 z4 | z4 z2 G2 |
%
[V:R] "C-" x4 "/Bb" x4 | "Ab7" x4 "G7" x4 | "C-" x4 x4 | x4 "C7" x4 ||
[V:L] .g2 .e2 fe zf | ze fg f2 ec- | c4 z4 | z4 z2 =Bc ||
The rendering looks pretty good, too, although the z rests look a bit out of place.

Note: other tools (e.g., abc2svg) prefer that V: voices have P: parts (rather than P: parts each having V: voices). (Treatment of P: in a multi-voice context varies from tool to tool.) So in those contexts, the above source must be edited to look like this:
X:
K:Cmin clef=none
%
%%score (R L) % rhythm (chords) and lead (melody)
%
[V:R] [P:A] "C-" x4 "/Bb" x4 | "Ab7" x4 "G7" x4 | "C-" x4 "/Bb" x4 | "Ab7" x4 "G7" x4 |
[V:L] [P:A] .g2 .e2 fe zf | ze fg f2 ec- | c4 z4 | z4 z2 G2 |
%
[V:R] "C-" x4 "/Bb" x4 | "Ab7" x4 "G7" x4 | "C-" x4 x4 | x4 "C7" x4 ||
[V:L] .g2 .e2 fe zf | ze fg f2 ec- | c4 z4 | z4 z2 =Bc ||
...which does not work in abcjs.
If you switch the voices the rests will look right:
%%score (L R) % rhythm (chords) and lead (melody)