Re: How to get \fromproperty to work with score headers?
2017-10-29 11:21 GMT+01:00 Shevek: > Does anyone know if there's an updated version of > http://lsr.di.unimi.it/LSR/Snippet?id=467 to work with score-level headers? > It's listed as "to do" in the snippet, but I believe that dates back to > several years ago. I'd like to use \fromproperty #'header:piece to put > movement titles at the top of pages. > > If there isn't a newer version that supports this, I can mess around with > trying to get it working, but I'd appreciated it if anyone can point me in > the right direction to start; what would score-level headers be called? is > the existing snippet structure adequate or is more complexity needed to cope > with bookparts consisting of multiple scores? You could do something at the lines of below, I doubt you'll be very happy with it, though. \version "2.19.65" scI = \score { { r2 } \header { piece = "PIECE-I" %% needed to distinguish from "piece"-settings in other scores pieceI = "PIECE-I" } } scII = \score { { r2 } \header { piece = "PIECE-II" pieceII = "PIECE-II" } } scI-header = #(ly:score-header scI) scII-header = #(ly:score-header scII) #(define-markup-command (markupWithHeader layout props markup) (markup?) "Interpret the given markup with the header fields added to the props. This way, one can re-use the same functions (using fromproperty #'header:field) in the header block and as top-level markup." (let* ( ;; TODO: If we are inside a score, add the score's local header block, too! ;; Currently, I only use the global header block, stored in $defaultheader ;; Make this list an argument of the markup-command? (scopes (list $defaultheader scI-header scII-header )) (alists (map ly:module->alist scopes)) (prefixed-alist (map (lambda (alist) (map (lambda (entry) (cons (string->symbol (string-append "header:" (symbol->string (car entry (cdr entry))) alist)) alists)) (props (append prefixed-alist props (layout-extract-page-properties layout (interpret-markup layout props markup))) \markup \markupWithHeader { \wordwrap { Pieces below are named \fromproperty #'header:pieceI and \fromproperty #'header:pieceII . %% Can't avoid space before dot easily } } \scI \scII Cheers, Harm ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: How to get \fromproperty to work with score headers?
That's essentially what I've been doing, but it requires making each score a bookpart unto itself. It's an okay solution, but it's nice to be able to start a new movement mid-page. Thanks anyway for the suggestion, though! On Sun, Oct 29, 2017 at 9:21 AM, Graham Kingwrote: > On Sun, 2017-10-29 at 15:30 +, Graham King wrote: > > On Sun, 2017-10-29 at 03:21 -0700, Shevek wrote: > > Does anyone know if there's an updated version > ofhttp://lsr.di.unimi.it/LSR/Snippet?id=467 to work with score-level > headers?It's listed as "to do" in the snippet, but I believe that dates back > toseveral years ago. I'd like to use \fromproperty #'header:piece to > putmovement titles at the top of pages. > If there isn't a newer version that supports this, I can mess around > withtrying to get it working, but I'd appreciated it if anyone can point me > inthe right direction to start; what would score-level headers be called? > isthe existing snippet structure adequate or is more complexity needed to > copewith bookparts consisting of multiple scores? > > How about approaching the problem from another direction? Would something > like this be OK? > > \version "2.19.40" > > htitle="Trahe me post te" > hcomposer="Victoria" > > \header { > title=\htitle > composer=\hcomposer > } > > { c''1 \pageBreak 1 \pageBreak 1 } > > \paper{ > evenHeaderMarkup=\markup \fill-line { > \fromproperty #'page:page-number-string > \htitle \hcomposer > } > oddHeaderMarkup= \markup \fill-line { > \on-the-fly #not-first-page \hcomposer > \on-the-fly #not-first-page \htitle > \on-the-fly #not-first-page \fromproperty #'page:page-number-string > } > } > > With acknowledgments to Nacho Alvarez for the idea. > > I don't think this will work for "bookparts with multiple scores." You > need a proper expert... > Apologies for the noise. > > ___ > lilypond-user mailing list > lilypond-user@gnu.org > https://lists.gnu.org/mailman/listinfo/lilypond-user > > ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: How to get \fromproperty to work with score headers?
On Sun, 2017-10-29 at 15:30 +, Graham King wrote: > On Sun, 2017-10-29 at 03:21 -0700, Shevek wrote: > > > Does anyone know if there's an updated version of > > http://lsr.di.unimi.it/LSR/Snippet?id=467 to work with score-level headers? > > It's listed as "to do" in the snippet, but I believe that dates back to > > several years ago. I'd like to use \fromproperty #'header:piece to put > > movement titles at the top of pages. > > > > If there isn't a newer version that supports this, I can mess around with > > trying to get it working, but I'd appreciated it if anyone can point me in > > the right direction to start; what would score-level headers be called? is > > the existing snippet structure adequate or is more complexity needed to cope > > with bookparts consisting of multiple scores? > > > > How about approaching the problem from another direction? Would > something like this be OK? > > \version "2.19.40" > > htitle="Trahe me post te" > hcomposer="Victoria" > > \header { > title=\htitle > composer=\hcomposer > } > > { c''1 \pageBreak 1 \pageBreak 1 } > > \paper{ > evenHeaderMarkup=\markup \fill-line { > \fromproperty #'page:page-number-string > \htitle \hcomposer > } > oddHeaderMarkup= \markup \fill-line { > \on-the-fly #not-first-page \hcomposer > \on-the-fly #not-first-page \htitle > \on-the-fly #not-first-page \fromproperty > #'page:page-number-string > } > } > > With acknowledgments to Nacho Alvarez for the idea. I don't think this will work for "bookparts with multiple scores." You need a proper expert... Apologies for the noise. ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: How to get \fromproperty to work with score headers?
On Sun, 2017-10-29 at 03:21 -0700, Shevek wrote: > Does anyone know if there's an updated version of > http://lsr.di.unimi.it/LSR/Snippet?id=467 to work with score-level headers? > It's listed as "to do" in the snippet, but I believe that dates back to > several years ago. I'd like to use \fromproperty #'header:piece to put > movement titles at the top of pages. > > If there isn't a newer version that supports this, I can mess around with > trying to get it working, but I'd appreciated it if anyone can point me in > the right direction to start; what would score-level headers be called? is > the existing snippet structure adequate or is more complexity needed to cope > with bookparts consisting of multiple scores? > How about approaching the problem from another direction? Would something like this be OK? \version "2.19.40" htitle="Trahe me post te" hcomposer="Victoria" \header { title=\htitle composer=\hcomposer } { c''1 \pageBreak 1 \pageBreak 1 } \paper{ evenHeaderMarkup=\markup \fill-line { \fromproperty #'page:page-number-string \htitle \hcomposer } oddHeaderMarkup= \markup \fill-line { \on-the-fly #not-first-page \hcomposer \on-the-fly #not-first-page \htitle \on-the-fly #not-first-page \fromproperty #'page:page-number-string } } With acknowledgments to Nacho Alvarez for the idea. ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: How to get \fromproperty to work with score headers?
Am 29.10.2017 um 11:21 schrieb Shevek: Does anyone know if there's an updated version of http://lsr.di.unimi.it/LSR/Snippet?id=467 to work with score-level headers? It's listed as "to do" in the snippet, but I believe that dates back to several years ago. I'd like to use \fromproperty #'header:piece to put movement titles at the top of pages. It looks like \fromproperty doesn’t take score-level headers into account. The following code shows “Toplevel silence” in all page headers. If you don’t define a toplevel piece header, nothing is shown. \version "2.19.80" % taken from titling-init.ly, replaced instrument by piece \paper { oddHeaderMarkup = \markup \fill-line { "" \on-the-fly #not-part-first-page \fromproperty #'header:piece \on-the-fly #print-page-number-check-first \fromproperty #'page:page-number-string } evenHeaderMarkup = \markup \fill-line { \on-the-fly #print-page-number-check-first \fromproperty #'page:page-number-string \on-the-fly #not-part-first-page \fromproperty #'header:piece "" } } \header { title = "Suite of silences" piece = "Toplevel silence" } \score { \header { piece = "Silence I" } R1*100 } \score { \header { piece = "Silence II" } R1*100 } \score { \header { piece = "Silence III" } R1*100 } \score { \header { piece = "Silence IV" } R1*100 } \score { \header { piece = "Silence V" } R1*100 } \score { \header { piece = "Silence VI" } R1*100 } ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
How to get \fromproperty to work with score headers?
Does anyone know if there's an updated version of http://lsr.di.unimi.it/LSR/Snippet?id=467 to work with score-level headers? It's listed as "to do" in the snippet, but I believe that dates back to several years ago. I'd like to use \fromproperty #'header:piece to put movement titles at the top of pages. If there isn't a newer version that supports this, I can mess around with trying to get it working, but I'd appreciated it if anyone can point me in the right direction to start; what would score-level headers be called? is the existing snippet structure adequate or is more complexity needed to cope with bookparts consisting of multiple scores? -- Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user