Am Montag, 17. August 2009 12:05:23 schrieb Nicolas Sceaux: > Le 17 août 09 à 09:23, Nicolas Sceaux a écrit : > > Le 17 août 09 à 02:41, Reinhold Kainhofer a écrit : > >> Hmm, to me it seems that you are effectively calling the parser to > >> interpret > >> \include "file.ly". That is a nice way around my problem, where > >> only the parser > >> seems to have a pointer to the current book (so you are invoking > >> the parser to > >> insert the scores into the bookpart), but it can't be used in my > >> case. > >> > >> My problem is that I don't have the score in a file in lilypond > >> syntax at all. > >> I have only the notes of the individual instruments, but the whole > >> score > >> (containing part-combined staves, etc.) is really generated on-the- > >> fly in > >> scheme. > > > > If you look at the definition of `bookpart-score-handler' in my > > file, you see that the book-part argument is not used. Instead, > > all scores are added to the toplevel-scores parser variable (even > > though they are not really toplevel, it does not matter). > > The `toplevel-bookpart-handler' then uses this variable to actually > > add the scores to the bookpart. This function is called by the parser > > when a \bookpart block is closed, so at this point the bookpart object > > is known. > > > > You can change the book-score-handler and toplevel-book-handler to > > act the same way. > > Here is a short example showing how that may be done.
Thanks a lot, that's really cool. I hope you dont mind if I add this to the LSR? BTW, toplevel scores are printed twice... do you know any workaround for this? Eg. the example: \book { \oneNoteScore } \oneNoteScore \oneNoteScore generates one file with for the book with one score, and one global score containing the two top-level \oneNoteScore twice (i.e. four scores, in the order ABAB)... When the toplevel-book-handler is called for the global scores (i.e. the implicit book), the 'toplevel-scores contains two scores, at the end of the function the list is empty. I found out that this seems to be a small but in ly/init.ly file, as the scores are added to the book there, but the list of toplevel-scores is not cleared... Patch is at: http://codereview.appspot.com/110041 Okay to apply? Cheers, Reinhold -- ------------------------------------------------------------------ Reinhold Kainhofer, reinh...@kainhofer.com, http://reinhold.kainhofer.com/ * Financial & Actuarial Math., Vienna Univ. of Technology, Austria * http://www.fam.tuwien.ac.at/, DVR: 0005886 * LilyPond, Music typesetting, http://www.lilypond.org _______________________________________________ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel