bug-lilypond
[Top][All Lists]
Advanced

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

Re: header properties not visible within score


From: Thomas Morley
Subject: Re: header properties not visible within score
Date: Wed, 1 May 2019 23:43:15 +0200

Am Mi., 1. Mai 2019 um 09:59 Uhr schrieb Markus Rother <address@hidden>:
>
> % Embedding \fromproperty in a \score is not working (at least not) for
> header properties.
> % If header scope is hidden by design, how can I achieve the following?
> % Many thanks and best regards, Markus
> \book {
>   \paper {
>     indent = 0\mm
>     scoreTitleMarkup = \markup {
>       \fromproperty #'header:piece % works as expected
>       \score {
>         { s^\markup { "FOO" \fromproperty #'header:piece "BAR" } } %
> property not visible
>         \layout {}
>       }
>     }
>   }
>   \score {
>     { s1 }
>     \header {
>       piece = "MENUET"
>     }
>   }
>   \score {
>     { s1 }
>     \header {
>       piece = "RONDEAU"
>     }
>   }
> }

Hi Markus,

thanks for your report.

As far as I understand things, \fromproperty can't be used
successfully outside from \paper and/or in common markup.
(score-markup is such a common markup.)

Thus, below fails to print "MY-TITLE"
\header { title = "MY-TITLE" }
\markup { something \fromproperty #'header:title something }

There is
http://lsr.di.unimi.it/LSR/Item?id=467
which has access to $defaultheader, thus below works
\header { title = "MY-TITLE" }
\markup { something \markupWithHeader \fromproperty #'header:title something }
(code for markupWithHeader is not copied here, take it from the linked
LSR-snippet)
As soon as you wrap \book around above it fails again, because \header
in book is not the $defaultheader.
There's a TODO in said snippet:
";; TODO: If we are inside a score, add the score's local header block, too!"
I don't know how, though.

So yes, it would be nice to have a method to access book/score-header
like the LSR-snippet does for $defaultheader.
Not sure if possible at all...

For now, I thought about how to find a work-around for your use-case...
Why do you need a score _in_ scoreTitleMarkup? Likely for a short
excerpt or hints about scordatura or similiar.
But is it really necessary to code the piece-name as a common
TextScript _inside_ this score?
Probably you can do something like below. Yeah, more manual work, I know ...

\book {
  \paper {
    indent = 0\mm
    scoreTitleMarkup = \markup \column {
      \line { \hspace #20  "FOO" \fromproperty #'header:piece "BAR" }
      \fromproperty #'header:sample
      \fromproperty #'header:piece
    }
  }
  \score {
    { s1 }
    \header {
      piece = "MENUET"
      sample = \markup \score { cis'1 \layout { indent = 30 } }
    }
  }
  \score {
    { s1 }
    \header {
      piece = "RONDEAU"
      sample = \markup \score { d'1 \layout { indent = 30 } }
    }
  }
}


Cheers,
  Harm



reply via email to

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