lilypond-user
[Top][All Lists]
Advanced

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

Re: \fromproperty as instrument name


From: Menu Jacques
Subject: Re: \fromproperty as instrument name
Date: Wed, 18 May 2016 10:38:36 +0200

Hello David and Harm,

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

JM

> Le 19 avr. 2016 à 10:39, Thomas Morley <address@hidden> a écrit :
> 
> 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]