On 2021-04-22 6:01 am, Gianmaria Lari wrote:
I have some variables, each containing one chord as in the following
example:
[...]
How can I solve this?
Here's a way that involves merging the elements of the two EventChords:
%%%%
\version "2.22.0"
ja = <c e>8
jb = <g b>8
jc = <d f>8
mergeChords =
#(begin
(define (event-chord-music? arg)
(music-type-predicate 'event-chord))
(define-music-function
(first second)
(event-chord-music? event-chord-music?)
(set! first (ly:music-deep-copy first))
(ly:music-set-property! first 'elements
(append
(ly:music-property first 'elements)
(ly:music-property second 'elements)))
first))
ka = \mergeChords \ja \jb
kb = \mergeChords \ja \jc
kc = \mergeChords \jb \jc
\new Voice \fixed c' { \ka[ \kb \kc] }
%%%%
Could be some hidden quirks with this approach, but it does seem to
allow the manual beaming to work.
-- Aaron Hill