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: Urs Liska
Subject: Re: Behaviour of \paper and \layout in ly:book-process
Date: Mon, 18 Jul 2016 19:06:57 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1


Am 18.07.2016 um 13:46 schrieb David Kastrup:
> 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.

Thank you for the hint.

>
> If you really want to pass the paper block in yourself during
> ly:book-process (rather than incorporating it in the \book explicitly),

No, I didn't do that intentionally but was misled by the fact that I
have to supply that default-paper and -layout arguments.

Now I moved the \paper block inside \book (or rather at an earlier point
I stored a paper block in the option tree and now call it from there),
and it seems to work.

Now to the \layout block ...

Best
Urs

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




reply via email to

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