lilypond-user
[Top][All Lists]
Advanced

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

Re: Vertically centering refrain lyrics?


From: tisimst
Subject: Re: Vertically centering refrain lyrics?
Date: Wed, 5 Nov 2014 14:12:27 -0800 (PST)

Greg,

AFAIK, there isn't an automatic way to vertically center-align the lyrics. However, here's a little function (\dropLyrics) that makes it easier that I created based on an entry in the LSR. It works best when the refrain is found within the verse that is closest (ABOVE) to the center point you want to actually place it at and set the dropLyrics value to -1.5, like this:

%<-------------------- SNIP ---------------------

\version "2.18.2"
\layout {
  indent = 0
  ragged-right = ##f
}

dropLyrics =
  #(define-music-function (parser location x music)
     (number? ly:music?)
    #{
      \override LyricText.extra-offset = #(cons 0 x)
      \override LyricHyphen.extra-offset = #(cons 0 x)
      \override LyricExtender.extra-offset = #(cons 0 x)
      \override StanzaNumber.extra-offset = #(cons 0 x)
      $music
      \revert LyricText.extra-offset
      \revert LyricHyphen.extra-offset
      \revert LyricExtender.extra-offset
      \revert StanzaNumber.extra-offset
    #}
  )

verseMelody = \relative c'' {
  a4 c4 b4 d4
  e4 d4 c4 b4
}

firstVerse = \lyricmode {
  This is the first.
  
  \dropLyrics #-1.5 {  % <--- Notice the centered section must be in brackets
    Here's the ref -- rain.
  }
}

secondVerse = \lyricmode {
  This is the next.
}

\score {
  <<
    \new Staff {
      \new Voice = "verse" { \verseMelody }
    }
    \new Lyrics = "firstVerse" {
      \lyricsto "verse" \firstVerse
    }
    \new Lyrics = "secondVerse" {
      \lyricsto "verse" \secondVerse
    }
  >>
}

%<-------------------- SNIP ---------------------

This is really only necessary for an even-number of verses. For odd-numbers, just put the refrain in with the middle verse.

HTH,
Abraham

On Wed, Nov 5, 2014 at 2:43 PM, Gregorio Damian Gomez [via Lilypond] <[hidden email]> wrote:

Hello, everybody:

I haven't been able to find a solution for this that works or that doesn't generate an error.

I would like the chorus lyrics to align in the middle of the verses, rather than below them. So in this case, it would end up somewhere between the two verse lines. Another option would be to have the chorus lyrics aligned with the first line of the verse lyrics.

I'm open to any solution, including restructuring, especially if it's a pattern I can reuse.

If it's something I've overlooked in the docs, please don't hesitate to point me in the right direction.

Thanks!
Greg


Here's my snip:

\version "2.18.2"

\layout {

indent = 0

ragged-right = ##f

}

verseMelody = \relative c'' {

a4 c4 b4 d4

}

chorusMelody = \relative c'' {

e4 d4 c4 b4

}

firstVerse = \lyricmode {

This is the first.

}

secondVerse = \lyricmode {

This is the next.

}

chorusLyrics = \lyricmode {

Here's the ref -- rain.

}

\score {

<<

\new Staff {

\context Voice = "verse" { \verseMelody }

\context Voice = "chorus" {\chorusMelody }

}

\new Lyrics = "firstVerse" {

\lyricsto "verse" \firstVerse

}

\new Lyrics = "secondVerse" {

\lyricsto "verse" \secondVerse

}

\new Lyrics = "chorus" {

\lyricsto "chorus" \chorusLyrics

}

>>

}




_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user



If you reply to this email, your message will be added to the discussion below:
http://lilypond.1069038.n5.nabble.com/Vertically-centering-refrain-lyrics-tp168444.html
To start a new topic under User, email [hidden email]
To unsubscribe from Lilypond, click here.
NAML


View this message in context: Re: Vertically centering refrain lyrics?
Sent from the User mailing list archive at Nabble.com.

reply via email to

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