Hi Knut,

On Wed, Dec 14, 2016 at 3:16 AM, Knut Petersen
<knut_peter...@t-online.de> wrote:
> Hi everybody!
>
> There is a discussion on lilypond-user with the target to allow automated
> lyric extenders
> to lilypond. One part of that is a patch to clean and extend
> lyric_extender.cc.
>
> To allow automated creation of lyric extenders a helper function is needed.
> Putting the
> following code into a lilypond score does the job:
>
> #(define autoextenders (define-music-function (lyrics) (ly:music?)
>    (music-map
>      (lambda (event)
>        (if (and (eq? (ly:music-property event 'name) 'LyricEvent)
>           (not (let* ((art (ly:music-property event 'articulations))
>                       (is-hyphen? (lambda (ev) (eq? (ly:music-property ev
> 'name) 'HyphenEvent))))
>                (find is-hyphen? art)))
>           (not (string=? (ly:music-property event 'text) " ")))
>           (ly:music-set-property! event 'articulations
>              (append (ly:music-property event 'articulations) (list
> (make-music (quote ExtenderEvent))))) event )
>      event)
>    lyrics)))
>
> Q1: Where should a definition of \autoextenders reside?
> scm/music-functions.scm?
>

The right place to define a music function is in
ly/music-functions-init.ly.  Supporting Scheme functions might go in
scm/music-functions.scm.

David

_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to