denemo-devel
[Top][All Lists]
Advanced

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

Re: [Denemo-devel] Vertically centred common lyrics


From: Richard Shann
Subject: Re: [Denemo-devel] Vertically centred common lyrics
Date: Sat, 26 Oct 2019 17:35:38 +0100

On Tue, 2019-10-15 at 22:21 +0200, Andreas Schneider wrote:
> On 10/11/19 9:39 AM, Richard Shann wrote:
> > On Wed, 2019-10-09 at 22:36 +0200, Andreas Schneider wrote:
> > > What is the best way to input vertically centred common lyrics
> > > (see
> > > http://lilypond.org/doc/v2.18/Documentation/snippets/vocal-music#
> > > voca
> > > l-music-vertically-centered-common-lyrics)
> > > in Denemo? I used the Score > Lilypond Definition feature to
> > > define
> > > commands dropLyrics and revertLyrics similar as in the snippet,
> > > 
> > > dropLyrics = {
> > >   \override LyricText.extra-offset = #'(0 . -1.5)
> > >   \override LyricHyphen.extra-offset = #'(0 . -1.5)
> > >   \override LyricExtender.extra-offset = #'(0 . -1.5)
> > > }
> > > revertLyrics = {
> > >   \revert LyricText.extra-offset
> > >   \revert LyricHyphen.extra-offset
> > >   \revert LyricExtender.extra-offset
> > > }
> > > 
> > > and used those commands in the lyrics pane, but I wonder whether
> > > there
> > > is a better way to do that?
> > 
> > That looks like a question that may get a better response from the
> > lily
> > address@hidden mailing list. Unless the question is about how to
> > insert the syntax from that example into a Denemo score
> 
> The question was what is the best way to insert it in Denemo.
> 
> > on that I
> > think you have it right - you could elaborate it into a command in
> > the
> > Lyrics menu that automatically creates the definitions at the head
> > of
> > the file and inserts the invocations (\dropLyrics etc) in the text
> > (there are many examples in the Lyrics menu of inserting stuff
> > using
> > 
> > d-InsertTextInVerse
> > 
> > but perhaps none that create a definition - one command that does
> > that
> > is TrillsPlus which I see uses
> > 
> > d-LilyPondDefinition
> > 
> > which I see takes a pair (cons "name" "definition"))
> 
> So that is something like this:
> 
> ;InsertDropLyrics
> (let ((tag "InsertDropLyrics"))
> ((d-LilyPondDefinition (cons "dropLyrics" "\\override
> LyricText.extra-offset = #'(0 . -1.5)\\override LyricHyphen.extra-
> offset
> = #'(0 . -1.5)\\override LyricExtender.extra-offset = #'(0 . -1.5)"))
> (d-InsertTextInVerse "\\dropLyrics")
> (d-SetSaved #f)))
> 
> If you have an even number of verses, this can be used to drop the
> chorus lyrics half a verse (e.g. in the second verse if you have four
> verses). If you have an odd number of verses, no such script is
> needed,
> as you can just insert the chorus lyrics in the centre verse.
> 
> >  If you are asking on lilypond-user perhaps it would be good to ask
> > if
> > the lines
> > leftbrace = \markup { \override #'(font-encoding . fetaBraces)
> > \lookup #"brace240" }
> > rightbrace = \markup { \rotate #180 \leftbrace }
> > in that snippet are a mistake ... they don't seem relevant.
> 
> I guess those are used to draw brackets to indicate that common text
> is
> following, such as in this extension of the snippet from the Lilypond
> documentation:
> 
> \include "english.ly"
> leftbrace = \markup { \override #'(font-encoding . fetaBraces)
> \lookup
> #"brace120" }
> rightbrace = \markup { \rotate #180 \leftbrace }
> 
> dropLyrics =
> {
>     \override LyricText.extra-offset = #'(0 . -4)
>     \override LyricHyphen.extra-offset = #'(0 . -4)
>     \override LyricExtender.extra-offset = #'(0 . -4)
> }
> 
> raiseLyrics =
> {
>     \revert LyricText.extra-offset
>     \revert LyricHyphen.extra-offset
>     \revert LyricExtender.extra-offset
> }
> 
> skipFour = \repeat unfold 4 { \skip 8 }
> 
> lyricsA = \lyricmode { The first verse has \dropLyrics
> \markup{\rightbrace the} com -- mon
> __ \markup{words\leftbrace} \raiseLyrics used in all four. }
> lyricsB = \lyricmode { In stan -- za two, \skipFour al -- so ap --
> pear. }
> lyricsC = \lyricmode { By the third verse, \skipFour are get -- ting
> dull. }
> lyricsD = \lyricmode { Last stan -- za, and \skipFour get used once
> more. }
> 
> melody = \relative c' { c4 d e f g f e8( f) d4 c e d c }
> 
> \score
> {
>         <<
>                 \new Voice = m \melody
>                 \new Lyrics \lyricsto m \lyricsA
>                 \new Lyrics \lyricsto m \lyricsB
>                 \new Lyrics \lyricsto m \lyricsC
>                 \new Lyrics \lyricsto m \lyricsD
>         >>
> }
> 
> Unfortunately, I couldn't get rid of the extra vertical space between
> first and second verse which is inserted when adding the markup for
> \rightbrace.
That may be why the example was left incomplete - perhaps it is hard?
The author might know...

>  Furthermore, the definition of \leftbrace depends on the
> number of verses, as that determines the size of the bracket; thus, a
> Scheme script would have to check that.

there doesn't appear to be something already to query the number of
verses for the current staff, but this will do it:

(define (number-of-verses)
    (define num 0)
    (let loop ()
        (if (d-GetVerseNumber num)
            (begin
                (set! num (1+ num))
                (loop))))
    num)

HTH

Richard




reply via email to

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