[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Non-blank chord repeat
From: |
Thomas Morley |
Subject: |
Re: Non-blank chord repeat |
Date: |
Sun, 3 Jul 2016 02:12:09 +0200 |
2016-07-03 1:58 GMT+02:00 Thomas Morley <address@hidden>:
> 2016-07-03 0:03 GMT+02:00 Lee Daniel Crocker <address@hidden>:
>> I'm printing lead sheets with just chords and lyrics, and this makes the
>> rhythm of the tune hard to see. What I'd like to do print chords at regular
>> intervals, say every half note, and rather than having repeats suppressed,
>> have them print "-".
>>
>> For example, "G - C - D C" for two beats of G, two of C, one of D, one of C.
>>
>> I'd be happy to do this manually by inserting a chord named "-" if there
>> were a way to do that. Or I could enter the chords at regular intervals and
>> have it mark the repeats with "-" somehow. Or maybe enter "N.C." and have
>> that print as "-" somehow?
>>
>> --
>> To the extent possible under law, I, Lee Daniel Crocker,
>> waive all copyright and related or neighboring rights to all
>> creative works original to me
>
> Hi,
>
> you could do
>
> (1) manually:
>
> minus =\once \override ChordName.text = "-"
>
> <<
> \new ChordNames
> \chordmode {
> g4 \minus g c \minus c d c
> }
> \new Staff { \repeat unfold 6 c''4 }
>>>
>
> (2) automatic
This code is insufficient. :(
Let me see, if can come up with something better tomorrow.
> #(define dash-repeated-chords
> (lambda (context)
> (let ((chord '()))
> `((acknowledgers
> (chord-name-interface .
> ,(lambda (engraver grob source-engraver)
> (if (equal? (ly:grob-property grob 'text) chord)
> (ly:grob-set-property! grob 'text "-"))
> (set! chord (ly:grob-property grob 'text)))))
> (finalize . ,(lambda (translator) (set! chord '())))))))
>
> <<
> \new ChordNames \with { \consists #dash-repeated-chords }
> \chordmode {
> g4 g c c d c
> }
> \new Staff { \repeat unfold 6 c''4 }
>>>
>
> HTH,
> Harm