lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How can I get a repeat symbol in the chord names part of lead sheet?


From: Flaming Hakama by Elaine
Subject: Re: How can I get a repeat symbol in the chord names part of lead sheet?
Date: Fri, 20 Jan 2017 15:54:17 -0800


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

On Thu, Jan 12, 2017 at 7:45 PM, <address@hidden> wrote:
---------- Forwarded message ----------
From: Rob Torop <address@hidden>
To: address@hidden
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"
address@hidden
self-immolation.info
skype: flaming_hakama
Producer ~ Composer ~ Instrumentalist
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

reply via email to

[Prev in Thread] Current Thread [Next in Thread]