Hi all,

one more of my recent confusing ideas: I would like to generate a number
of \bookpart-s in a Scheme function. The reason is that I have to loop
over a number of works and create scores for them that are in a bookpart
each.

Attached is something that resembles the structure I have in my actual
files.

I successfully factored out the bookpart to an includable file. With
this I can produce multiple scores. However, it would be better to have
that factored out to a function because I have to set some values to
select which score to create, and this would be more natural to do as
function arguments rather than setting global variables and reading that
from the code that generates the scores.

As the files are they compile finely, but when I uncomment the
\makeBookpart call I get

/home/uliska/Aktuell/lily/bookpart-in-scheme-function/main.ly:23:9 <0>:
error: bad expression type

\makeBookpart

/home/uliska/Aktuell/lily/bookpart-in-scheme-function/main.ly:14:2 <1>:
error: error in #{ ... #}

# (let* errors. Any suggestions how I can make the outer construct
handle a bookpart returned from a function? Thanks Urs
\version "2.19.45"

makeBookpart =
#(define-scheme-function ()()
   #{
     \bookpart {
       \score {
         \new Staff { d' }
       }
     }
   #})

#(let*
  ((book
    #{
      \book {

        \bookpart {
          \markup "This will be a title page"
        }

        \include "bookpart.ily"
        \include "bookpart.ily"

        %\makeBookpart

      }
    #}))
  (ly:book-process
   book
   #{ \paper {} #}  ; non-functional, placeholder
   #{ \layout {} #} ; non-functional, placeholder
   (ly:parser-output-name)))
\bookpart {
  \score {
    \new Staff { c' }
  }
}
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to