lilypond-user
[Top][All Lists]
Advanced

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

Re: Changing staff size


From: David Kastrup
Subject: Re: Changing staff size
Date: Mon, 03 Aug 2015 19:42:45 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

Jérôme Plût <address@hidden> writes:

> Quinto Kalendas Augustas MMXV scripsit Kevin Barry :
>> Hi Jerome,
>> 
>> The most relevant part of the manuals for your question is probably here:
>> http://lilypond.org/doc/v2.18/Documentation/notation/
>> changing-context-default-settings
>> 
>> It should answer all of your questions (and there is even an example of how 
>> to
>> store a \with block in a variable.
>
> Thanks for your answer. This explains \with a bit more for me.
> However, \layout is still a mystery, even after reading through
> http://lilypond.org/doc/v2.18/Documentation/notation/the-layout-block
> .
>
> I have a few questions about \layout:
>  * why does, inside a \layout {} block, the macro \context behave
>    differently? Instead of \context Staff = "name", I now have to type
>    \context { \Staff }, which is surprising, and leads to:

\context is not a macro but a keyword.  In layout definitions, this
keyword has a different meaning than in music.  In layout definitions,
it means "a context definition follows".  The first thing in the context
definition is \Staff which means "copy the definition of Staff".

>  * is there a way to point to a specific staff to change the settings
>    only for this one? \layout { \context { \Staff = "name" } }
>    does not work, cf. example below:

No.  But you can define a new type of context:

> \version "2.18.2"
> reduce = \with { fontSize = #-3 }
> \score {
>   \new StaffGroup <<
>   \new Staff = "a" { a a a }
Try
    \new StaffA { a a a }
instead and then
>   \new Staff = "b" { b b b }
>   >>
>   \layout { \context { \Staff = "a" \reduce } }
\layout
{
  \context {
    \Staff
    \name "StaffA"
    \alias "Staff"
  }
  \context {
    \StaffGroup
    \accepts "StaffA"
  }
}

which will take the definition of Staff, reuse it for a context type
called StaffA, will make sure that overrides for "Staff" will get
accepted in "StaffA" as well, and will make StaffGroup contexts also
accept StaffA contexts (you might want to have some other contexts
accept it as well).

>  * is there a way, that I missed, to store in a variable a \with or a
>    \layout block, and then to apply this *to one element of a score
>    only*? The answer your mail pointed to applied it to the whole
>    score.
>    (Overcomplicated idea that might work: is it, for example, possible
>    to clone the Staff context into a SmallerStaff context, and to
>    change the settings for that one?)

See above.

-- 
David Kastrup



reply via email to

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