[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: \fromproperty as instrument name
From: |
David Kastrup |
Subject: |
Re: \fromproperty as instrument name |
Date: |
Tue, 19 Apr 2016 09:58:41 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) |
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