|
|
Created:
10 years, 8 months ago by Mark Polesky Modified:
9 years, 9 months ago CC:
lilypond-devel_gnu.org Visibility:
Public. |
DescriptionAdds a new context, NullVoice, to provide users with an easier way to have shared lyrics among polyphonic voices.
http://code.google.com/p/lilypond/issues/detail?id=3457
Patch Set 1 #
Total comments: 2
Patch Set 2 : Incorporate Trevor's suggestions. #Patch Set 3 : Rewrite, using a better method. #Patch Set 4 : Complete rewrite. #
Total comments: 1
Patch Set 5 : Fix compile. #Patch Set 6 : Replace transparent items with point-stencils. #Patch Set 7 : Fix an oversight. #Patch Set 8 : Replace point-stencils with #f. #Patch Set 9 : Nitpick. #Patch Set 10 : Minor clarification. #
MessagesTotal messages: 15
Hi folks, here's a patch that adds a new snippet to NR "Automatic part combining": my workaround to get \partcombine to work with lyrics. Is the texidoc too long? Should I leave out how it works? http://code.google.com/p/lilypond/issues/detail?id=3457 Thanks - Mark
Sign in to reply to this message.
The length of text going into the NR needs to be constrained. It is already too long. https://codereview.appspot.com/11328043/diff/1/Documentation/notation/simulta... File Documentation/notation/simultaneous.itely (right): https://codereview.appspot.com/11328043/diff/1/Documentation/notation/simulta... Documentation/notation/simultaneous.itely:1034: {using-partcombine-with-lyrics.ly} No. This is too long and too much of a hack to be included as a selected snippet in the NR. But see next comment ... https://codereview.appspot.com/11328043/diff/1/Documentation/notation/simulta... Documentation/notation/simultaneous.itely:1052: The @code{\partcombine} command can only accept two voices. Leave the text as it was originally, but add something like: "However, this effect can be achieved by adding a separate @code{RhythmicStaff}, and tweaking it so it is completely hidden, and takes up no extra space. A named @code{Voice} context within the @code{RhythmStaff} can contain one of the two combined voices,and the @code{Lyrics} context can use this to align the lyrics. For details see @qq{Using part-combine with lyrics} in @rlsr(Vocal music)."
Sign in to reply to this message.
On 2013/07/16 07:12:13, Trevor Daniels wrote: > https://codereview.appspot.com/11328043/diff/1/Documentation/notation/simulta... > Documentation/notation/simultaneous.itely:1052: The @code{\partcombine} command > can only accept two voices. > Leave the text as it was originally, but add something > like: > "However, this effect can be achieved by adding a separate > @code{RhythmicStaff}, and tweaking it so it is completely > hidden, and takes up no extra space. A named @code{Voice} > context within the @code{RhythmStaff} can contain one of > the two combined voices,and the @code{Lyrics} context can > use this to align the lyrics. For details see > @qq{Using part-combine with lyrics} in > @rlsr(Vocal music)." Folks, this is the reference manual, not "obscure hacks for adventureous geeks". If we anticipate that a task is common enough to warrant an entry in the reference manual, it warrants a user interface. We might or might not want to cobble this user interface together using a technique like that, but if we are really proud of it, we can still point out that the implementation, to be found in xxx.ly, might be instructive. So what would be a nice and natural user interface, and what pieces are missing from it?
Sign in to reply to this message.
On 2013/07/18 20:47:05, dak wrote: > Folks, this is the reference manual, not "obscure hacks > for adventureous geeks". If we anticipate that a task is > common enough to warrant an entry in the reference manual, > it warrants a user interface. Fair enough. > We might or might not want to cobble this user interface > together using a technique like that, but if we are really > proud of it, we can still point out that the > implementation, to be found in xxx.ly, might be > instructive. > > So what would be a nice and natural user interface, and > what pieces are missing from it? << \new Staff \with { printPartCombineTexts = ##f } << \new HiddenVoice = "voiceForLyrics" \sopranoNotes \new Voice { \key g \major \partcombine \sopranoNotes \altoNotes } >> \new Lyrics \lyricsto "voiceForLyrics" \words >> "HiddenVoice" could also be "LyricsVoice" I suppose, but "HiddenVoice" seems more sematically flexible. This interface could possibly also solve another problem that I have from time to time: in chorales, when the voices use the same lyrics but have slightly different rhythms, sometimes it's preferable to print a lyric syllable *in between* where it would fall in the different voices. A hidden voice (that the lyrics could align with) could solve that (as long as it doesn't alter the spacing of the printed voices, that is). As for its usefulness, for me it would be an enormous time-saver. A lot of my LilyPond work is typesetting 4-part choir pieces, and without this feature I often end up entering two voices as one like this: upperNotes = \relative d' { <d g>4 << { fis8( g) } \\ d4 } >> <d a'>4 <d g> | <d c'>4 <d c'> <d b'>2 } ... just so the Lyrics context has something to align to. Each time the voices diverge rhythmically, I have to enter a new << { ... } \\ { ... } >> construct, which gets tedious, difficult to maintain, and impossible to extract the individual parts from. If I really need to extract voices later, then I'm stuck going through each voice adding \voiceOne and \voiceTwo all over the place, which is no less tedious. And then if I need to transpose it, half of the stem directions are wrong. So yes, I would save untold hours if I had this feature. I can't speak for anyone else, but we might ask the other choral-music typesetters among us for their opinion. - Mark
Sign in to reply to this message.
markpolesky@gmail.com> wrote Friday, July 19, 2013 7:10 AM > On 2013/07/18 20:47:05, dak wrote: > >> So what would be a nice and natural user interface, and >> what pieces are missing from it? > > << > \new Staff \with { printPartCombineTexts = ##f } << > \new HiddenVoice = "voiceForLyrics" \sopranoNotes > \new Voice { > \key g \major > \partcombine \sopranoNotes \altoNotes > } > >> > \new Lyrics \lyricsto "voiceForLyrics" \words > > "HiddenVoice" could also be "LyricsVoice" I suppose, but > "HiddenVoice" seems more sematically flexible. > > So yes, I would save untold hours if I had this feature. I > can't speak for anyone else, but we might ask the other > choral-music typesetters among us for their opinion. I agree entirely. A Voice context that did not take part in layout or midi would be a great help in choral music. Trevor
Sign in to reply to this message.
On 2013/07/19 06:10:17, Mark Polesky wrote: > On 2013/07/18 20:47:05, dak wrote: > > Folks, this is the reference manual, not "obscure hacks > > for adventureous geeks". If we anticipate that a task is > > common enough to warrant an entry in the reference manual, > > it warrants a user interface. > > Fair enough. > > > We might or might not want to cobble this user interface > > together using a technique like that, but if we are really > > proud of it, we can still point out that the > > implementation, to be found in xxx.ly, might be > > instructive. > > > > So what would be a nice and natural user interface, and > > what pieces are missing from it? > > << > \new Staff \with { printPartCombineTexts = ##f } << > \new HiddenVoice = "voiceForLyrics" \sopranoNotes > \new Voice { > \key g \major > \partcombine \sopranoNotes \altoNotes > } > >> > \new Lyrics \lyricsto "voiceForLyrics" \words > >> > > "HiddenVoice" could also be "LyricsVoice" I suppose, but > "HiddenVoice" seems more sematically flexible. > > This interface could possibly also solve another problem > that I have from time to time: in chorales, when the voices > use the same lyrics but have slightly different rhythms, > sometimes it's preferable to print a lyric syllable *in > between* where it would fall in the different voices. A > hidden voice (that the lyrics could align with) could solve > that (as long as it doesn't alter the spacing of the printed > voices, that is). > > As for its usefulness, for me it would be an enormous > time-saver. A lot of my LilyPond work is typesetting 4-part > choir pieces, and without this feature I often end up > entering two voices as one like this: > > upperNotes = \relative d' { > <d g>4 << { fis8( g) } \\ d4 } >> <d a'>4 <d g> | > <d c'>4 <d c'> <d b'>2 > } > > ... just so the Lyrics context has something to align to. Ok. Is the _output_ from the following what you'd consider appropriate? sopranoNotes = { c''2 d''4 e'' } altoNotes = { \repeat unfold 8 { a'16 g'16 } } words = \lyricmode { Oh my head } << \new Staff \with { printPartCombineTexts = ##f \accepts "Devnull" } << \new Voice { \key g \major \partcombine \sopranoNotes \altoNotes } \new Devnull = "aligner" { \sopranoNotes } >> \new Lyrics \lyricsto "aligner" \words >> Basically, the question is whether we can do something like NullVoice and get along without any engravers/properties in it.
Sign in to reply to this message.
On 2013/07/19 08:27:20, dak wrote: > Ok. Is the _output_ from the following what you'd consider appropriate? > > sopranoNotes = { c''2 d''4 e'' } > altoNotes = { \repeat unfold 8 { a'16 g'16 } } > words = \lyricmode { Oh my head } > > << > \new Staff \with { printPartCombineTexts = ##f \accepts "Devnull" } << > \new Voice { > \key g \major > \partcombine \sopranoNotes \altoNotes > } > \new Devnull = "aligner" { \sopranoNotes } > >> > \new Lyrics \lyricsto "aligner" \words > >> > > Basically, the question is whether we can do something like NullVoice and get > along without any engravers/properties in it. David, you and your elegant solutions! Yes, the output is excellent, except there's an odd beam inconsistency in the last beat which I don't understand. But this solution is already a vast improvement. However, consider this example (which doesn't work using your Devnull method). Ideally, what I'd want is to have the "2" horizontally centered between the NoteColumn with the alto F and the NoteColumn with the soprano B: sopranoNotes = \relative c'' { c4. b8 c2 } altoNotes = \relative e' { e4 f e2 } alignerNotes = { c4~ c16 c8. c2 } words = \lyricmode { "1" "2" "3" } << \new Staff \with { printPartCombineTexts = ##f \accepts "Devnull" } << \new Voice { \partcombine \sopranoNotes \altoNotes } \new Devnull = "aligner" { \alignerNotes } >> \new Lyrics \lyricsto "aligner" \words >> I actually *can* get this to work with my "adventurous geek" method, except with my method the horizontal spacing is altered in an unsatisfactory way. To be clear, there are two separate effects I'd like to achieve with this one interface: 1) aligning lyrics to one of the two partcombined voices 2) aligning lyrics to a third (hidden) voice, without altering spacing It seems to me that you've nearly solved the first effect, and I have no idea how easy or hard the second one would be. Thanks again. - Mark
Sign in to reply to this message.
On 2013/07/19 09:42:54, Mark Polesky wrote: > On 2013/07/19 08:27:20, dak wrote: > > Basically, the question is whether we can do something like NullVoice and get > > along without any engravers/properties in it. > > excellent, except there's an odd beam inconsistency in the > last beat which I don't understand. It's the partcombiner who does not wait for the end of the first voice before switching its mode, thus interrupting the beaming. Not related to the Devnull stuff, but I was too lazy to cook up a better working example as the fault is not related to this topic. > But this solution is > already a vast improvement. > > However, consider this example (which doesn't work using > your Devnull method). Ideally, what I'd want is to have the > "2" horizontally centered between the NoteColumn with the > alto F and the NoteColumn with the soprano B: > > To be clear, there are two separate effects I'd like to > achieve with this one interface: > > 1) aligning lyrics to one of the two partcombined voices > 2) aligning lyrics to a third (hidden) voice, without altering spacing It's more like 3) aligning lyrics to non-existing note columns. LilyPond does not align reasonably to non-existing note columns anyway. One could try fudging in pseudo_engravers that create note-busy events, but you'll still have the problem that you _either_ need to reserve space (defeating the "without altering spacing" purpose) _or_ don't get reasonable positioning.
Sign in to reply to this message.
On 2013/07/19 10:48:43, dak wrote: > > To be clear, there are two separate effects I'd like to > > achieve with this one interface: > > > > 1) aligning lyrics to one of the two partcombined voices > > 2) aligning lyrics to a third (hidden) voice, without > > altering spacing > > It's more like > > 3) aligning lyrics to non-existing note columns. > > LilyPond does not align reasonably to non-existing note > columns anyway. One could try fudging in pseudo_engravers > that create note-busy events, but you'll still have the > problem that you _either_ need to reserve space (defeating > the "without altering spacing" purpose) _or_ don't get > reasonable positioning. Is there no way to extract the averages of the NoteColumn X-positions between two voices? So given these voices: \relative c'' { c4. b8 c2 } \relative e' { e4 f e2 } ... then the respective X-positions, measured in beats (pardon the oversimplification), would be: (0 1.5 2) (0 1 2) The remaining calculation is trivial: (define avg (lambda (x . rest) (/ (apply + (cons x rest)) (1+ (length rest))))) (map avg '(0 1.5 2) '(0 1 2)) ==> (0 1.25 2) Is there a way to tell the Lyrics context to align notes to the newly calculated X-positions? I may be out of my league, but this would be really helpful; all the workarounds that I've come up with are really ugly. Here's a real-world example: http://www.markpolesky.com/norobots/Day-Is-Done.png This happens often enough to be a real pain. Thanks - Mark
Sign in to reply to this message.
On 2013/07/19 19:35:13, Mark Polesky wrote: > Is there no way to extract the averages of the NoteColumn > X-positions between two voices? So given these voices: Please check out <URL:http://code.google.com/p/lilypond/issues/detail?id=3232>. Its original title was "LilyPond should use strict proportional spacing between note columns" before people decided to hijack that issue for something else, rename it to something utterly unrelated and then leave it alone. But most of the discussion in the issue is about the original topic which is what you are asking about.
Sign in to reply to this message.
David, I've been playing around with your Devnull workaround, and it's great! An independent "aligner" voice works as long as there are NoteColumns in the printed voices that it can line up with, though this is still really useful. (I'm willing to put aside the "averaging NoteColumn X-positions" thing for the moment, and explore this direction.) Anyway, I had to add the Slur_engraver to your Devnull context in order to get the melismas to work right, but already this method solves a long-standing problem: getting all the lyric extenders to print properly when the melismas happen at different times in different voices: ******************** sopranoNotes = \relative e' { e8( f g a) g2 | e1 } altoNotes = \relative c' { c2 e8( d c b) | c1 } alignerNotes = { c8( c c c) c( c c c) | c1 } words = \lyricmode { one __ two __ three } << \new Staff \with { \accepts "Devnull" printPartCombineTexts = ##f } << \new Voice { \partcombine \sopranoNotes \altoNotes } \new Devnull = "aligner" \with { \consists "Slur_engraver" } { \alignerNotes } >> \new Lyrics \lyricsto "aligner" \words >> ******************** However, I can't get it to work with ties, even when adding the Tie_engraver and Tie_performer to the Devnull context. At this point I'm stabbing in the dark. Any ideas? ******************** sopranoNotes = \relative e' { e4. e8~ e4 e } altoNotes = \relative e' { c4. c8~ c4 c } alignerNotes = \sopranoNotes words = \lyricmode { one two __ three } << \new Staff \with { \accepts "Devnull" printPartCombineTexts = ##f } << \new Voice { \partcombine \sopranoNotes \altoNotes } \new Devnull = "aligner" \with { \consists "Slur_engraver" \consists "Tie_engraver" \consists "Tie_performer" } { \alignerNotes } >> \new Lyrics \lyricsto "aligner" \words >> ******************** Thanks. - Mark
Sign in to reply to this message.
Here's a patch that adds a new context, NullVoice, to provide users with an easier way to have shared lyrics among polyphonic voices, which also allows using lyrics with \partcombine. This is a complete rewrite of a similar patch from a month ago. Please review. Thanks! - Mark
Sign in to reply to this message.
LGTM, apart from one suggested change that I'd like to see. https://codereview.appspot.com/11328043/diff/21001/Documentation/notation/voc... File Documentation/notation/vocal.itely (right): https://codereview.appspot.com/11328043/diff/21001/Documentation/notation/voc... Documentation/notation/vocal.itely:1716: @end lilypond I don't think we need an illustration of this particular point. In general we avoid showing incorrect or inadvisable examples - they can mislead to users who do not read the text carefully or completely. Instead, just change the text to "For example, arbitrary notes in @code{NullVoice} may cause accidentals to be incorrectly cancelled or inserted in the visible voices."
Sign in to reply to this message.
LGTM. interesting approach.
Sign in to reply to this message.
2013/7/19 <dak@gnu.org>: > On 2013/07/19 19:35:13, Mark Polesky wrote: >> Is there no way to extract the averages of the NoteColumn >> X-positions between two voices? So given these voices: > > Please check out > <URL:http://code.google.com/p/lilypond/issues/detail?id=3232>. Its > original title was "LilyPond should use strict proportional spacing > between note columns" before people It was not "people", it was me. > decided to hijack that issue for > something else, rename it to something utterly unrelated and then leave > it alone. Hey, that's not fair! Indeed, i sort of hijacked that issue (it wasn't my intention to hijack it, though) and i apologize for that. However, i *did write* a fix for this, and as far as i can tell the fix is sound. Unfortunately, it didn't make it to master (partly because it become a part of a bigger patch which didn't get enough reviews) and now it's waiting for the new stable to be released. If you'd like, i could separate the fix for this issue from the big patch and submit it now. best, Janek
Sign in to reply to this message.
|