Hello,

Browsing the documentation,
I did not find anything about variable names with allowing non-alphabetic 
characters.
Did I miss something?

Here are extracts the 2.20 documentation

==================================


     3.1.1 Introduction to the LilyPond file structure <3.1.1 Introduction to 
the
     LilyPond file structure>

Remember that you can use almost any name you like as long _/as it contains just alphabetic characters/_ and is distinct from LilyPond command names. For more details, see Saving typing with variables and functions <http://lilypond.org/doc/v2.20/Documentation/learning/saving-typing-with-variables-and-functions>. The exact limitations on variable names are detailed in File structure <http://lilypond.org/doc/v2.20/Documentation/notation/file-structure>.


     3.4.4 Saving typing with variables and functions
     
<http://lilypond.org/doc/v2.20/Documentation/learning/saving-typing-with-variables-and-functions.html>

does not give any indication


     3.1.5 File structure
     <http://lilypond.org/doc/v2.20/Documentation/notation/file-structure.html>

_The name of a variable should have alphabetic characters only; no numbers, underscores or dashes_.


     Additional note :

It's a bit difficult for me to navigate through the English documentation for me... in a French language environment, as I can only get it by clicking at the bottom (why not at the top...), and links bring me back to French (which is also nice...). But anyhow, for this matter, the indications are the same.

Best regards
/Silvain/

Le 07.03.21 à 12:50, Peter Toye a écrit :
Re: Workaround for (not-allowed) numbers in variable names? Yes, it's documented in the Notation Reference Manual section 3.1.5 File Structure. It doesn't seem the obvious place to put the syntax of variable names.

Best regards,

Peter
mailto:lilyp...@ptoye.com <mailto:lilyp...@ptoye.com>
www.ptoye.com <http://www.ptoye.com>

-------------------------

> Message: 4
> Date: Sat, 6 Mar 2021 21:30:56 +0900
> From: 田村淳 <j.tam...@me.com <mailto:j.tam...@me.com>>
> To: "lilypond-user@gnu.org" <lilypond-user@gnu.org 
<mailto:lilypond-user@gnu.org>>
> Subject: Re: Workaround for (not-allowed) numbers in variable names?
> Message-ID: <a9ba3c0b-fa05-4070-9927-ea24d559e...@me.com <mailto:a9ba3c0b-fa05-4070-9927-ea24d559e...@me.com>>
> Content-Type: text/plain; charset="utf-8"

> Wow! This is something I’ve been looking for for a long time. Is this documented somewhere?

> Best regards,

> Jun
> https://imslp.org/wiki/User:Jun_T <https://imslp.org/wiki/User:Jun_T> <https://imslp.org/wiki/User:Jun_T <https://imslp.org/wiki/User:Jun_T>>

>> 2021/03/06 18:09、Richard Shann <rich...@rshann.plus.com 
<mailto:rich...@rshann.plus.com>>のメール:

>> On Fri, 2021-03-05 at 10:15 -0800, Mogens Lemvig Hansen wrote:
>>> I believe it was David K who made this magic work:
>>>
>>> \version "2.20.0"
>>>
>>> mus.1 = { c d e }
>>>
>>> \score {
>>>   \new Staff { \mus.1 }
>>> }
>>>

>> This can be extended to cover the case where a variable has two numbers
>> associated with it:

>> 8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><
>> \version "2.20.0"
>>
>> Movement.1.Staff.1 = { c d e }
>> Movement.1.Staff.2 = { c' d' e' }
>> Movement.2.Staff.1 = { f g a }
>> Movement.2.Staff.2 = { f' g' a' }
>> \score {
>>   <<
>>     \new Staff { \Movement.1.Staff.1 }
>>     \new Staff { \Movement.1.Staff.2 }
>>   >>

>> }
>> \score {
>>   <<
>>   \new Staff { \Movement.2.Staff.1 }
>>     \new Staff { \Movement.2.Staff.2 }
>>   >>

>> }

>> 8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><

>> (cautionary note: I haven't examined the code or docs on this, but it
>> seems a dot before and after will do the trick mid-word and a single
>> dot at end of word)

>> A decade or so ago I resorted to converting all the numbers to Roman
>> numerals using a C routine that's knocking around on the interweb...
>> time I upgraded that.

>> Richard Shann



>>> Regards,
>>> Mogens
>>>
>>> From: Silvain Dupertuis
>>> Sent: March 5, 2021 10:12
>>> To: lilypond-user@gnu.org <mailto:lilypond-user@gnu.org>
>>> Subject: Re: Workaround for (not-allowed) numbers in variable names?
>>>
>>> I also wondered why numbers are not allowed in variables.
>>> As for me, I used things like A, B, C instead... but it is less
>>> practical.
>>>
>>> My guess is that it may be linked to the way numbers are used in
>>> notes and chords to indicate duration, otherwise it would be real
>>> nice to be able to use digits in variable names...!
>>>
>>> Le 05.03.21 à 17:37, stefano franchi a écrit :
>>> Here is a question for anyone who may have been using lilypond for
>>> projects involving text and many, many, short and similar musical
>>> snippets.
>>>
>>> I am putting together a book that will contain many (very brief)
>>> exercises, grouped thematically. I had thought a convenient and
>>> flexible way to organize the material and keep future maintenance
>>> under control would be to create top level variables names for the
>>> main musical categories and sub-categories and then assign each score
>>> snippet to progressively numbered variable. So I would have, CategA-1
>>> = {"code for one exercise"} , CategB-2 = "code for another
>>> exercise"}, and so on. Clean structure, easy to maintain and
>>> rearrange, etc.
>>>
>>> Then I discovered that lilypond does not allow numbers in variable
>>> names.... :-(
>>>
>>> I'd be willing to bet my use case is not particularly weird---there
>>> must have been other people encountering the same problem.
>>>
>>> How have you guys managed it?
>>>
>>> Cheers,
>>>
>>> S.
>>>

>>> --
>>> __________________________________________________
>>> Stefano Franchi

>>> stefano.fran...@gmail.com <mailto:stefano.fran...@gmail.com>
>>> https://www.researchgate.net/profile/Stefano_Franchi <https://www.researchgate.net/profile/Stefano_Franchi> >>> >>> --
>>> 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.org
>>>


> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <https://lists.gnu.org/archive/html/lilypond-user/attachments/20210306/5ed2846d/attachment.html <https://lists.gnu.org/archive/html/lilypond-user/attachments/20210306/5ed2846d/attachment.html>>

> ------------------------------


--
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.org <http://perso.silvain-dupertuis.org>

Reply via email to