lilypond-user
[Top][All Lists]
Advanced

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

Re: vowel aligned lyrics - want to improve it


From: Jiri Zurek (Prague)
Subject: Re: vowel aligned lyrics - want to improve it
Date: Fri, 7 Jan 2011 03:18:10 -0800 (PST)

Dear Sir,
thank you for this new way of centering lyrics. However, the original
function for wowel-centering had a secondary-vowel-set which was very
useful, since when no letter from the primary vowel-set was found in the
syllable, lilypond would search for a secondary one to use it instead. This
is the problem os so called "half-vowels" which can function as consonants
if real vowel is present, and as half-vowels when no real vowel is present.
In my language, such letter are L and R. Can you please upgrade your
function so that it can use the secondary-vowel-set again?



Wolf Alight wrote:
> 
> 
> #(define vowel-set (list->char-set (string->list "AEIOUYÅÄÖaeiouyåäö")))
> 
> #(define (width grob text-string)
> (let* (
>        (layout (ly:grob-layout grob))
>        (props (ly:grob-alist-chain grob (ly:output-def-lookup layout
> 'text-font-defaults))))
>       (cdr (ly:stencil-extent (ly:text-interface::interpret-markup layout
> props (markup text-string)) X))))
> 
> #(define (center-on-vowel grob)
>          (let* ((syllable (ly:grob-property-data grob 'text))
>         (vowel-count (string-count syllable vowel-set))
>                 (vowel-position (string-index syllable vowel-set))
>         (prevowel (substring syllable 0 vowel-position))
>         (vowel (substring syllable vowel-position (+ vowel-position 1)))
>         (prevowel-width (width grob prevowel))
>         (vowel-width (width grob vowel))
> ; TODO: get the note width dynamically instead of hard coded
> (note-width 1.5))
>        (- (/ (- note-width vowel-width) 2) prevowel-width)))
> 
> chant = \relative c'' { c4 d4 c4 c4 c4 }
> words = \lyricmode { aligned words do come easy }
> 
> \score {
>   <<
>     \new Voice = "melody" \chant
>     \new Lyrics \lyricsto "melody" \words
>     >>
> }
> 
> \layout {
>     \context {
>       \Lyrics
>       \override LyricText #'X-offset = #center-on-vowel
>     }
> }
> 
> _______________________________________________
> lilypond-user mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/lilypond-user
> 
> 

-- 
View this message in context: 
http://old.nabble.com/vowel-aligned-lyrics---want-to-improve-it-tp27595324p30613274.html
Sent from the Gnu - Lilypond - User mailing list archive at Nabble.com.




reply via email to

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