lilypond-user
[Top][All Lists]
Advanced

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

Re: Scheme question


From: Marcus Macauley
Subject: Re: Scheme question
Date: Fri, 13 Oct 2006 17:46:13 -0400
User-agent: Opera Mail/9.00 (Linux)

Mats Bengtsson wrote:
Quoting Marcus Macauley <address@hidden>:

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




reply via email to

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