lilypond-user
[Top][All Lists]
Advanced

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

Re: \oneVoice and \voiceXX commands having the wrong scope


From: Yuval Harel
Subject: Re: \oneVoice and \voiceXX commands having the wrong scope
Date: Wed, 26 Jan 2005 18:40:19 +0200
User-agent: Opera M2/7.54 (Win32, build 3865)

On Wed, 26 Jan 2005 10:19:54 +0100, Mats Bengtsson <address@hidden> 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?

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 <address@hidden> 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
address@hidden
http://lists.gnu.org/mailman/listinfo/lilypond-use
r






reply via email to

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