On Oct 8, 2021, at 10:33 PM, Aaron Hill <lilyp...@hillvisions.com> wrote:
> On 2021-10-08 8:24 pm, David F. wrote: >> 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. > > Your functions could accept the text as markup. Also, you should strongly > consider using typographer's quotes, which can be input directly as UTF-8 or > using character shorthand neither of which requires messing about with > escaping: > > %%%% > \paper { #(include-special-characters) } > \relative { \time 3/4 e'4 e4. e8 d4 e d c2. } > \addlyrics { &elqq;In -- com -- pa -- ra -- ble,&erqq; said she } > > openQuote = #(define-scheme-function (text) (markup?) #{ \markup \concat { “ > #text } #}) > closeQuote = #(define-scheme-function (text) (markup?) #{ \markup \concat { > #text ” } #}) > \relative { \time 3/4 e'4 e4. e8 d4 e d c2. } > \addlyrics { \openQuote In -- com -- pa -- ra -- \closeQuote ble, said she } > %%%% Thanks Aaron, that’s great. Yes, using typographer’s quotes was one of my motivations for making the helper functions in the first place. I did notice that the \markup defeats lyric ties. It’s not a big deal—that combo only occurs once in the songs I have. But now I’m curious. What do lyric syllables get turned into? A LyricEvent? Is it possible to build and return a LyricEvent from a function? %%%% openQuote = #(define-scheme-function (text) (markup?) #{ \markup \concat { “ #text } #}) closeQuote = #(define-scheme-function (text) (markup?) #{ \markup \concat { #text ” } #}) \relative { \time 3/4 e'4 e4. e8 d4 e d c2. } \addlyrics { \openQuote O~In -- com -- pa -- ra -- \closeQuote ble, said she } %%%% David F.