I didn't see this answered yet, so here is my reply...

On Thu, Jan 12, 2017 at 7:45 PM, <[email protected]> wrote:

> ---------- Forwarded message ----------
> From: Rob Torop <[email protected]>
> To: [email protected]
> Cc:
> Date: Fri, 13 Jan 2017 03:45:13 +0000
> Subject: How can I get a repeat symbol in the chord names part of lead
> sheet?
> I'm trying to figure out what to use for a chord name to get a "repeat"
> (percent) sign over one of the measures. Below is a complete small
> example.  I want C over the first measure,  repeat over the second measure,
> and D over the third measure.  I'm sure this is trivial - I just can't find
> it!
>
> \version "2.18.2"
>
> chordNames = \chordmode {
>   c1
>    % What goes here to get the repeat sign above the second measure of the
> staff?
>    d1 % i want the d chord on top of the third measure
> }
>
> melody = \relative c'' {
>   c4 d e f
>   g a, b c
>   c d e f
>   }
>
>
> \score {
>   <<
>     \new ChordNames \chordNames
>     \new Staff { \melody }
>   >>
>
> }
>


Here is one approach that will get a percent sign in place of chord names
for repeated chords.

I'm unhappy with the fact that I can't figure out how to get the musical
repeat percent symbol here, rather than a text percent.  But this could be
a good starting point.

Note that by default, lilypond will repeat the chord name when there is a
line break.  Here I added a measure to your example to show this behavior.

\version "2.19.15"

chordNames = \chordmode {
    c1
    %  Q: What goes here to get the repeat sign above the second measure of
the staff?
    %  A: Here we just specify what the chord is.  The formatting is dealt
with later.
    c
    c
    d
}

melody = \relative c'' {
    c4 d e f
    g a, b c \break
    g' a, b c
    c d e f
}

#(define percent-repeated-chords
  (lambda (context)
   (let ((chord '()))
     `((acknowledgers
         (chord-name-interface .
           ,(lambda (engraver grob source-engraver)
             (if (equal? (ly:grob-property grob 'text) chord)
                 ;  It would be nice to be able to use the percent repeat
glyph, not text.
                 ;  Anyone know how to get that?  It isn't in the list of
glyphs at
                 ;
http://lilypond.org/doc/v2.18/Documentation/notation/the-feta-font
                 (ly:grob-set-property! grob 'text "%"))
             (set! chord (ly:grob-property grob 'text)))))
        (finalize . ,(lambda (translator) (set! chord '())))))))

<<
    \new ChordNames
        \with { \consists #percent-repeated-chords }
        \chordmode { \chordNames }
    \melody
>>


HTH,

David Elaine Alt
415 . 341 .4954                                           "*Confusion is
highly underrated*"
[email protected]
self-immolation.info
skype: flaming_hakama
Producer ~ Composer ~ Instrumentalist
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to