> On 25 Apr, 2020, at 2:02 PM, David Wright <lily...@lionunicorn.co.uk> wrote:
> 
> So you need a NullLyric which contains your "controlling" lyrics, but
> which is not printed (and occupies no space).

My attempt to create such a context is attached.  Unfortunately, the “occupies 
no space” thing still has me scratching my head.

> This lyric would have
> very long "words" whose syllables are all hyphenated together unless
> every real lyric line has a word break at that point. It could be
> hand-crafted in the first instance or, with more ingenuity,
> automatically constructed from the other lyrics. Good luck.

My lyrics are all entered in variables which look like: x = \lyricmode { some 
wordy -- words }

Using \displayMusic, I see these are make-music expressions with an elements 
list inside them containing 1 element per syllable.  If a hyphen follows a 
syllable, then the corresponding element of the list has a HyphenEvent in its 
articulations property.

So an algorithm for combining lyrics (lyrics_one and lyrics_two) would look 
like this:

1) Find the longer of lyrics_one and lyrics_two (referred to hereafter as 
lyrics_max, the other is lyrics_min)
2) loop over syllables (the elements list) in lyrics_max
        2a) if concurrent syllable (element at same index) exists in lyrics_min 
(or more specifically the elements list in lyrics_min)
                true) continue
                false) break out of loop
        2b) if current syllable of lyrics_max does has a HyphenEvent in its 
list of articulations
                true) continue
                false) if the concurrent syllable of other lyrics has a 
HyphenEvent in its list of articulations
                        true) add a HyphenEvent to list of articulations in 
current syllable of lyrics_max
                        false) continue
3) return lyrics_max

Does that sound like a reasonable algorithm for implementation in scheme?

✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝✝
Fr. Samuel, OSB
(R. Padraic Springuel)
St. Anselm’s Abbey
4501 South Dakota Ave, NE
Washington, DC, 20017
202-269-2300
(c) 202-853-7036

PAX ☧ ΧΡΙΣΤΟΣ

Attachment: null_lyrics.ly
Description: Binary data

Reply via email to