Hackers: Is my guess below correct? In that case, wouldn't it be better to change the routine that invents new context identifiers so it never gives the names "1", ..., "4"?
Yuval Harel wrote:
On Wed, 26 Jan 2005 10:19:54 +0100, Mats Bengtsson <[EMAIL PROTECTED]> wrote:
I think you have not fully realized how <<{...} \\ {...}>> works. Your first example is equivalent to
\new Staff {
\clef bass
\context Voice="1" {
\oneVoice
c'2-\markup {\column < "oneVoice" "(This markup generates a programming error)">} r2 |
<< \context Voice = "1" {\voiceOne b2-"Polyphony" r2}
\context Voice = "2" {\voiceTwo g2 r2} >>
c'2-"oneVoice should still be in effect here." r2 |
} |
}
Since you have the same name "1" for your main voice as is implicitly given to the upper voice by <<{...} \\ {...}>> and since a context is uniquely determined by its name, they are actually the same voice, so any setting that is done within the upper voice of the <<{...} \\ {...}>> will remain after the polyphonal part.
OK, that makes sense. I expected the \voiceOne to end when it reaches "}", but I
realize now that would prevent declaring variables like {\voiceOne \tieDown} etc.
I still don't understand the second example - the outer voice is not named "1" here,
and still the changes in voice "1" take effect in the outer voice. Is this the
correct behavior too?
I guess what happens is the following: When LilyPond creates a voice context to handle the notes, it invents a name for it. My guess is that it actually gives it the name "1" (since it's the first Voice context in the score), which explains the behaviour.
/Mats
Of course, if you give another name than "1" to your main Voice context, your examples will work as you expect.
I usually use \context Voice="1" {\oneVoice ...} when there are many polyphonic
moments in the music. I've found it makes notation simpler when there is one main
voice, with some other voices occasionally appearing - I don't have to notate in
an unnatural way when I want ties and slurs going in and out of these polyphonic
moments.
I think I'll try getting along without it now that I'm aware of this complication.
Yuval
/Mats
Yuval Harel wrote:
\oneVoice scope too short:
==========================
\version "2.4.2"
\new Staff {
\clef bass
\context Voice="1" {
\oneVoice
c'2-\markup {\column < "oneVoice" "(This markup generates a programming error)">} r2 |
<< {b2-"Polyphony" r2} \\ {g2 r2} >>
c'2-"oneVoice should still be in effect here." r2 |
} |
}
\voiceOne scope too long:
=========================
\version "2.4.2"
\new Staff {
\clef bass
c'2 r2 | % commenting out this line eliminates the problem
<< {\voiceOne r1-"voiceOne"} >> |
c'2-"voiceOne is still in effect" r2
\oneVoice
r1-\markup {\column <"oneVoice" "(This markup generates a programming error)">} |
}
On Wed, 26 Jan 2005 00:22:14 +0100, Erik Sandberg <[EMAIL PROTECTED]> wrote:
On Tuesday 25 January 2005 15.03, Yuval Harel wrote:
Hi,
I found that \oneVoice and \voiceOne sometimes have unexpected effects.
Here are two examples which might be two separate bugs.
When preparing the examples I also noticed that adding markup can
sometimes generate programming errors in these
situations.
The mailing list strips attachments. Could you please resend it, pasted into
the message?
Erik
_______________________________________________ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-use r
_______________________________________________ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-use r
-- ============================================= Mats Bengtsson Signal Processing Signals, Sensors and Systems Royal Institute of Technology SE-100 44 STOCKHOLM Sweden Phone: (+46) 8 790 8463 Fax: (+46) 8 790 7260 Email: [EMAIL PROTECTED] WWW: http://www.s3.kth.se/~mabe =============================================
_______________________________________________ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user