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
OpenPGP_signature
Description: OpenPGP digital signature