Discussion:
[lyric sheet stylesheet] fixing lyric spacing
Kieren MacMillan
2018-12-07 17:18:41 UTC
Permalink
Hi all,

In the snippet below, I’m trying to develop some custom contexts so that people can write out lyrics with chords (but no music).

Right now, I’m trying to fix two things:

1. I want to eliminate all LyricHyphens entirely, and present words as complete words (rather than syllables). This would be solved, of course, if we had a "first-class citizen" LyricWord grob (q.v. the discussion a few years ago during Janek’s GSOC Lyrics work). Short of that, what can I do to squeeze out all LyricHyphens and spaces between syllables?

2. I want lyrics to be naturally spaced (i.e., not affected at all by the duration of the notes they are attached to). In the first line of output from the snippet, there are spaces "Mary ____ had a ____ little lamb" etc. How can I eliminate those?

Thanks,
Kieren.

%%% SNIPPET BEGINS

\version "2.19.80"

\paper {
indent = 0
ragged-right = ##t
system-system-spacing = #'((basic-distance . 6) (minimum-distance . 6) (padding . 2.5) (stretchability . 0))
score-system-spacing.padding = #12
}

\layout {
\context {
\ChordNames
\override ChordName.font-name = #"Alegreya Medium"
\override VerticalAxisGroup.staff-affinity = #DOWN
\override VerticalAxisGroup.nonstaff-relatedstaff-spacing =
#'((basic-distance . 2.5) (minimum-distance . 2.5) (padding . 1.25) (stretchability . 0))
}
\context {
\Lyrics
\override LyricText.font-name = #"Alegreya"
\override VerticalAxisGroup.staff-affinity = #UP
\override VerticalAxisGroup.nonstaff-relatedstaff-spacing =
#'((basic-distance . 5.5) (minimum-distance . 5.5) (padding . 1.25) (stretchability . 0))
}
\context {
\ChordNames
\name LyricSheetChords
\alias ChordNames
\inherit-acceptability LyricSheetChords ChordNames
\override VerticalAxisGroup.nonstaff-nonstaff-spacing =
#'((basic-distance . 1) (minimum-distance . 1) (padding . 1) (stretchability . 0))
}
\context {
\Lyrics
\name LyricSheetLyrics
\alias Lyrics
\inherit-acceptability LyricSheetLyrics Lyrics
\override VerticalAxisGroup.staff-affinity = #UP
\override VerticalAxisGroup.nonstaff-relatedstaff-spacing =
#'((basic-distance . 3) (minimum-distance . 3) (padding . 2) (stretchability . 0))
\override LyricText.self-alignment-X = #-0.9
\override LyricSpace.minimum-distance = #0.625
\override LyricSpace.minimum-length = #0.5
}
}

theMelody = {
e'4 d' c' d'
e'4 4 4 4
d'4 4 e' d'
c'2 r4 d'
e'4 d' c' d'
e'4 4 4 4
d'4 4 e' d'
c'2. r4
}

theChords = \chordmode {
c2 f
c1
d2:m g
c1
c2 f
c1
d2:m g
c1
}

lyricsbreak = \tag #'lyricsheet { \bar "" \break }

theWords = \lyricmode {
Mar -- y had a lit -- tle lamb,
\lyricsbreak
Its fleece was white as snow.
\lyricsbreak
And ev -- ery -- where that Mar -- y went
\lyricsbreak
The lamb was sure to go.
}

\score {
\removeWithTag #'lyricsheet <<
\new ChordNames \theChords
\new Staff \new Voice = "melody" \theMelody
\new Lyrics \lyricsto "melody" \theWords
\layout {
ragged-right = ##f
}
}

\score {
\keepWithTag #'lyricsheet <<
\new ChordNames \theChords
\new Devnull = "melody" \theMelody
\new LyricSheetLyrics \lyricsto "melody" \theWords
\layout {
line-width = 6\in
indent = 2\in
short-indent = 2\in
\context {
\Score
\remove "Bar_number_engraver"
\remove "Bar_engraver"
}
}
}

%%% SNIPPET ENDS
________________________________

Kieren MacMillan, composer
‣ website: www.kierenmacmillan.info
‣ email: ***@kierenmacmillan.info
Alexander Kobel
2018-12-07 18:19:27 UTC
Permalink
Hi Kieren,

without even looking at your example, to be honest, but a shot in the dark:

Fo you still remember David's and Mike's "magnetic snapping lyrics"?
https://lists.gnu.org/archive/html/lilypond-user/2014-03/msg00489.html
This snippet eventually went into OpenLilyLib, and was apparently
rediscovered as non-working about a year ago by Urs, see

http://lilypond.1069038.n5.nabble.com/Is-the-lyric-syllable-magnetic-snap-snippet-obsolete-td204403.html

Not sure about the problems that are claimed to exist, and not sure
where I got my last version from or whether I privately patched it; but
I couldn't find any issues with it few weeks ago. I attach my most
recent copy...

To be used with, IIRC, \include and

\layout {
\context {
\Lyrics
\override LyricWord.after-line-breaking = #(lyric-word-compressor 0)
}
}

(and I have no idea anymore what's the 0 got to do with it, and what
changes if you use other values...)


To see in action:

http://www.cpdl.org/wiki/index.php/Es_ist_ein_Ros%27_entsprungen_(Melchior_Vulpius)

- first system: entsprung -- en (instead of ent -- sprung -- en)
- last system: BlÃŒmlein (instead of BlÃŒm -- lein)

(source files are there, too)


But I only ever used it in the "usual" applications with notes, and
never tried on a pure chord sheet.


HTH nevertheless,
Alex
Post by Kieren MacMillan
Hi all,
In the snippet below, I’m trying to develop some custom contexts so that people can write out lyrics with chords (but no music).
1. I want to eliminate all LyricHyphens entirely, and present words as complete words (rather than syllables). This would be solved, of course, if we had a "first-class citizen" LyricWord grob (q.v. the discussion a few years ago during Janek’s GSOC Lyrics work). Short of that, what can I do to squeeze out all LyricHyphens and spaces between syllables?
2. I want lyrics to be naturally spaced (i.e., not affected at all by the duration of the notes they are attached to). In the first line of output from the snippet, there are spaces "Mary ____ had a ____ little lamb" etc. How can I eliminate those?
Thanks,
Kieren.
%%% SNIPPET BEGINS
\version "2.19.80"
\paper {
indent = 0
ragged-right = ##t
system-system-spacing = #'((basic-distance . 6) (minimum-distance . 6) (padding . 2.5) (stretchability . 0))
score-system-spacing.padding = #12
}
\layout {
\context {
\ChordNames
\override ChordName.font-name = #"Alegreya Medium"
\override VerticalAxisGroup.staff-affinity = #DOWN
\override VerticalAxisGroup.nonstaff-relatedstaff-spacing =
#'((basic-distance . 2.5) (minimum-distance . 2.5) (padding . 1.25) (stretchability . 0))
}
\context {
\Lyrics
\override LyricText.font-name = #"Alegreya"
\override VerticalAxisGroup.staff-affinity = #UP
\override VerticalAxisGroup.nonstaff-relatedstaff-spacing =
#'((basic-distance . 5.5) (minimum-distance . 5.5) (padding . 1.25) (stretchability . 0))
}
\context {
\ChordNames
\name LyricSheetChords
\alias ChordNames
\inherit-acceptability LyricSheetChords ChordNames
\override VerticalAxisGroup.nonstaff-nonstaff-spacing =
#'((basic-distance . 1) (minimum-distance . 1) (padding . 1) (stretchability . 0))
}
\context {
\Lyrics
\name LyricSheetLyrics
\alias Lyrics
\inherit-acceptability LyricSheetLyrics Lyrics
\override VerticalAxisGroup.staff-affinity = #UP
\override VerticalAxisGroup.nonstaff-relatedstaff-spacing =
#'((basic-distance . 3) (minimum-distance . 3) (padding . 2) (stretchability . 0))
\override LyricText.self-alignment-X = #-0.9
\override LyricSpace.minimum-distance = #0.625
\override LyricSpace.minimum-length = #0.5
}
}
theMelody = {
e'4 d' c' d'
e'4 4 4 4
d'4 4 e' d'
c'2 r4 d'
e'4 d' c' d'
e'4 4 4 4
d'4 4 e' d'
c'2. r4
}
theChords = \chordmode {
c2 f
c1
d2:m g
c1
c2 f
c1
d2:m g
c1
}
lyricsbreak = \tag #'lyricsheet { \bar "" \break }
theWords = \lyricmode {
Mar -- y had a lit -- tle lamb,
\lyricsbreak
Its fleece was white as snow.
\lyricsbreak
And ev -- ery -- where that Mar -- y went
\lyricsbreak
The lamb was sure to go.
}
\score {
\removeWithTag #'lyricsheet <<
\new ChordNames \theChords
\new Staff \new Voice = "melody" \theMelody
\new Lyrics \lyricsto "melody" \theWords
\layout {
ragged-right = ##f
}
}
\score {
\keepWithTag #'lyricsheet <<
\new ChordNames \theChords
\new Devnull = "melody" \theMelody
\new LyricSheetLyrics \lyricsto "melody" \theWords
\layout {
line-width = 6\in
indent = 2\in
short-indent = 2\in
\context {
\Score
\remove "Bar_number_engraver"
\remove "Bar_engraver"
}
}
}
%%% SNIPPET ENDS
________________________________
Kieren MacMillan, composer
‣ website: www.kierenmacmillan.info
_______________________________________________
lilypond-user mailing list
https://lists.gnu.org/mailman/listinfo/lilypond-user
Kieren MacMillan
2018-12-07 18:27:35 UTC
Permalink
Hi Alex,
Post by Alexander Kobel
David's and Mike's "magnetic snapping lyrics"?
https://lists.gnu.org/archive/html/lilypond-user/2014-03/msg00489.html
Yes — I have an old copy in my "Workarounds" include folder. But I ran into a lot of problems with it (maybe related to what Urs found?) and so had temporarily given up on it.
Post by Alexander Kobel
I attach my most recent copy...
Thanks! I’ll see whether it helps.
Post by Alexander Kobel
http://www.cpdl.org/wiki/index.php/Es_ist_ein_Ros%27_entsprungen_(Melchior_Vulpius)
Okay… first of all: What a gorgeous score! Fabulous font choices, spacing is perfect, whitespace is excellent. Well done.
Post by Alexander Kobel
But I only ever used it in the "usual" applications with notes, and never tried on a pure chord sheet.
I’ll let you know how it works out!

Thanks,
Kieren.
________________________________

Kieren MacMillan, composer
‣ website: www.kierenmacmillan.info
‣ email: ***@kierenmacmillan.info
Carl Sorensen
2018-12-07 19:06:45 UTC
Permalink
On 12/7/18, 11:19 AM, "Alexander Kobel" <a-***@a-kobel.de> wrote:

Hi Kieren,

without even looking at your example, to be honest, but a shot in the dark:

Fo you still remember David's and Mike's "magnetic snapping lyrics"?
https://lists.gnu.org/archive/html/lilypond-user/2014-03/msg00489.html
This snippet eventually went into OpenLilyLib, and was apparently
rediscovered as non-working about a year ago by Urs, see

http://lilypond.1069038.n5.nabble.com/Is-the-lyric-syllable-magnetic-snap-snippet-obsolete-td204403.html

I've just been doing some choral engraving where lyric hyphens are eliminated where there is no space. And I haven't used any special tools. It may only work where \textWidthOn has added space to the notes.

Consider Christmastime in the following snippet.

Carl

%%%%
\version "2.19.80"
global = {
\key g \major
\numericTimeSignature
\time 3/4
}

bass = \relative c {
\global
% Music follows here.
r4 r d4 |
g8 g16( fis) g4. a8 |
b8 c d4 r8 d |
c8 b g( d4) e8 |
f8 g f4 r8 r |


}

bassVerse = \lyricmode {
% Lyrics follow here.
Good peo -- ple __ all, this Christ -- mas -- time
Con -- si -- der well __ and bear in mind
}

\score { <<
\new Staff = "tb" {
\clef bass
\new Voice = "bass" {\bass}
}
\new Lyrics \with{
\override LyricText #'font-size = #-1
} \lyricsto "bass" \bassVerse
\layout{}
}

%%%%
Kieren MacMillan
2018-12-07 19:10:33 UTC
Permalink
Hi Carl,
Post by Carl Sorensen
I've just been doing some choral engraving where lyric hyphens are eliminated where there is no space. And I haven't used any special tools.
But if you look at "people" (for example), you’ll see there’s a space (but no hyphen) there.
I’m trying to generate "perfect" words.

Thanks,
Kieren.
________________________________

Kieren MacMillan, composer
‣ website: www.kierenmacmillan.info
‣ email: ***@kierenmacmillan.info
Carl Sorensen
2018-12-07 19:19:38 UTC
Permalink
On 12/7/18, 12:10 PM, "Kieren MacMillan" <***@sympatico.ca> wrote:

Hi Carl,
Post by Carl Sorensen
I've just been doing some choral engraving where lyric hyphens are eliminated where there is no space. And I haven't used any special tools.
But if you look at "people" (for example), you’ll see there’s a space (but no hyphen) there.
I’m trying to generate "perfect" words.

Right. It appears to me that there are two things going on. One when there is no space for a hyphen, but there is space for the syllable. And another where there is no space for the syllable (and hence not for the hyphen either). I only get perfect words when the syllable space exceeds the note space. By increasing the font size, people becomes a "perfect" word.

\version "2.19.80"
global = {
\key g \major
\numericTimeSignature
\time 3/4
}

bass = \relative c {
\global
% Music follows here.
r4 r d4 |
g8 g16( fis) g4. a8 |
b8 c d4 r8 d |
c8 b g( d4) e8 |
f8 g f4 r8 r |


}

bassVerse = \lyricmode {
% Lyrics follow here.
Good peo -- ple __ all, this Christ -- mas -- time
Con -- si -- der well __ and bear in mind
}

\score { <<
\new Staff = "tb" {
\clef bass
\new Voice = "bass" {\bass}
}
\new Lyrics \with{
\override LyricText #'font-size = #2
} \lyricsto "bass" \bassVerse
\layout{}
}

Loading...