Hi Bernard,
I would like to try and explain it in other words as the manual:
music with implicit voice and staff:
{ c' }
music with explicit staff and implicit voice:
\new Staff { c' }
adding a with statement:
\new Staff \with { clefPosition = 2 } { c' }
Please note here: There must be no { after Staff, because that would
start a music expression. The braces are not just for grouping things
but they start a music expression and \with must come before the music
starts. Think of it as a function, if the first argument starts with {
it is music and not a \with block:
\new Staff \with { clefPosition = 2 } { c' }
^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^
function optional argument (not music) music
Alternatively, you can put this into a layout block:
\layout {
\context {
\Staff
clefPosition = 2
}
}
%or
\layout {
\set Staff.clefPosition = 2
}
## Contexts and objects
Contexts are different from graphical objects and their properties
(prop) are changed differently (explained in the docs). Just a summary
here (val means value):
contexts (Staff, Voice, …) Ctx | graphical objects (Clef, …) obj
-----------------------------------------------------------------------
in music:
{ \set Ctx.prop = val } | { \override Ctx.obj.prop = val }
in with block:
\with { prop = val } | \with { \override Ctx.obj.prop = val }
in layout block (variant 1):
\layout { \context { \Ctx | \layout { \context { \Ctx
prop = val } | \override obj.prop = val }
in layout block (variant 2):
\layout { \set Ctx.prop = val } | \layout{\override Ctx.obj.prop = val }
td;dr: (1) be careful with {}
(2) read the input as functions with some optional arguments
(3) context properties and object properties are different
HTH,
Joram
PS: I know you said you won't try any longer, but perhaps this will help
someone.
_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user