lilypond-user
[Top][All Lists]
Advanced

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

How to get a property override into a scheme markup function?


From: Jeff Epstein
Subject: How to get a property override into a scheme markup function?
Date: Wed, 22 Sep 2010 01:28:43 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

(FYI: I am a programmer, non-GUI Java, but am new to scheme.)

In section 6.4.3 in the pdf Notation Reference manual (v 2.12.3), there's a
markup function written in scheme. In that fashion, I've successfully created my
first scheme function:

   #(define-markup-command  (mBox layout props s_boxText)
                                               (string?)
         "Print the given string in a box and small-caps. Example usage:
c4.^\\markup \\mBox \"section a\""

      (interpret-markup layout props
         (markup #:center-align #:box #:caps s_boxText)
      )
   )

Calling \displayMusic on the following confirms the above (despite having a lot
more parens and the additional "#:line"...which I don't understand, but doesn't
seem necessary).

   \displayMusic   c1^\markup { \caps \center-align \box "V. S."}

results (partially) in

   (markup
      #:line
      (#:caps (#:center-align (#:box "V. S."))))

I'm TRYING to add this property-override:

   c1^\markup {
      \caps \center-align
      \override #'(box-padding . 0.5)
      \box "V. S."}

But doing \displayMusic on it results in:

 (markup
   #:line
   (#:caps
    (#:center-align
     (#:override (box-padding . 0.5) (#:box "V. S."))))

which does NOT work in the above scheme function, although it compiles just fine
as long as it is never called. When I do try to call it with

   \relative c'  {
      c1^\markup {\column {
         \line {\mBox #"section a"}}
   }

I get this error:
   test.ly:20:23: Unbound variable: box-padding

---

I'm not sure what I'm missing here. Is there a translation between an ly
property and scheme? "box-padding" does exist in the Internal Reference manual,
and I've not yet found anything in the other manuals, nor in this forum
(searching for scheme property override), that strike me as relevant.

If anyone could point me in the right direction, I would appreciate it. Thanks.




reply via email to

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