I would suggest to add this indication at this page of the documentation :
https://lilypond.org/doc/v2.24/Documentation/learning/organizing-pieces-with-variables.fr.html
https://lilypond.org/doc/v2.24/Documentation/learning/organizing-pieces-with-variables.html
As for me, it took me a long time until I discovered this way to use
numbered variables
(I do not remember where, probably in some scheme explanation).
It does not seem possible to combine hierarchically this kind of syntax.
Here is a possible explanation included in a snippet.
\version "2.24.4"
\markup {
Numbered variables
}
% ---------------------------------
% these notation works
music.1 = \relative c' {c2 d e1}
music.2 = \relative c' {e2 d c1}
music.end = \relative c' {c2 d c1}
% ---------------------------------
% this notation does not work
% music.3.a = \relative c' {c2 d e1}
% music.3.b = \relative c' {c2. d4 c1}
% ---------------------------------
\score {
<<
\music.1
\music.2
>>
}
\score {
{
\music.1
\music.2
\music.end
}
}
\markup {
\column
\string-lines
"
.
======
French
======
On peut aussi utiliser une numérotation dans les noms de variables
en utilisant un point avec la syntaxe NOMVARIABLE.NUM
par exemple :
music.1 = \relative c' {c2 d e1}
music.2 = \relative c' {e2 d c1}
music.end = \relative c' {c2 d c1}
{ \music.1 \music.2 \music.end }
.
=======
English
=======
One can actually use numbered variable names
using a dot and a syntax of the form VARIABLE.NUM
for exemple:
music.1 = \relative c' {c2 d e1}
music.2 = \relative c' {e2 d c1}
music.end = \relative c' {c2 d c1}
{ \music.1 \music.2 \music.end }
.
"
}
Le 14.10.25 à 06:01, Werner LEMBERG a écrit :
I have been using this trick to avoid these awkward English
numerals... (/verse.1/ instead of /verseOne/, /verse.2/, etc.) but
never tried this more sophisticated use.
verse.1 = {...} — used as \verse.1
It does create a single variable which refers to a structured Lisp
object (an object with multiple slots), instead of distinct
variables, but for the user, this does not change anything in the
syntax itself.
Unfortunately, this feature is very hard to find in the
documentation. It would be nice to give this information in the
main page explaining the syntax of variable names.
Where in the NR would you expect such documentation? Could you maybe
write something that I can add?
Werner
--
Silvain Dupertuis
Route de Lausanne 335
1293 Bellevue (Switzerland)
tél. +41-(0)22-774.20.67
portable +41-(0)79-604.87.52
web: silvain-dupertuis.net <https://www.silvain-dupertuis.net/>