On 01/10/2024 22:06, Walt North wrote:
I may be thinking about define-void-function incorrectly.  Here is a trimmed down example of what I was trying to do.  I want to have a callable function that sets up my \header.

There are other ways I could go about this to get what I want - but I originally thought this would be easy way to go and put the function in an include file. And if I can get this to work there are some things I could use the same type of approach on.

Here is the trimmed down same.  It does not produce any heading.


Walt North


\version "2.24.4"

hdr =
#(define-void-function (name) (string?)
   #{
     \header {
     title = #name
     }
   #})

\hdr "test"

%\header { title = test }

\score {
{c4 d e f}
}

Replace define-void-function with define-scheme-function and things will work. The function then returns the scheme code for your header and inserts it in your LilyPond file.

--
Timothy Lanfear, Bristol, UK.

Reply via email to