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: Reinhold Kainhofer
Subject: Re: Doing \score { <<...>... } and \context Staff << .... >> in scheme?
Date: Mon, 18 Feb 2008 00:17:51 +0100
User-agent: KMail/1.9.6

Am Sonntag, 17. Februar 2008 schrieb Han-Wen Nienhuys:
> 2008/2/13, Reinhold Kainhofer <address@hidden>:
> > In particular, what is the scheme equivalent, producing the same as the
> > following lilypond code?
> >
> > IChorObIScore = \score {
> >   << \IChorObIStaff >>
> >   \header { piece = \IChorPieceName }
> > }
>
> You have to use the scheme bindings. There is a ly:make-score
> function. 

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"

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?


Also, how can I create a staff in scheme? A staff is no music expression, is 
it?


> 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.


> > generate-score = #(define-music-function (parser location piece instr)
> >                         (string string)
> >   #{
> >     \score {
>
> IIRC #{ can only contains music expressions.

Yes, using define-music-function was also not the correct approach...

> >       << #(eval (string->symbol (string-append piece instr #"Staff"))) >>
>
> Inside scheme the # before a string is not necessary.

Oops, thanks! 

Cheers,
Reinhold

-- 
------------------------------------------------------------------
Reinhold Kainhofer, Vienna University of Technology, Austria
email: address@hidden, http://reinhold.kainhofer.com/
 * Financial and Actuarial Mathematics, TU Wien, http://www.fam.tuwien.ac.at/
 * K Desktop Environment, http://www.kde.org, KOrganizer maintainer
 * Chorvereinigung "Jung-Wien", http://www.jung-wien.at/

Attachment: lisp_scoreI.ly
Description: Text Data

Attachment: lisp_scoreI.pdf
Description: Adobe PDF document


reply via email to

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