lilypond-user
[Top][All Lists]
Advanced

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

Re: Scheme function returning \book


From: Lukas-Fabian Moser
Subject: Re: Scheme function returning \book
Date: Wed, 16 Jan 2019 13:21:33 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1

Hi Aaron,

Going back to the original function posted, if the output is meant to be a book that is more-or-less immutable and ready for printing, one could just do the following instead:

%%%%
\version "2.19.82"

test = #(define-void-function (suffix) (string?)
  (print-book-with-defaults #{
    \book {
      \bookOutputSuffix #suffix
      \score { d4 }
    } #}))

\test "surname"
%%%%

Am I missing a subtlety that the original function is trying to address?

No - I think that's perfect. Thanks much - I didn't find a procedure for "just printing" a book.

What I was trying to achieve here: I have a document with theory exercises which come in several guises - figured bass, figured bass with given melody, only bass and melody, and so on -, richly adorned with \tag'ging. Since there are various chapters/sections, interspersed texts etc., they do not fit into one \score.

I wanted to have a convenient way to generate all various combinations; hence a function that receives a filename suffix and (omitted in my examples) a list of tags that should be removed.

The book now is defined using

create = #(define-void-function (omitTags suffix) (list? string?) (print-book-with-defaults #{
 \book {
    \bookOutputSuffix #suffix
     ...
  } #}))

and each story contains a \removeWithTag #omitTags. Hence by just issuing

\create #'() "complete"
\create #'(middleVoices bcFigures) "OuterVoices"
\create #'(upperVoices) "bc"
\create #'(upperVoices bcFigures) "BassOnly"

I get four files with completely different versions of a whole book containing multiple \score's and interspersed \markup's.

Works like a charm now - thanks much!

Best
Lukas




reply via email to

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