> One problem that I'm currently encountering is dealing with optional
> chords. (The chord letters above the staff for guitar players.) These
> are generally shown in either parentheses or square brackets. Is there
> a way to handle several arbitrary chord names  differently on a score?
> By this I mean, for example, just this D, but not the others.
>


Here is a solution from the german forum
http://www.lilypondforum.de/index.php?action=profile;area=showposts;u=54

There is a \paren command for a single chord, and the pair of \leftParen
\rightParen for multiple chords.  Note that the right paren command comes
before the last chord.


\version "2.19.15"

#(define (parenthesis-ignatzek-chord-names in-pitches bass inversion
context)
(markup #:line ( "(" (ignatzek-chord-names in-pitches bass inversion
context) ")" )))

#(define (left-parenthesis-ignatzek-chord-names in-pitches bass inversion
context)
(markup #:line ( "(" (ignatzek-chord-names in-pitches bass inversion
context) )))

#(define (right-parenthesis-ignatzek-chord-names in-pitches bass inversion
context)
(markup #:line ( (ignatzek-chord-names in-pitches bass inversion context)
")" )))

paren = #(define-music-function (parser location griffe) (ly:music?)
#{
        \set chordNameFunction = #parenthesis-ignatzek-chord-names
        $griffe
        \set chordNameFunction = #ignatzek-chord-names
#})

leftParen = #(define-music-function (parser location griffe) (ly:music?)
#{
        \set chordNameFunction = #left-parenthesis-ignatzek-chord-names
        $griffe
        \set chordNameFunction = #ignatzek-chord-names
#})

rightParen = #(define-music-function (parser location griffe) (ly:music?)
#{
        \set chordNameFunction = #right-parenthesis-ignatzek-chord-names
        $griffe
        \set chordNameFunction = #ignatzek-chord-names
#})


\new ChordNames \chordmode {
    c2:maj7 \paren a:7 | d:m g:7 | c1 | \leftParen es4:m7 aes:7 d:m
\rightParen g:7
}


HTH,

David Elaine Alt
415 . 341 .4954 <%28415%29%20341-4954>
      "*Confusion is highly underrated*"
ela...@flaminghakama.com
self-immolation.info
skype: flaming_hakama
Producer ~ Composer ~ Instrumentalist
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to