lilypond-user
[Top][All Lists]
Advanced

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

Re: substitution function variable name


From: Jean Abou Samra
Subject: Re: substitution function variable name
Date: Sun, 22 Jan 2023 17:33:11 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0



Le 22/01/2023 à 17:20, Darren Ng a écrit :
Define substitution function accOne() as:

     accOne =
     #(define-music-function
         (x        )
         (ly:music?)
       #{
         $x8 $x8 $x8 $x8 $x8
       #})

Call accOne() with:

     \accOne f

Expected output is:

     f8 f8 f8 f8 f8

However, lilypond reports error as follows:

     GNU LilyPond 2.24.0 (running Guile 2.2)
     Processing `main.ly'
     Parsing...
     accompanimentfunc.ly:19:6: error: Guile signaled an error for the
expression beginning here
         $
          x8 $x8 $x8 $x8 $x8
     Unbound variable: x8
     accompanimentfunc.ly:19:10: error: Guile signaled an error for the
expression beginning here
         $x8 $
              x8 $x8 $x8 $x8
     Unbound variable: x8
     accompanimentfunc.ly:19:14: error: Guile signaled an error for the
expression beginning here
         $x8 $x8 $
                  x8 $x8 $x8
     Unbound variable: x8
     accompanimentfunc.ly:19:18: error: Guile signaled an error for the
expression beginning here
         $x8 $x8 $x8 $
                      x8 $x8
     Unbound variable: x8
     accompanimentfunc.ly:19:22: error: Guile signaled an error for the
expression beginning here
         $x8 $x8 $x8 $x8 $
                          x8
     Unbound variable: x8
     Interpreting music...

How to tell lilypond to look for variable "x" and make a 1/8 note out of it,
instead of looking for variable "x8"?



Simply insert a space between "x" and "8".

Best,
Jean

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


reply via email to

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