Re: I want to develop automatic lyric contraction
Bertalan Fodor (LilyPondTool) wrote: Hi, I'd like to dig myself into the C++ source of LilyPond. I have a long-wished feature, for support automatic lyric contraction. That means the following: When there is not enough space for a hyphen to appear, the hyphen is removed. Like instead of yeah - yeah - yeah, yeah yeah yeah. In these cases I would like LilyPond to automatically contract it to yeahyeah - yeah, moving the syllables, taking kerning into account. How would this contracted syllable be aligned to the two note heads? /Mats ___ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: I want to develop automatic lyric contraction
Generally I would fix the first syllable's position (leaving it as it is), and then move the following ones closer to the first. I believe this would always produce pleasant results, as if one of the last syllables would go too early, then it would be still long enough to remain under the corresponding note (because if it weren't long, then it wouldn't make the hyphen disappear in normal spacing.) However, there should be a way to change the first syllable's position, because in the hand-engraved scores I looked at, they often follow special rules: generally a syllable has 3 letters, it is centered under the note, but a 2 letter syllable is aligned to the left side of the note. So if you have a word with 2 syllables, like money, then in contraction ney will still be centered under its note, but mo will be moved to the right. But this is not general rule, so I think it would be enought to make sure there is a property, which in contraction situations would allow me to override the default spacing. Bert Mats Bengtsson wrote: Bertalan Fodor (LilyPondTool) wrote: Hi, I'd like to dig myself into the C++ source of LilyPond. I have a long-wished feature, for support automatic lyric contraction. That means the following: When there is not enough space for a hyphen to appear, the hyphen is removed. Like instead of yeah - yeah - yeah, yeah yeah yeah. In these cases I would like LilyPond to automatically contract it to yeahyeah - yeah, moving the syllables, taking kerning into account. How would this contracted syllable be aligned to the two note heads? /Mats ___ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: I want to develop automatic lyric contraction
On Mon, Jun 22, 2009 at 9:25 AM, Bertalan Fodor (LilyPondTool)lilypondt...@organum.hu wrote: I'd like to dig myself into the C++ source of LilyPond. I have a long-wished feature, for support automatic lyric contraction. That means the following: When there is not enough space for a hyphen to appear, the hyphen is removed. Like instead of yeah - yeah - yeah, yeah yeah yeah. In these cases I would like LilyPond to automatically contract it to yeahyeah - yeah, moving the syllables, taking kerning into account. Do you think it is feasible without major rewrite? I do see some callback to the lyric syllable in the hyphen engraver, but I'm not sure about it. I think it would be a difficult to implement. You'd have to replace the hyphen code and write code that checks the distance between this syllable and the next; if that distance is too small, it would remove or make transparent the following syllable, and change the text of the 1st to be the contracted version. There are some other hairy issues: in general, any contraction can change the spelling of a word, so what happens if you have a - b - c - d - e and it is set very tightly? Any contraction change the spelling of any syllable (and the space it takes up), so how do you decide between contracting aB - c - d - e and a - b - Cd - e first? the changed spelling may alter the size of the word, and may trigger another round of contractions. -- Han-Wen Nienhuys - han...@xs4all.nl - http://www.xs4all.nl/~hanwen ___ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: I want to develop automatic lyric contraction
Han-Wen Nienhuys wrote: On Mon, Jun 22, 2009 at 9:25 AM, Bertalan Fodor (LilyPondTool)lilypondt...@organum.hu wrote: I'd like to dig myself into the C++ source of LilyPond. I have a long-wished feature, for support automatic lyric contraction. That means the following: When there is not enough space for a hyphen to appear, the hyphen is removed. Like instead of yeah - yeah - yeah, yeah yeah yeah. In these cases I would like LilyPond to automatically contract it to yeahyeah - yeah, moving the syllables, taking kerning into account. Do you think it is feasible without major rewrite? I do see some callback to the lyric syllable in the hyphen engraver, but I'm not sure about it. I think it would be a difficult to implement. You'd have to replace the hyphen code and write code that checks the distance between this syllable and the next; if that distance is too small, it would remove or make transparent the following syllable, and change the text of the 1st to be the contracted version. There are some other hairy issues: in general, any contraction can change the spelling of a word, so what happens if you have a - b - c - d - e and it is set very tightly? Any contraction change the spelling of any syllable (and the space it takes up), so how do you decide between contracting aB - c - d - e and a - b - Cd - e first? the changed spelling may alter the size of the word, and may trigger another round of contractions. I'd go one syllable by one. Also, I would not allow automatic change of spelling - that is generally impossible without a full hyphenation engine with dictionary (even in those cases it often mistakes), so the user would have to explicitly set spell-changing upon contraction. I can hardly imagine cases when the respelling results in more space, but certainly that would call for some handling - but that could be solved by the user by setting the minimum-distance in those places. Bert ___ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel