lilypond-user
[Top][All Lists]
Advanced

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

Re: Doing \score { <<...>... } and \context Staff << .... >> in scheme?


From: Han-Wen Nienhuys
Subject: Re: Doing \score { <<...>... } and \context Staff << .... >> in scheme?
Date: Mon, 18 Feb 2008 23:45:56 -0300

2008/2/17, Reinhold Kainhofer <address@hidden>:
> Thanks for the hint... Works so far (see attached example).
>
> However, how can I define a function so that instead of scheme, i.e.
>      \score { #(createscore "test") }
> i can simply do:
>      % This does NOT work (syntax error)
>      \score { \createscore #"test"}
> or even better:
>      \createscore #"test"

that's not possible, afaics, but you can have

#(createscore "test")

at toplevel.
check out

 toplevel-score-handler

in ly/declarations-init.ly; this shows how to schedule a \score object
for typesetting.

> Now that this works more or less, how can I set 'header:piece only for this
> score? I tried ly:prob-set-property! and ly:context-set-property!, but
> neither works. Which type of object is a score?

It's a scheme module. I think we lack the bindings to set or read the
one in the \score block  from scheme. I'll add some for .41 - when the
bindings are there, it would be

(define header-object (ly:score-header score))
(module-set! header-object 'piece "blah")

> > 2.11.40 adds a ly:score-add-output-def function that will
> > allow you define a piece of music
>
> What exactly does that do? There's no description, and the only use is in the
> incipit example inside a lambda function used as a stencil definition. That's
> wayyyy above my head with regards to lilypond internals.

Sorry, I messed up the explanation.  You can set the \layout block
with this function, which may be useful if you want to set custom
margins programmatically for some reason. Not sure if you need it.

-- 
Han-Wen Nienhuys - address@hidden - http://www.xs4all.nl/~hanwen




reply via email to

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