lilypond-user
[Top][All Lists]
Advanced

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

Re: Tags in Lyrics


From: Thomas Morley
Subject: Re: Tags in Lyrics
Date: Sun, 26 Oct 2014 01:10:43 +0200

2014-10-25 14:46 GMT+02:00 Simon Albrecht <address@hidden>:
> Am 24.10.2014 um 21:48 schrieb Thomas Morley:
>
>> 2014-10-24 21:19 GMT+02:00 Simon Albrecht <address@hidden>:
>> [...]
>>>
>>> I tried to, but somehow an
>>> extender line inside a music function body gives a syntax error and I’ve
>>> got
>>> no clue how to circumvent that. You’ll find the current function
>>> attached.
>>> Can anyone help, please?
>>
>> No attachment ;)
>
> Always the same mistakes… sorry ;-/
> Yours, Simon

I'm not sure what you're aiming for, though I made your function work so far:


\version "2.19.12"

\paper { ragged-right = ##f }

ext =
#(define-scheme-function (parser location voice syl) (symbol? ly:music?)
  (let* ((s? (eq? voice 'S))
         (a? (eq? voice 'A))
         (t? (eq? voice 'T))
         (b? (eq? voice 'B))
         (others (cond
                   (s? '(A T B))
                   (a? '(S T B))
                   (t? '(S A B))
                   (b? '(S A T)))))

         #{
           \tag $voice
             $(let* ((dur (ly:music-property syl 'duration))
                     (txt (ly:music-property syl 'text))
                     (lyr (make-lyric-event txt dur)))
               (ly:music-set-property! lyr 'articulations
                                           (list (make-music 'ExtenderEvent)))
               lyr)
           \tag $others $syl
         #}))

music =
<<
\new Voice = "mel"
\relative c' { c( d) e f }

%% works both:
\addlyrics { \ext A Will it work? }
%\new Lyrics \lyricsto "mel" {
%        \ext A
%        Will it work?
%  }

>>

\keepWithTag A \music
\keepWithTag B \music


HTH,
  Harm



reply via email to

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