bug-lilypond
[Top][All Lists]
Advanced

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

Re: \once \set Timing.defaultBarType fails!


From: Mats Bengtsson
Subject: Re: \once \set Timing.defaultBarType fails!
Date: Thu, 08 Feb 2007 12:56:26 +0100
User-agent: Thunderbird 1.5.0.9 (X11/20061206)



Han-Wen Nienhuys wrote:
Mats Bengtsson escreveu:
Why do the bar lines disappear completely in the following example?

\version "2.11.15"
\relative{
c1 | \once \set Timing.defaultBarType = ":"  c1 | c1 |
}

If you remove the \once, it works as expected and \once \set works
correctly
in other situations.

wild guess: becuase defaultBarType is defined in Score, not Global.
\once restores the value from the enclosing context.
It seems that you are right. Adding
\layout{
 \context{
   \Global
   defaultBarType = "|"
 }
}
results in solid bar lines. Still, it seems that \once \set Timing.defaultBar isn't useful, since a \set Timing.defaultBar that appears at a bar line isn't noticed until the end of the next measure, i.e. you need at least one note between the setting and the bar line. Since this note will "consume" the \once, neither of
\once \set Timing.defaultBar = "dashed" c1 |
or
c1 \once \set Timing.defaultBar = "dashed" |
will work. Of course, a better solution in this specific case is probably to
use \bar "dashed" instead.

However, I'm really confused by your statement that \once restores the value
from the *enclosing* set. I had the impression that \set and \revert stored values on a stack that's specific to the corresponding context and that \once \set was equivalent to \push ... \pull, but from your answer it seems that this isn't the case.

  /Mats






reply via email to

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