Am Mittwoch, 20. Februar 2008 schrieb Nicolas Sceaux:
> module-define! is the function you were looking for.

Ah, thanks... I was confused by the name and didn't even consider it (thinking 
it somehow defines a module, while in fact it is defining INSIDE a module).

> 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 }

Dang, that looked so promising!
It worked fine in all my tests, until I started switching my orchestral score 
to my own createscore function... The problem is that cue notes do not appear 
in the score!!! 

Apparently your makeScore function is not exactly the same as
\score {
   { c'4 d' e' f' g'1 }
  \header { piece = "Test" }
}

Attached is a (stripped-down) example, where the cue notes are displayed in 
the score, while they are not in the score(s) generated in scheme. I tried 
both collect-scores-for-book and an explicit \score, and in both cases the 
cues simply don't appear.

Cheers,
Reinhold


-- 
------------------------------------------------------------------
Reinhold Kainhofer, Vienna University of Technology, Austria
email: [EMAIL PROTECTED], http://reinhold.kainhofer.com/
 * Financial and Actuarial Mathematics, TU Wien, http://www.fam.tuwien.ac.at/
 * K Desktop Environment, http://www.kde.org, KOrganizer maintainer
 * Chorvereinigung "Jung-Wien", http://www.jung-wien.at/
\version "2.11.39"

\header { title = "Scores generated by Scheme" }

% Definitions of the music, staves, piece names, instrument names, etc.
testmusic = {f'4 d'2. f'1 }
\addQuote "Test" \testmusic

anothermusic = { c''4 \cueDuring #"Test" #DOWN {r4 r2 R1} }
anotherInstrumentName = "another inst."
anotherShortInstrumentName = "a."

anotherstaff = \new Staff \with {
            instrumentName = \anotherInstrumentName 
            shortInstrumentName = \anotherShortInstrumentName 
      } << \anothermusic >>


% classical lilypond style
\score {
  \anotherstaff
  \header { piece = "Classical lilypond code, cues shown" } 
}


createscoreV = #(define-music-function (parser location) ()
  (let* (
         (score     (ly:make-score anotherstaff))
         (header    (make-module))
         )
    ; Set the piecename in the header and apply it to the score
    (module-define! header 'piece "Scheme functions used, cues are not shown")
    (ly:score-set-header! score header)
    ; Schedule the score for typesetting
    (collect-scores-for-book parser score)
  )
  ; This is a void function, the score has been schedulled for typesetting already
  (make-music 'Music 'void #t)
)
\createscoreV


#(define (createscoreVI)
  (let* (
         (score     (ly:make-score anotherstaff))
         (header    (make-module))
         )
    (module-define! header 'piece "Scheme functions used, cues are not shown")
    (ly:score-set-header! score header)
    (ly:export score)
  )
)
\score { #(createscoreVI) }

Attachment: lisp_score_cue_problemI.pdf
Description: Adobe PDF document

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

Reply via email to