bug-lilypond
[Top][All Lists]
Advanced

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

Re: Duration of contexts?


From: Mats Bengtsson
Subject: Re: Duration of contexts?
Date: Tue, 03 May 2005 14:15:21 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.7) Gecko/20050414

As I said, I didn't consider it a bug but a feature.
Short-lived contexts do die and I haven't objected against that.
The feature is that contexts that are completely empty at the
top of the score never die. Here are two illustrating examples.
The second one shows why I find this a useful feature. Without it,
I would need to find out how many empty bars to include in an
initial   \context Lyrics = "above" {s1*10}.

\version "2.5.20"

% Useless illustration of the feature

\score{ \relative c' <<
  \context Staff = "eternal" {}
  \context Staff = "ephemeral" {s1}
  \context Staff = "main" {
    c1 | c1
    << c1
      \context Staff = "ephemeral" { e1^"ephemeral" }
      \context Staff = "eternal" { g1^"eternal" }
    >>
    c1 | c1
    << c1
      \context Staff = "ephemeral" { e1^"ephemeral" }
      \context Staff = "eternal" { g1^"eternal" }
    >>
  }
>>
}


% Useful illustration of the feature

\score{ <<
  \context Lyrics = "above" {}
  \new Staff  \context Voice = "main" \relative c' {
      c1 d <<
        \context Voice = "upper" {\voiceOne e2 d2} \voiceTwo c1 >>
      \oneVoice e }
  \new Lyrics \lyricsto "main" {do re do mi }
  \context Lyrics = "above" \lyricsto "upper" { mi re }
>> }


   /Mats



Han-Wen Nienhuys wrote:
Mats Bengtsson wrote:

Hi,

In several examples and templates in the manual, we use constructs like

\context Lyrics = "somename" {s1*20}

to create an empty context that will live for at least 20 bars.
However, I noticed more or less by accident that if you instead do

\context Lyrics = "somename" { }

then you'll get a context that is automatically kept alive during the
full score. Of course, this feature is very nice since you don't have
to calculate how many empty bars are needed.
If this is a deliberate feature, then it should be properly documented
and advertised in the manual and all the corresponding examples should
be modified to use the feature. If it's just a coincidence, I strongly
recommend to make it a supported feature.


Imagine the performance impact if contexts (eg. short-lived like << c \\ d >> ) never die.

Bugreport please.



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