Paul Scott <[EMAIL PROTECTED]> writes:

> Does this make any sense?
>
> #(def-markup-command (testOne layout props) ()
>   (interpret-markup layout props
>    (markup #:number
>     (lambda (x) (ly:music-property x 'numerator)))))

No.

(lambda ...) evaluates to a function, where you want a
markup. Remember that the \number markup command takes a markup as an
argument, not a procedure.

When you want to parametrize (uh) a LilyPond expression, the first
thing to do is to write it, in plain LilyPond syntax, and then display
it in Scheme. Then you will have a pattern to use in your function
body. (What you want is a music function, not a markup command).

for instance, supposing that `mus:display' (see
http://lists.gnu.org/archive/html/lilypond-devel/2004-11/msg00029.html)
is defined in music-display.scm:

-----test.ly-----
#(load "music-display.scm")
#(mus:display #{ R1^\markup \number 1 #})
-----test.ly-----

lilypond test.ly
==>
(make-music 'SequentialMusic
  'elements (list
             (make-music 'MultiMeasureRestMusicGroup
               'elements (list
                          (make-music 'BarCheck)
                          (make-music 'EventChord
                            'elements (list
                                       (make-music 'MultiMeasureRestEvent
                                         'duration (ly:make-duration 0 0 1 1))))
                          (make-music 'BarCheck)
                          (make-music 'TextScriptEvent
                            'direction 1
                            'text (list
                                       number-markup
                                       (markup #:simple "1")))))))


>>See scm/new-markups.scm.
>>
>>
> I'll keep reading this but I don't understand it yet.  Can you
> recommend any online reading to understand scheme better?

I don't know much about scheme community sites. www.schemers.org
should have links to tutorials and books.

nicolas



_______________________________________________
lilypond-user mailing list
[EMAIL PROTECTED]
http://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to