lilypond-user
[Top][All Lists]
Advanced

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

Re: combining pieces in one book


From: Jan-Peter Voigt
Subject: Re: combining pieces in one book
Date: Mon, 25 Jun 2012 11:40:06 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:13.0) Gecko/20120614 Thunderbird/13.0.1


Hi David, what do you mean by assignments? I'm not a native speaker and not familiar with programming. Is assignments a fix set of command?

Kai

Hello Kai,
it's the assignment of a variable in lily-syntax:

--snip--
% allowed
musik = \relative c'' { bes a c b }

% not allowed
\score {
musik = \relative c'' { bes a c b }
}
--snip--

that means, that a construct [var = value] (without []) may never be inside { ... } or << ... >>

You might trick that:
--snip--

parserDefine = #(define-music-function (parser location name mus)(symbol? not-null?)

(ly:parser-define! parser name mus)

(make-music 'SequentialMusic 'void #t))

--snip--
and then use
\parserDefine #'musik \relative c'' { c e d b }


parserDefine now is a music-function and can be used anywhere. This way the variable musik can be assigned and afterwords called via \musik

... but I woudn't recommend it! This might have *side-effects* and can lead to badly organized code!

HTH
Cheers, Jan-Peter




reply via email to

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