lilypond-user
[Top][All Lists]
Advanced

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

Re: Music function help


From: Jean Abou Samra
Subject: Re: Music function help
Date: Mon, 3 Oct 2022 21:45:47 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.1

Le 02/10/2022 à 14:10, David Kastrup a écrit :
Mark Probert <probertm@gmail.com> writes:

Indeed it is, Aaron! Thank you!

I have to admit the disposition, or not, of braces confuses me. Seems like
they are optional in some places, and not in others, such as here. Is there
a rule behind when they are needed?
Braces are never optional.  They form sequential music expressions.  If
the sequence only contains a single music expression, there may not be
much of a difference in interpretation but there is still a difference
in expression: if you use \displayLilyMusic, you'll see that every pair
of braces inside is getting reproduced faithfully.

In your example, you used braces to combine your music arguments into a
single expression, and as a single expression, it would only serve for
one of your music arguments.



To be fully complete, (as David of course knows) there is also
another kind of braces in LilyPond, those for fundamental blocks
like \book, \bookpart, \score, \header, \paper, \layout, \midi
and a few others. These aren't optional and don't form music
expressions, they just delimit stuff. I think the fact that
there are two different kinds of braces is a possible source
of confusion, although when you know the rules, they are simple
and logical.

For example:

% OK: \score block with a music expression inside, which is c'1
\score { c'1 }

% Not OK: \score expects braces
\score c'1

% Not OK: there must be just one music expression in \score,
% here there are two
\score { c'1 d'1 }

% OK: there is just one music expression, namely a sequential
% music expression made of two elements
\score { { c'1 d'1 } }

% Also OK, it's a sequential expression with just one element inside
\score { { c'1 } }

% Also OK, that's a parallel music expression
\score { << c'1 d'1 >> }


Best,
Jean




reply via email to

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