[Top][All Lists]

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

Re: Using Scheme

From: Paul Scott
Subject: Re: Using Scheme
Date: Fri, 12 May 2006 00:32:14 -0700
User-agent: Thunderbird (X11/20060501)

Paul Scott wrote:
Trent Johnston wrote:
I was wondering if someone could help me in using scheme to make a short cut. I'm trying to simplify: \once \override Beam #'positions = #'( number . number ) using a shortcut say \manBeam and specify the numbers beginning and ending beam height. I want to use this to alter the height of beams that have accidentals in them or lengthen some shorter beams. In 5.4 Advanced tweaks with scheme gives some information about using only the one variable as in the padText example.
I'm not sure what corresponds to that in the 2.8.2 manual
The online manual I was browsing just changed and now looks line the one you were referring to and I see that section.

but padText may exist because of help I got from Nicolas Sceaux. Here is my code for textPad. You might be able to create what you want from this:

#(use-modules (ice-9 optargs))
#(define* (textPad padding #:optional once?)
 (ly:export   ; this is necessary for using the expression
  ; directly inside a block
  (if once?
   #{ \once \override TextScript #'padding = #$padding #}
   #{ \override TextScript #'padding = #$padding #})))
This suggests I should be able to simplify my (Nicolas') code as per the manual.

To possibly help with your question 'padding' in the first line

padText = #(define-music-function (parser location padding) (number?)

indicates a numerical variable as reinforced by the '(number?)'
You can add more variables (say var2) by adding it/them after the position of 'padding' and changing (number?) to (number? number? ... )

var2 would be referred to in the code as $var2


I don't time to do any more for a day or two.


reply via email to

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