lilypond-user
[Top][All Lists]
Advanced

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

Header as argument in score generating function


From: Pierre-Luc Gauthier
Subject: Header as argument in score generating function
Date: Fri, 12 Jan 2018 21:30:49 -0500

Hi there,

Is there a way to pass a \header block as an argument to a scheme function?

I have not found the correct predicate for it and get the following error :
Expecting music, found #<module 7f2e875c7cc0>

I did read and tried stuff based on :
http://lilypond.org/doc/v2.19/Documentation/notation/predefined-type-predicates.en.html

'P.S. is my MWE.

Thanks for any pointers
-- 
Pierre-Luc Gauthier

%%%%%%%%%%%%%%%%%
\version "2.21.0"

headerA = \header {piece = "header A"}
headerB = \header {piece = "header B"}

scoreFunc = #
(define-scheme-function
 (header content) (ly:music? ly:music?)
 #{
   \score {
     $content
     \layout {}
     $header
   }
 #})

\book {
  \bookOutputSuffix "headeredBook"
  \scoreFunc \headerA {c'4 d' e' f'}
  \scoreFunc \headerB {c''4 b' a' g'}
}

Attachment: passHeaderToScoreGeneratingFunction.ly
Description: Text Data


reply via email to

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