On 5/11/10 10:27 AM, "James Lowe" <james.l...@datacore.com> wrote:
> Hello,
>
> Graham Percival wrote:
>> On Thu, Apr 29, 2010 at 2:24 PM, Carl Sorensen <c_soren...@byu.edu> wrote:
>>> If you want to use the minumum number of { and indentation levels, you can
>>> write
>>>
>>> \context Voice \repeat unfold 2 \relative c' { c2 d }
>>>
>>> or
>>>
>>> \context Voice \repeat unfold 2 \relative c' {
>>> c2 d
>>> }
>>>
>>> but back when the GDP was established the LilyPond format rules said we
>>> needed to use { } even if it wasn't required. I couldn't find this rule in
>>> section 3.4.3 of Contributing, so maybe it's gone away.
>>
>> No, that's still around. James, could you add this rule to the CG?
>>
>
> I'm still not really clear on what this rule should be from this whole
> thread. Are you talking about notes within { } when using any LilyPond
> Command before said notes?
>
> Taking a random example in the doc for errr...
>
> Chord Repetition, the example is
>
> <c e g> q q q
>
> There are no { } there and it seems they would look awkward.
>
> { <c e g> q q q }
>
> Does that make sense or have I missed something?
The rule is you need to follow a call to a new context with {
\new Voice {
In the case of the snippet you mention, {} are required around the snippet
in order to get it to compile, but those are automatically added, as is
described in the Learning Manual.
In the example above:
\context Voice \repeat unfold 2 \relative c' {c2 d},
\relative c' { c2 d } is a single music expression, so it doesn't need {}
around it to turn it into a sequence in order to work with \repeat unfold 2.
Similarly, \repeat unfold 2 music is a single music expression, so it
doesn't need {} to turn it into a sequence to work with \relative c'.
But in order to avoid the confusion that can arise, the GDP standards say
that even a single music expression should be surrounded by {} when is is an
argument to a lilypond command or music function.
So we would go
\context Voice { % { not strictly needed by LilyPond syntax
\repeat unfold 2 { % { not strictly needed
\relative c' { % { needed; c2 d is *not* a single music expression
c2 d
}
}
}
HTH,
Carl
_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel