lilypond-user
[Top][All Lists]
Advanced

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

Re: \fromproperty as instrument name


From: Thomas Morley
Subject: Re: \fromproperty as instrument name
Date: Tue, 19 Apr 2016 10:39:45 +0200

2016-04-19 9:58 GMT+02:00 David Kastrup <address@hidden>:
> Menu Jacques <address@hidden> writes:
>
>> Hello folks,
>>
>> I’d like to use the instrument name specified in the header as the actual 
>> instrument name:
>>
>> %%%%%%%%%%
>> \version "2.19.39"
>>
>> \header {
>>   instrument = "Premier"
>> }
>>
>> % The score definition
>> \score {
>>   {
>>     \new Staff <<
>>       \set Staff.instrumentName = \markup{\fill-line{\fromproperty 
>> #'header:instrument}}
>>
>>       \context Staff <<
>>         \context Voice = "PremierVoiceOne"
>>         {
>>           a b c d
>>         }
>>       >>
>>     >>
>>   }
>>
>>   \layout {}
>> }
>> %%%%%%%%%%
>>
>>
>> But I get an error message on the next syntactical element, here \context 
>> Staff, see below.
>
> Well, your problem is that header:instrument}} is a valid Scheme
> identifier, and \fromproperty apparently just ignores identifiers it
> finds undefined.  So your \context appears right after
> \markup{\fill-line{ where LilyPond has no idea what to do with it.
>
> If you insert spaces a bit more liberally, you will be less likely to
> forget them where they are absolutely essential, like after symbols
> parsed by the Scheme interpreter.
>
> --
> David Kastrup



Indeed.
That's the reason I always insert spaces before and after any curly
bracket in lily-syntax.

Though, even with correct syntax you'll not succeed directly.
See
http://lsr.di.unimi.it/LSR/Item?id=467
for a solution.

But delete your fill-line, or limit it to a resonable line-width ...

Cheers,
  Harm



reply via email to

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