Mats Bengtsson wrote:
Quoting Marcus Macauley <[EMAIL PROTECTED]>:

mypitch = #0
#(define mypitch 0)

One of them is enough!

That's why I said I "put one of these lines at the beginning of the file". When I got the error, I tried defining the variable in Scheme (second line above) instead of Lilypond (first line above), since I didn't know what else to try. Not surprisingly, it didn't make any difference.


(ly:make-pitch 1 $mypitch 0)

but when I do that, it complains:
"ERROR: Unbound variable: $mypitch"

Did you try to remove the "$"?

That's it - thanks!

I was confused by the use of the dollar sign ($) in, e.g., "12.1.2 Simple substitution functions", which I now see is necessary because it's within a #{ #} block which takes "normal LilyPond input, using variables as #$var1" (12.1.1), as opposed to Scheme input (my example), in which variables are referred to simply by their name, e.g., var1.

I still don't understand, though, why sometimes #$var1 is used and sometimes $var1 is used in the examples, including those on the "12.1.2 Simple substitution functions" page. I notice that in the bottom example on that page, $padding can be replaced with #$padding, but $marktext cannot be replaced with #$marktext, without generating an error. Surely there's a reason for this, but it's not obvious from the documentation.

Marcus


_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to