lilypond-user
[
Top
][
All Lists
]
Advanced
[
Date Prev
][
Date Next
][
Thread Prev
][
Thread Next
][
Date Index
][
Thread Index
]
Re: Lyric separator
From
:
David Nalesnik
Subject
:
Re: Lyric separator
Date
:
Thu, 19 Sep 2013 11:12:09 -0500
On Thu, Sep 19, 2013 at 11:01 AM, David Nalesnik
<
address@hidden
>
wrote:
Hi Benjamin,
[...]
This is what I come up with:
[...]
OK, that was unnecessarily roundabout. Why bother with columns when I have access to all grobs, and I can just compare LyricText grobs?
Try this:
(Again, should work on 2.16.1.)
%%%%%%%%%%%%%%%%%%%%
\version "2.17.25"
#(define (my-callback grob)
(let* ((text (ly:grob-property-data grob 'text))
(refp (ly:grob-system grob))
; This returns all grobs in a line.
(all-grobs (ly:grob-array->list
(ly:grob-object refp 'all-elements)))
; We're only interested in LyricText grobs.
(just-syllables
(filter
(lambda (x) (grob::has-interface x 'lyric-syllable-interface))
all-grobs))
; We want the first LyricText grob in the system. We must locate this
; by position, since grobs don't seem to be listed in order in the
; 'all-elements grob array.
(first-syl
(fold
(lambda (elem prev)
(if (< (ly:grob-relative-coordinate elem refp X)
(ly:grob-relative-coordinate prev refp X))
elem
prev))
(car just-syllables)
just-syllables)))
; If our LyricText grob is the first on the line, override its stencil.
(if (eq? grob first-syl)
(begin
(ly:grob-set-property! grob 'text
#{ \markup \combine #text \translate #'(1.6 . -0.5) \draw-line #'(-4 . 0) #})
(ly:grob-set-property! grob 'stencil (lyric-text::print grob))))))
melody = \repeat unfold 16 g'4
lyr = \lyricmode {
\repeat unfold 16 sol
}
\score {
\new Staff <<
\new Voice = "voice" {
\melody
}
\new Lyrics \with {
\override LyricText #'after-line-breaking = #my-callback
} \lyricsto "voice" \lyr
>>
}
\paper {
indent = 0
line-width = 5.5\cm
}
reply via email to
[
Prev in Thread
]
Current Thread
[
Next in Thread
]
Lyric separator
,
Benjamin Bloomfield
,
2013/09/17
Re: Lyric separator
,
Kieren MacMillan
,
2013/09/17
Re: Lyric separator
,
Benjamin Bloomfield
,
2013/09/17
Re: Lyric separator
,
Benjamin Bloomfield
,
2013/09/18
Re: Lyric separator
,
Kieren MacMillan
,
2013/09/18
Re: Lyric separator
,
Benjamin Bloomfield
,
2013/09/18
Re: Lyric separator
,
Kieren MacMillan
,
2013/09/18
Re: Lyric separator
,
Benjamin Bloomfield
,
2013/09/19
Re: Lyric separator
,
David Nalesnik
,
2013/09/19
Re: Lyric separator
,
David Nalesnik
<=
Re: Lyric separator
,
Benjamin Bloomfield
,
2013/09/19
Re: Lyric separator
,
Kieren MacMillan
,
2013/09/19
Re: Lyric separator
,
David Nalesnik
,
2013/09/19
Re: Lyric separator
,
Kieren MacMillan
,
2013/09/19
Re: Lyric separator
,
David Nalesnik
,
2013/09/19
Re: Lyric separator
,
Kieren MacMillan
,
2013/09/19
Re: Lyric separator
,
Thomas Morley
,
2013/09/19
Re: Lyric separator
,
Kieren MacMillan
,
2013/09/19
Re: Lyric separator
,
Benjamin Bloomfield
,
2013/09/20
Re: Lyric separator
,
David Nalesnik
,
2013/09/20
Prev by Date:
Re: How to have separate \paper variables for different scores in the same book?
Next by Date:
bendAfter affected by bar numbers - possible bug?
Previous by thread:
Re: Lyric separator
Next by thread:
Re: Lyric separator
Index(es):
Date
Thread