lilypond-user
[Top][All Lists]
Advanced

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

Re: Tags in Lyrics


From: Simon Albrecht
Subject: Re: Tags in Lyrics
Date: Sun, 26 Oct 2014 14:24:20 +0100
User-agent: Mozilla/5.0 (Windows NT 6.1; rv:31.0) Gecko/20100101 Thunderbird/31.2.0

Thanks Harm, that does what I wanted to:
The voice named in the function argument gets an extender line, a tag is computed for all other voices and these don’t get an extender line, but only the syllable which serves as a second argument to the function.

Kudos, Simon

Am 26.10.2014 um 01:10 schrieb Thomas Morley:
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]