Thanks Nicolas that's great!!

Thanks for all your help lately it's greatly appreciated.

And thanks to all that have come to my assistance with this question.

Could this example along with the explanation from Nicholas be added to the
manual?

I think it would further the understanding of scheme especially when using
pairs of numbers as there are other overrides that require to pairs. e.g.
extra-offset.

Thanks again,

Trent


----- Original Message ----- 
From: "Nicolas Sceaux" <[EMAIL PROTECTED]>
To: "Mats Bengtsson" <[EMAIL PROTECTED]>
Cc: "Trent Johnston" <[EMAIL PROTECTED]>; "Paul Scott"
<[EMAIL PROTECTED]>; <lilypond-user@gnu.org>
Sent: Saturday, May 13, 2006 4:37 AM
Subject: Re: Using Scheme


|
| Mats Bengtsson <[EMAIL PROTECTED]> writes:
|
| > Trent Johnston wrote:
| >
| >>Sorry I should have been a bit more specific before...
| >>
| >>I tried using
| >>
| >>manBeam = #(define-music-function (parser location beg end) (number?
| >>number?)
| >> #{ \once \override Beam #'positions = #'($beg . $end) #} )
| >>
|
| > Nicolas recently answered a closely related question.
| > One solution should be to replace
| > #'($beg . $end)
| > by
| > (cons $beg $end)
|
| To Trent:
| You need to understand that a scheme form preceded by a quote (that's
| called a quoted form) is not evaluated. Thus, something like
| '(var1 . var2) evaluates to that, (var1 . var2), eg a cons cell
| containing two symbols, var1 and var2. But what you want is a cons cell
| with two numbers, the value of the variables var1 and var2. So you
| should not quote the form, so that the variables should be evalutated.
| Instead, you make the cons cell using the function `cons':
|   (cons var1 var2) ==> (3 . 6)
| supposing that var1 and var2 respectively evaluate to 3 and 6.
|
|   manBeam =
|   #(define-music-function (parser location beg end)
|                           (number? number?)
|     #{ \once \override Beam #'positions = #(cons $beg $end) #})
|
|   \manBeam #3 #6
|
| or:
|
|   manBeam =
|   #(define-music-function (parser location beg-end)
|                           (cons?)
|     #{ \once \override Beam #'positions = #$beg-end #})
|
|   \manBeam #'(3 . 6)
|   \manBeam #(cons 3 6)
|
| nicolas
|


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

Reply via email to