Re: Printing movement titles in page header
Thanks to Jan-Peter's lalily, I now have a working solution, attached. At 09:05 on 09 Jul 2015, Mark Knoop wrote: Thanks Jan-Peter, I'll take a look at this and post back if I make any progress. Cheers, Mark At 09:21 on 09 Jul 2015, Jan-Peter Voigt wrote: Hi Mark, I know this issue and wrote and use some code which tracks the current toc entry. The bad thing - of course this is a good thing ;) - I am employed in a full time job with absolutely no relation to lilypond, so I can't say, when I am able to discover the magic ... Just for completenes - I don't think this uncommented chaos is readable ;) In line 217 in the default paper-definition, I call the property #'toc:current : https://github.com/jpvoigt/lalily/blob/master/lalily/paper.lalily-default.ly#L196 this property is set in markup-init.scm line 153: https://github.com/jpvoigt/lalily/blob/master/lalily/lalily/markup-init.scm#L131 So, I don't expect anybody to extract this from lalily, as this might be quite frustrating. But if you like, you can see, if the use of lalily conceptually does, what you want. And perhaps there will be times, when I am able extract this to openlilylib. Cheers, Jan-Peter Am 08.07.2015 um 13:41 schrieb Mark Knoop: I'm trying to include the title of the current movement in the page header. This works if I use bookparts to seperate the movements, but not by setting header:piece in a score block. I don't want to use bookparts as I don't want pagebreaks between movements. Any ideas on how to achieve this? \version 2.19.22 \header { title = My Piece composer = Me tagline = ##f % piece only prints in header if set here or in bookpart header piece = Global Piece } \paper { oddHeaderMarkup = \markup \fill-line { \on-the-fly #not-part-first-page \fromproperty #'header:piece \on-the-fly #not-part-first-page \fromproperty #'header:title \on-the-fly #print-page-number-check-first \fromproperty #'page:page-number-string } evenHeaderMarkup = \oddHeaderMarkup } \book { \bookpart { % piece only prints in header if set here or in top-level header \header { piece = Part 1 } \score { % setting piece here has no effect \header { piece = Movement 1 } \repeat unfold 400 c'1 } \score { % setting piece here has no effect \header { piece = Movement 2 } \repeat unfold 400 d'1 } } \bookpart { \score { % setting piece here has no effect, % even without a bookpart level header \header { piece = Movement 3 } \repeat unfold 400 e'1 } } } ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user -- Mark Knoop \version 2.19.22 % Scheme functions ripped from https://github.com/jpvoigt/lalily % Thanks to Jan-Peter Voigt #(define-public (register-markup-producer name proc) #f) #(define-public (get-markup-producer name) #f) #(let ((table (list))) (set! register-markup-producer (lambda (name proc) (set! table (assoc-set! table name proc (set! get-markup-producer (lambda (name) (assoc-get name table #(define-markup-command (fromproperties layout props arg)(list?) (let ((mup (get-markup-producer fromproperties-markup))) (interpret-markup layout props (mup layout props (list arg) #(register-markup-producer fromproperties-markup (lambda (layout props args) (let ((ret (markup))) (for-each (lambda (sym)(let ((val (chain-assoc-get sym props))) (if (and (or (string? val)(markup? val)) ( (string-length (markup-string val)) 0)) (set! ret val (reverse (car args))) ret))) #(define-markup-command (execMarkup layout props proc) (procedure?) (let ((m (proc layout props))) (cond ((ly:stencil? m) m) ((markup? m) (interpret-markup layout props m)) (else (interpret-markup layout props (markup (format ~A m))) #(define-markup-command (delayed layout props mup) (markup?) (let* ((line-part (chain-assoc-get 'line-part props 1)) (line-width (* (ly:output-def-lookup layout 'line-width) line-part)) (gauge-stencil (interpret-markup layout props mup)) ; (markup #:super * ABCDEFGHIJKLMNOPQRSTUVWXYZÃÃÃÃ ))) (x-ext (ly:stencil-extent gauge-stencil X)) (y-ext (ly:stencil-extent gauge-stencil Y))) (ly:make-stencil `(delay-stencil-evaluation ,(delay (ly:stencil-expr (let* ((table (ly:output-def-lookup layout 'label-page-table)) (cur-page 0) (current-toc (markup))) (set! cur-page
Re: Printing movement titles in page header
On 09/07/15 09:05, Mark Knoop wrote: Thanks Jan-Peter, I'll take a look at this and post back if I make any progress. I was pointed at the scheme code that prints the header - can't remember what it was and I'm not on the computer with it so I can't get easy access. Find it and try modifying it. I've got a similar problem to yours, in that I want to have multiple scores on a single page, but I need the FULL header printed for each score. The information that is (by default) left out is exactly the information that changes between scores ... :-( If/when I get back to my score where I muck about with the headers, I'll point you at it, if someone doesn't beat me to it. (You redefine some function in the \paper block.) Cheers, Wol ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Printing movement titles in page header
Am 09.07.2015 um 16:34 schrieb Wols Lists: On 09/07/15 09:05, Mark Knoop wrote: Thanks Jan-Peter, I'll take a look at this and post back if I make any progress. I was pointed at the scheme code that prints the header - can't remember what it was and I'm not on the computer with it so I can't get easy access. Find it and try modifying it. I've got a similar problem to yours, in that I want to have multiple scores on a single page, but I need the FULL header printed for each score. Should be that \paper { print-all-headers = ##t } will fix that, see http://lilypond.org/doc/v2.19/Documentation/notation/other-paper-variables#index-print_002dall_002dheaders. Yours, Simon The information that is (by default) left out is exactly the information that changes between scores ... :-( If/when I get back to my score where I muck about with the headers, I'll point you at it, if someone doesn't beat me to it. (You redefine some function in the \paper block.) Cheers, Wol ___ 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: Printing movement titles in page header
On 09/07/15 19:48, Simon Albrecht wrote: Am 09.07.2015 um 16:34 schrieb Wols Lists: On 09/07/15 09:05, Mark Knoop wrote: Thanks Jan-Peter, I'll take a look at this and post back if I make any progress. I was pointed at the scheme code that prints the header - can't remember what it was and I'm not on the computer with it so I can't get easy access. Find it and try modifying it. I've got a similar problem to yours, in that I want to have multiple scores on a single page, but I need the FULL header printed for each score. Should be that \paper { print-all-headers = ##t } will fix that, see http://lilypond.org/doc/v2.19/Documentation/notation/other-paper-variables#index-print_002dall_002dheaders. Thanks, I'll have a play :-) Cheers, Wol ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Printing movement titles in page header
I'm trying to include the title of the current movement in the page header. This works if I use bookparts to seperate the movements, but not by setting header:piece in a score block. I don't want to use bookparts as I don't want pagebreaks between movements. Any ideas on how to achieve this? I made a quick test. If you remove the bookparts blocks it works. Is this what you want? If I correctly understood the OP, the problem is that he wants the string Movement 1 (2, 3 - whatever he assigns to piece inside the score block) in the header. Currently you see e.g. on page 2 the string Part 1 which is set outside the score block. Best wishes, Michael -- Michael Gerdau email: m...@qata.de GPG-keys available on request or at public keyserver signature.asc Description: This is a digitally signed message part. ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Printing movement titles in page header
Hi Mark, I know this issue and wrote and use some code which tracks the current toc entry. The bad thing - of course this is a good thing ;) - I am employed in a full time job with absolutely no relation to lilypond, so I can't say, when I am able to discover the magic ... Just for completenes - I don't think this uncommented chaos is readable ;) In line 217 in the default paper-definition, I call the property #'toc:current : https://github.com/jpvoigt/lalily/blob/master/lalily/paper.lalily-default.ly#L196 this property is set in markup-init.scm line 153: https://github.com/jpvoigt/lalily/blob/master/lalily/lalily/markup-init.scm#L131 So, I don't expect anybody to extract this from lalily, as this might be quite frustrating. But if you like, you can see, if the use of lalily conceptually does, what you want. And perhaps there will be times, when I am able extract this to openlilylib. Cheers, Jan-Peter Am 08.07.2015 um 13:41 schrieb Mark Knoop: I'm trying to include the title of the current movement in the page header. This works if I use bookparts to seperate the movements, but not by setting header:piece in a score block. I don't want to use bookparts as I don't want pagebreaks between movements. Any ideas on how to achieve this? \version 2.19.22 \header { title = My Piece composer = Me tagline = ##f % piece only prints in header if set here or in bookpart header piece = Global Piece } \paper { oddHeaderMarkup = \markup \fill-line { \on-the-fly #not-part-first-page \fromproperty #'header:piece \on-the-fly #not-part-first-page \fromproperty #'header:title \on-the-fly #print-page-number-check-first \fromproperty #'page:page-number-string } evenHeaderMarkup = \oddHeaderMarkup } \book { \bookpart { % piece only prints in header if set here or in top-level header \header { piece = Part 1 } \score { % setting piece here has no effect \header { piece = Movement 1 } \repeat unfold 400 c'1 } \score { % setting piece here has no effect \header { piece = Movement 2 } \repeat unfold 400 d'1 } } \bookpart { \score { % setting piece here has no effect, % even without a bookpart level header \header { piece = Movement 3 } \repeat unfold 400 e'1 } } } ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Printing movement titles in page header
Il giorno mer 8 lug 2015 alle 13:41, Mark Knoop m...@opus11.net ha scritto: I'm trying to include the title of the current movement in the page header. This works if I use bookparts to seperate the movements, but not by setting header:piece in a score block. I don't want to use bookparts as I don't want pagebreaks between movements. Any ideas on how to achieve this? I made a quick test. If you remove the bookparts blocks it works. Is this what you want? Me-My-Piece-2.pdf Description: Adobe PDF document ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Printing movement titles in page header
Thanks Jan-Peter, I'll take a look at this and post back if I make any progress. Cheers, Mark At 09:21 on 09 Jul 2015, Jan-Peter Voigt wrote: Hi Mark, I know this issue and wrote and use some code which tracks the current toc entry. The bad thing - of course this is a good thing ;) - I am employed in a full time job with absolutely no relation to lilypond, so I can't say, when I am able to discover the magic ... Just for completenes - I don't think this uncommented chaos is readable ;) In line 217 in the default paper-definition, I call the property #'toc:current : https://github.com/jpvoigt/lalily/blob/master/lalily/paper.lalily-default.ly#L196 this property is set in markup-init.scm line 153: https://github.com/jpvoigt/lalily/blob/master/lalily/lalily/markup-init.scm#L131 So, I don't expect anybody to extract this from lalily, as this might be quite frustrating. But if you like, you can see, if the use of lalily conceptually does, what you want. And perhaps there will be times, when I am able extract this to openlilylib. Cheers, Jan-Peter Am 08.07.2015 um 13:41 schrieb Mark Knoop: I'm trying to include the title of the current movement in the page header. This works if I use bookparts to seperate the movements, but not by setting header:piece in a score block. I don't want to use bookparts as I don't want pagebreaks between movements. Any ideas on how to achieve this? \version 2.19.22 \header { title = My Piece composer = Me tagline = ##f % piece only prints in header if set here or in bookpart header piece = Global Piece } \paper { oddHeaderMarkup = \markup \fill-line { \on-the-fly #not-part-first-page \fromproperty #'header:piece \on-the-fly #not-part-first-page \fromproperty #'header:title \on-the-fly #print-page-number-check-first \fromproperty #'page:page-number-string } evenHeaderMarkup = \oddHeaderMarkup } \book { \bookpart { % piece only prints in header if set here or in top-level header \header { piece = Part 1 } \score { % setting piece here has no effect \header { piece = Movement 1 } \repeat unfold 400 c'1 } \score { % setting piece here has no effect \header { piece = Movement 2 } \repeat unfold 400 d'1 } } \bookpart { \score { % setting piece here has no effect, % even without a bookpart level header \header { piece = Movement 3 } \repeat unfold 400 e'1 } } } ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user -- Mark Knoop ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user