|
From: | Phil Holmes |
Subject: | Re: Understanding herd of curly braces |
Date: | Tue, 25 Jan 2011 10:13:26 -0000 |
I know others have answered, but here's my
take. A pair of curly braces { } enclose a block of code. That block
usually has a command of some sort that applies to it. So
\relative c' { c4 c c c }
would mean that the \relative command applies to
all 4 notes within the braces. It's quite common to have blocks of code
within blocks of code. So - if we have a new staff and some music relative
to c' within it, we could write:
\new Staff { \relative c' { c4 c c c }
}
This can happen with many
blocks-within-blocks. So to try to make it clearer where the blocks are,
it's standard practice to indent each block of code. So the code I wrote
above would become:
\new Staff {
\relative c' {
c4 c c c
}
}
So the lowest brace lines up with the \new and the
one higher lines up with the \relative, and it's not too hard to see how the
braces match. But this is only a convention - LilyPond doesn't care about
indents and lining up in the slightest - she simply requires that the braces
match up to form proper blocks.
Hope that helps.
-- Phil Holmes
|
[Prev in Thread] | Current Thread | [Next in Thread] |