lilypond-user
[Top][All Lists]
Advanced

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

Re: variables in \book { }


From: Jan-Peter Voigt
Subject: Re: variables in \book { }
Date: Wed, 17 Feb 2016 10:56:33 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1

Hi Graham,

I didn't went through the whole thread, but IIUC, the problem is about
defining variables inside a pair of braces. Sometimes I use a helper
function to define variables:

%%% snip %%%
\version "2.19.35"

% a little helper function using ly:parser-define!
pdefine = #(define-scheme-function (sym val)(symbol? scheme?)
(ly:parser-define! sym val))

\book {
% define "music"
  \pdefine music \relative { c' d e f }
  \score {
    \music
  }
}
%%% snip %%%
of course, you might also just write
$(ly:parser-define! 'music #{ \relative { c' d e f } #})
without defining "pdefine" (or whatever you like to name it, but avoid
"define" ;) )

HTH
Jan-Peter


Am 17.02.2016 um 10:37 schrieb Graham King:
> On Tue, 2016-02-16 at 19:27 -0500, Ben Strecker wrote:
>> Graham, 
>>
>>
>> Have you tried putting each score inside it’s own \bookpart? 
>>
>>
>> The documentation for ragged-last-bottom says: 
>>
>>
>> ragged-last-bottom 
>>
>>
>> If this is set to false, then the last page, and the last page in each
>> section created with a \bookpart block, will be vertically justified
>> in the same way as the earlier pages.
>>
>> If I’m reading that correctly, that means that unless each score is in
>> a bookpart, ragged-last-bottom only applies to the very last page. 
>>
>>
>> HTH 
>> Ben 
> <snip>
> 
> 
> Thanks Ben,
> that will be useful once I've found a solution to the immediate problem:
> defining and using a variable within \book{} or \bookpart{} or
> \book[part]{ \score { }}
> 
>     \version "2.19.35"
>     \book {
>       music = \relative { c' d e f }
>       \score {
>         \music
>       }
>     }
> 
> (In case you were suggesting that I use \bookpart{} within
> book-titling.ily, I've tried that too and it throws a lot of
> "unrecognised string" errors.)
> 
> 
> 
> _______________________________________________
> lilypond-user mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/lilypond-user
> 




reply via email to

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