[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Manipulating lyrics with a music function
From: |
David F. |
Subject: |
Manipulating lyrics with a music function |
Date: |
Fri, 8 Oct 2021 21:24:33 -0600 |
macOS 10.14.6, Lilypond 2.22.1
The syntax for adding quotes to lyrics is a little cluttered, so I thought I’d
whip up a couple of little helper functions to tidy things up. Two hours later
I’m reaching out to the mailing list for help. The example below is failing in
two ways. First, I can’t figure out how to actually interpolate the syllable
that is the input to my functions into the output. Second, the hyphen between
the first two syllables is lost.
Help?
David F.
\version "2.22"
\layout {
\context {
\Lyrics
\override LyricHyphen.minimum-distance = #1.0
}
}
openQuote = #(define-music-function (syllable) (ly:music?)
#{ \lyricmode { "\"In" } #}
)
closeQuote = #(define-music-function (syllable) (ly:music?)
#{ \lyricmode { "ble,\"" } #}
)
\relative { \time 3/4 e'4 e4. e8 d4 e d c2. }
\addlyrics { \openQuote In -- com -- pa -- ra -- \closeQuote ble, said she }
- Manipulating lyrics with a music function,
David F. <=