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: Mats Bengtsson
Subject: Re: \oneVoice and \voiceXX commands having the wrong scope
Date: Fri, 28 Jan 2005 10:42:13 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040913

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 <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?

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 <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





_______________________________________________
lilypond-user mailing list
address@hidden
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: address@hidden
        WWW: http://www.s3.kth.se/~mabe
=============================================




reply via email to

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