Le 19 févr. 08 à 14:53, Reinhold Kainhofer a écrit :
Thanks for adding these bindings. However, should ly:score-header
always
return a header module, or do I have to create the header module
myself? For
me it simply returns an empty list... In particular, the following
code does
not work:
#(define (createscoreII name)
(let* (
(score (ly:make-score #{ \makestaff $name #}))
; I also tried (make-module 1021 (ly:score-header score)
; where 1021 is taken from the only call to make-module that I
; found in scm/lily.scm
(header-object (ly:score-header score))
;(header-object (make-module 1021 (ly:score-header score)))
)
;(display header-object)
; This complains about header-object not being a module.
; using make-module, it complains about now knowing the piece
variable...
(module-set! header-object 'piece "blah")
(ly:export score)
)
)
I also tried module-add!, but since I'm basically doing trial and
error, I
could not get this to work, either...
module-define! is the function you were looking for.
Here is function that builds a score with a piece title and some music,
using the new bindings:
makeScore =
#(define-music-function (parser location title music) (string?
ly:music?)
(let ((score (ly:make-score music))
(header (make-module)))
(module-define! header 'piece title)
(ly:score-set-header! score header)
(collect-scores-for-book parser score))
(make-music 'Music 'void #t))
\makeScore "Test" { c'4 d' e' f' g'1 }
nicolas
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user