lilypond-user
[Top][All Lists]
Advanced

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

Re: Scheme function to output \bookpart {} ?


From: Thomas Morley
Subject: Re: Scheme function to output \bookpart {} ?
Date: Wed, 30 Sep 2015 01:28:14 +0200

2015-09-29 11:31 GMT+02:00 Simon Albrecht <address@hidden>:
> On 24.09.2015 00:22, Simon Albrecht wrote:
>>
>> On 23.09.2015 22:45, Thomas Morley wrote:
>>>
>>> 2015-09-23 17:50 GMT+02:00 Simon Albrecht <address@hidden>:
>>>>
>>>> Hello,
>>>>
>>>> is it possible to have a Scheme function output a bookpart? In the
>>>> attached
>>>> example and my real-world setup, I get ‘error: bad expression type’.
>>>>
>>>> TIA, Simon
>>>
>>> Hi Simon,
>>>
>>> this may give you a starting point:
>>>
>>> \version "2.19.27"
>>>
>>> test =
>>> #(define-scheme-function (mus) (ly:music?)
>>>    (ly:book-process
>>>      (ly:make-book-part (list (ly:make-score mus)))
>>>      $defaultpaper
>>>      $defaultlayout
>>>      (ly:parser-output-name)))
>>>
>>> m = { c'4 }
>>>
>>> \test \m
>>
>>
>> Shoot, I did find a flaw: I need a \bookpart {}, not a \book, but it needs
>> to contain a \paper block. How can I do that?
>
>
> What a joy: by accident I found in scm/lily-library.scm that for which I was
> looking. It’s the scheme procedure collect-bookpart-for-book, with which I
> could compile the following function to complete my framework for a project:
>
> %%%%%%%%%%%%
> bookpartBox =
> #(define-scheme-function (parser location roman) (symbol?)
>    (collect-bookpart-for-book
>    #{
>      \bookpart {
>        \paper {
>          system-count = $(assoc-get roman system-count-alist)
>          systems-per-page = 4
>        }
>        \scoreBox
>      }
>    #}))
> %%%%%%%%%%%%
>
> Yours, Simon



Hi Simon,

great you found something fitting your needs.
Could you post a fully compilable example for follow readers?

Cheers,
  Harm



reply via email to

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