[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Scoping problem in define-music-function
From: |
Reinhold Kainhofer |
Subject: |
Re: Scoping problem in define-music-function |
Date: |
Mon, 27 Sep 2010 10:50:18 +0200 |
User-agent: |
KMail/1.13.5 (Linux/2.6.32-24-generic; KDE/4.5.1; i686; ; ) |
Am Montag, 27. September 2010, um 10:28:53 schrieb Marc Hohl:
> <string>:2:46: Fehler: GUILE signalisierte einen Fehler für den hier
> beginnenden Ausdruck
> \override TabNoteHead #(quote stencil) = #
> (my-special-callback fret)
> Unbound variable: fret
>
> So fret is not known within #{ ... #}.
It is known. But you have to tell lilypond that it should be the argument of
the function and not just a normal scheme symbol.
See
http://lilypond.org/doc/v2.13/Documentation/notation/substitution-function-
syntax.html
In particular:
"where
…music… normal LilyPond input, using $ to reference arguments (eg. ‘$arg1’)"
So all you need to do is to prepend a $ to indicate that fret is the symbol
from the scoping function.
Cheers,
Reinhold
--
------------------------------------------------------------------
Reinhold Kainhofer, address@hidden, http://reinhold.kainhofer.com/
* Financial & Actuarial Math., Vienna Univ. of Technology, Austria
* http://www.fam.tuwien.ac.at/, DVR: 0005886
* LilyPond, Music typesetting, http://www.lilypond.org