Hello David and Harm,

Thanks for your most useful help, and a nice day!

JM

> Le 19 avr. 2016 à 10:39, Thomas Morley <[email protected]> a écrit :
> 
> 2016-04-19 9:58 GMT+02:00 David Kastrup <[email protected]>:
>> Menu Jacques <[email protected]> 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


_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to