lilypond-user
[Top][All Lists]
Advanced

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

Re: Flexible lyric alignment


From: Kieren MacMillan
Subject: Re: Flexible lyric alignment
Date: Mon, 14 Nov 2022 11:11:18 -0500

Hi again!

Given the success of my first sortie, here's another snippet that might be 
automated. (Note that this one matches the OP's situation.)

This is definitely a tweak I do on a very regular basis in my music-with-text 
scores: sliding a text backwards, potentially under previous grobs. This one is 
obviously [intentionally] extreme, and again avoids some “dragons” (clefs, 
breaks, other lyrics, etc.). Then again, I had to trial-and-error it to find 
the final number I used (0.5), and don’t currently know what algorithm might be 
applied to remove the T&E process…

In any case, I’m hopeful that lightning will strike twice, and a single “hacky” 
function might (a) be applicable to a huge percentage of real-world situations 
and (b) might be additional input/data for a potential general solution down 
the line.

Best,
Kieren.

%%%%  SNIPPET BEGINS
\version "2.23.14"

\paper {
  top-margin = 0.5\in
  left-margin = 0.5\in
  line-width = 6\in
  ragged-right = ##f
}

spacecase_notes = { R1 a'4 c'8 f' bes'4 a' g'8 8 \tuplet 3/2 { g'8 8 fis' } g'2 
}
spacecase_lyrics = \lyricmode { Scraunched is the long -- est sin -- gle syl -- 
la -- ble word! }

\markup "1. Raw output:"
\score {
  <<
    \new Staff \new Voice = "melody" \spacecase_notes
    \new Lyrics \lyricsto "melody" \spacecase_lyrics
  >>
}

\markup "2. Using LyricText.self-alignment-X to shift the initial text under 
preceding grobs:"
tweaksTwo = {
  s1
  \once \override Score.LyricText.self-alignment-X = #0.5
}
\score {
  <<
    \new Staff \new Voice = "melody" << \spacecase_notes \tweaksTwo >>
    \new Lyrics \lyricsto "melody" \spacecase_lyrics
  >>
}
%%%%  SNIPPET ENDS


reply via email to

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