lilypond-user
[Top][All Lists]
Advanced

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

Re: Learning LilyPond, comments invited


From: David Kastrup
Subject: Re: Learning LilyPond, comments invited
Date: Fri, 03 Jan 2014 00:56:20 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Colin Tennyson <address@hidden> writes:

> There is the hierarchical ordering:
> Score
>   StaffGroup
>     Staff
>       Voice
>
> (And of course there are additional levels in between, as part of the
> internal Lilypond implementation. )
>
> As you can see in my 10 measure snippet, I inserted a \transpose between
> \Score and \StaffGroup.

No, you didn't.  You used \transpose inside of a \score which starts
with \new StaffGroup.

Totally not the same thing.  \score is a reserved word in the syntax.
\new StaffGroup is music that creates a new context based on the
StaffGroup definition in the current output (either \midi or \layout).

\StaffGroup in an output block _copies_ the current StaffGroup
definition, usually in order to add further material to the copy.  Since
the copy includes the \name "StaffGroup" definition, without overriding
that name the resulting modified copy will replace the original
StaffGroup definition.

Similarly, \Score in an output definition creates a copy of the current
Score definition.  Score is more often than not created implicitly
rather than with \new Score.

> It's a null-transposition: c' c'. I don't comment out the \transpose,
> because then I have to comment out the closing bracket too,

No, you don't.  \transpose c' c' can just be removed and/or inserted.
If a single music expression is preceded with \transpose c' c', the
result is again a single music expression.  And since \score only
accepts a single music expression, you can always insert \transpose c'
g' right before that expression without having to add or remove a single
brace.

> and that would be error prone. I intend to add a \transpose like that
> to every score, to make it transposition-ready.

Every \score is transposition-ready anyway.

> I was able to move all of the layout to \layout, using the \context
> accessor.
> Most of the syntax could be readily inferred:
>
> \StaffGroup
> \override Score.BarNumber.font-size = #1.5

Again, you confuse \StaffGroup and \new StaffGroup.  \StaffGroup is not
generally available in music.  It does not make sense here.

> \layout {
> \context { \Score \override BarNumber.font-size = #1.5 }
> }

If you don't want to "infer syntax":

\layout {
  \override Score.BarNumber.font-suze = #1.5
}

will work just fine.  The difference is that your definition will _only_
affect the current definition of Score in the layout, while the second
syntax will affect _all_ definitions that have a \name _or_ an \alias of
"Score".  Now here the difference is pretty academical since you almost
never want Score to be aliased.  For other contexts, it may be more
interesting.

> But this one took many guesses:
> \StaffGroup
>   \set Score.barNumberVisibility = #(every-nth-bar-number-visible 5)
>
> \layout {
>   \context { \Score barNumberVisibility = #(every-nth-bar-number-visible 5)
> }
> }

Again:

\layout {
  \set Score.barNumberVisibility = #(every-nth-bar-number-visible 5)
}

would also work.

>   \layout 
>   { 
>     indent = 6\cm
>     %#(layout-set-staff-size 18)
>     \context { \Score \hide SystemStartBracket }
>     \context { \Score barNumberVisibility = #(every-nth-bar-number-visible
> 5) }
>     \context { \Score \override BarNumber.break-visibility =
> #end-of-line-invisible }

Uh, overkill.  Every line creates a new copy of the Score definition.
You can instead just write
    \context { \Score
               \hide SystemStartBracket
               barNumberVisibility = #(every-nth-bar-number-visible 5)
               ...
    }

-- 
David Kastrup



reply via email to

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