bug-lilypond
[Top][All Lists]
Advanced

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

Re: strange behaviour of \layout block variable


From: Janek Warchoł
Subject: Re: strange behaviour of \layout block variable
Date: Mon, 21 May 2012 20:49:06 +0200

David,

On Mon, May 21, 2012 at 7:20 AM, David Kastrup <address@hidden> wrote:
> I don't see anything wrong in the _written_ assumptions.  Perhaps the
> misunderstanding is that you consider context definitions as independent
> from layout blocks, and just placed syntactically inside of them for
> some unfathomable reason.  But each layout variable (including
> $defaultlayout) has its own set of context definitions.  You can't
> actually _change_ context definitions using LilyPond rather than Scheme
> code.  If you write something like
>
>>   \context {
>>     \Score
>>     \override Hairpin #'thickness = 3
>>   }
>
> This creates a _copy_ of all definitions in the current Score context
> def, adds an override to it, and uses the result as a new context def.
> This new context def is then used for Score because it contains a
> \name "Score" definition, from the copy of the original Score context
> def.

Thanks for the explanation!  I think i now roughly understand how it works.
However, i find this design somewhat confusing, and i'm wondering
whether it would be possible to change it (if changing it is a good
idea at all).

Going back to what we have, i thought that defining "layoutVariable"
in this way will solve the problem:

layoutVariable = {
  \context {
    \Score
    \override Hairpin #'style = #'dashed-line
  }
}

Interestingly, it works but issues a syntax error.

Surprisingly,

layoutVariable = {
  \override Score.Hairpin #'style = #'dashed-line
}

(which is possible at all thanks to your work) doesn't issue any
error, and does work.
Does this mean that

  \override Score.Hairpin #'style = #'dashed-line

is "better" than

  \context {
    \Score
    \override Hairpin #'style = #'dashed-line
  }

when used in \layout?
Until now i thought these two were equal.

thanks,
Janek



reply via email to

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