lilypond-user
[Top][All Lists]
Advanced

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

Re: exchange LyricHyphen with a "proper" hyphen


From: Alexander Kobel
Subject: Re: exchange LyricHyphen with a "proper" hyphen
Date: Sun, 11 Dec 2016 12:15:11 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1

On 2016-12-10 23:33, Alexander Kobel wrote:
On 2016-12-10 20:20, Noeck wrote:
[...]
Would it be possible to have automatic extender lines? For every melisma
there is an extender line if it would be longer than the minimum-length?

Hm. Iterate over lyrics and add Extender events for each syllable
without a hyphen? Sounds reasonable...

Here's a first shot. Please test thoroughly...

#(define (has-hyphen? event)
   (let* ((art (ly:music-property event 'articulations))
(is-hyphen? (lambda (ev) (eq? (ly:music-property ev 'name) 'HyphenEvent))))
      (find is-hyphen? art)))

#(define (add-extender! event)
   (ly:music-set-property! event 'articulations
(append (ly:music-property event 'articulations) (list (make-music (quote ExtenderEvent)))))
   event)

add-lyric-extenders =
#(define-music-function (parser location lyrics) (ly:music?)
   (music-map
    (lambda (event)
      (if (and (eq? (ly:music-property event 'name) 'LyricEvent)
               (not (has-hyphen? event)))
          (add-extender! event))
      event)
    lyrics))

% ... and change lyrics definitions from
%   text = \lyricmode { ... }
% to
%   text = \add-lyric-extenders \lyricmode { ... }

Attached is how it will look like in your score. Not too bad...


Cheers,
Alexander

Attachment: BrichAn.ly
Description: Text Data


reply via email to

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