lilypond-user
[Top][All Lists]
Advanced

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

Re: Lilypond structure / implicit - explicit / with statement


From: Thomas Morley
Subject: Re: Lilypond structure / implicit - explicit / with statement
Date: Sun, 3 Apr 2016 23:33:19 +0200

2016-04-03 20:55 GMT+02:00 Bernard <address@hidden>:
> On 03-04-16 17:57, Paul Morris wrote:
>>>
>>> On Apr 3, 2016, at 11:53 AM, Paul Morris <address@hidden> wrote:
>>>
>>> This should help:
>>>
>>> http://lilypond.org/doc/v2.18/Documentation/notation/changing-context-default-settings#index-_005cwith-3
>>
>> See also:
>>
>> http://lilypond.org/doc/v2.18/Documentation/notation/modifying-context-plug_002dins#index-_005cwith
>>
>> -Paul
>
> Hi Paul,
>
> That does help. I found out \with is a very special statement.
>
> It influence what happens before the statement, it must be executed just
> after \new . That is the reason why my examples 4 and 5 did not work.
> And it influence what happens after the statement. If within the Staff not a
> additional Staff property can be set.

No!!

To give an image.
Think of a house. It is built in a certain way from the fundament up
to the roof.
(Ofcourse this house may have different rooms.)
It likely contains furniture and other stuff.
And ofcourse there may be people living in the house.

Back to LilyPond.
Replace house by Staff,
The Staff-context is built from certain engravers. It is sorted among
other context (you live in a city).
Staff contains other settings as well, the furniture.
And is parent to other contexts, p.e. Voices, the rooms.
Replace there living people with music.

If you write
\new Staff \new Voice { c'1 }
you have the note c' living in the Voice-context (the room), which is
part of Staff (the house)

If you want to change something for someone in a room (voice) you can
apply tweaks/overrides/context-settings for them. Those are in general
sort of temporarary
\new Staff \new Voice { c'1 \override NoteHead.color = #red c' \revert
NoteHead.color c'  }

If you want to change it for all people in the room one possibility is
to add something to the furniture of the room, i.e. add something to
the fundamental settings of said room (voice).
\new Staff \new Voice \with { \override NoteHead.color = #red } { c'1 c' c' }
Ofcourse this is revertable.
\new Staff \new Voice \with { \override NoteHead.color = #red } { c'1
c' \revert NoteHead.color c' }

If you want to change it for every room in the house, apply it to the
house (staff)
\new Staff \with { \override NoteHead.color = #red } \new Voice { c'1
c' \revert Staff.NoteHead.color c' }
The difference is more obvious if you watch more than one room (voice):

\new Staff <<
  \new Voice \with { \override NoteHead.color = #red }
    { \voiceOne c'1 c' c' }
  \new Voice \with { \override NoteHead.color = #cyan }
    { \voiceTwo c1 c \revert NoteHead.color c }
>>

\new Staff
  \with { \override NoteHead.color = #red }
  <<
    \new Voice
      \with { \override NoteHead.color = #green }
      { \voiceOne c'1 \revert NoteHead.color c' \revert
Staff.NoteHead.color c' }
    \new Voice
      \with { \override NoteHead.color = #cyan }
      { \voiceTwo c1 \revert NoteHead.color c  c }
  >>

For testing such things I always use colors, they are not that invasive.
Your own examples uses StaffSymbol-overrides which is bad, if you want
to research things. You can't change one and the same grob on the fly.
Every of your examples has only _one_ StaffSymbol-grob. So you can't
see anything  useful.


HTH,
  Harm



reply via email to

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