lilypond-user
[Top][All Lists]
Advanced

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

Re: resetting accidentals at word breaks


From: David Wright
Subject: Re: resetting accidentals at word breaks
Date: Tue, 28 Apr 2020 23:26:09 -0500
User-agent: Mutt/1.10.1 (2018-07-13)

On Tue 28 Apr 2020 at 15:47:22 (-0400), Fr. Samuel Springuel wrote:
> > On 25 Apr, 2020, at 2:02 PM, David Wright <address@hidden> 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?

I know nothing about scheme, so I can't translate the following into
whatever data structures scheme has available.

The sort of way you might automate the generation of the null voice
could be something like:

a -- b -- c -- d    e -- f    g -- h -- i    j -- k
1    1    1    0    1    0    1    1    0    1    0

1 indicates a non-terminal syllable, 0 a terminal one.

m -- n    o -- p -- q    r    s -- t
1    0    1    1    0    0    1    0    0    0    0

Missing syllables are terminal.

Add the codes:

1    1    1    0    1    0    1    1    0    1    0
1    0    1    1    0    0    1    0    0    0    0
---------------------------------------------------
2    1    2    1    1    0    2    1    0    1    0

An inclusive OR is just as good as addition:

1    1    1    1    1    0    1    1    0    1    0

Potential breakpoints always follow a zero. Naively, one could
generate:

1 -- 1 -- 1 -- 1 -- 1 -- 0    1 -- 1 -- 0    1 -- 0

as the null Lyric, but there might be better ways to feed this
information back into LilyPond.

That's probably all very similar to what you suggested above,
but expressed in slightly different terms. It scales to many
voices, and deals with missing syllables more simply.

Cheers,
David.



reply via email to

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