lilypond-user
[Top][All Lists]
Advanced

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

substitution function variable name


From: Darren Ng
Subject: substitution function variable name
Date: Mon, 23 Jan 2023 00:20:26 +0800

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"?

Thanks.

Darren Ng



reply via email to

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