lilypond-user
[Top][All Lists]
Advanced

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

Re: Behaviour of \paper and \layout in ly:book-process


From: David Kastrup
Subject: Re: Behaviour of \paper and \layout in ly:book-process
Date: Mon, 18 Jul 2016 13:46:56 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

Urs Liska <address@hidden> writes:

> I am once more experimenting with ly:book-process. The background is
> that I have managed to generate my complete score within a Scheme
> function, but now I need the function to produce more than just one
> \score (namely an alternation between multiple scores and top-level
> markups).
>
> But it seems somewhat unpredictable how the \paper and \layout blocks
> behave.
>
> In the following example the \paper block is not respected while the
> \layout block is:
>
> \version "2.19.45"
>
> engrave =
> #(define-void-function ()()
> (let*
>   ((book
>     #{
>       \book {
>         \markup "Movement title (to be generated)"
>         \score {
>           \new Staff { c' d' }
>         }
>       }
>     #}))
>   (ly:book-process
>    book
>    #{
>      \paper {
>        indent = 0\cm
>      }
>    #}
>    #{
>      \layout {
>        \context {
>          \Score {
>            \override NoteHead.color = #blue
>          }
>        }
>      }
>    #}
>    (ly:parser-output-name (*parser*)))))
>
> \engrave

The defaultpaper argument of ly:book-process is only consulted when the
book argument does not already have a paper block of its own, and every
\book block takes the global \paper block when nothing else is given.

If you really want to pass the paper block in yourself during
ly:book-process (rather than incorporating it in the \book explicitly),
you need to use \bookpart instead of \book: in a \bookpart, the \paper
block is indeed optional and (unless specified) will be left out instead
of taking the global \paper block.

If that sounds like I have any clue about how the hierarchy of books and
bookparts is supposed to work, that would be misleading.  That's
basically just a report on what some code does.  Why one would want it
to do that, I have no idea.

-- 
David Kastrup



reply via email to

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