Making a \layout definition in Scheme (was: edition-engraver and multiple scores)

2018-04-04 Thread Urs Liska



Am 04.04.2018 um 12:17 schrieb Urs Liska:



Am 04.04.2018 um 10:32 schrieb Jan-Peter Voigt:

... there is a function
ly:score-add-output-def!
to add layout- and midi-blocks to a score object.

Cheers
Jan-Peter


Thanks, this finally is what I should have been looking for!
Bess
Urs



OK, but now I have a follow-up question which is quite similar to my 
other post from today (and I'm afraid the answer is similarly embarrassing):


I managed to install an editionID to a specific movement's score with 
this code:


  (ly:score-add-output-def! score
#{
  \layout {
\context {
  \Score
  #(editionID #f movement-path)
}
  }
#})

which actually works when I use that "movement-path" variable to 
address  in \editionMod later.


However, I would like to be able to also write this without the 
permanent switches, i.e. in pure Scheme syntax.

But unlike \key I can't simply "call" layout.

My impression (after looking at the Scheme functions reference page and 
a number of source files) is that I could use (ly:make-output-def) to 
create the output definition and then use ly:output-def-set-variable! to 
achieve the goal. But after trying out a number of things I must admit I 
don't get to an end with it.


So again I have to hope for any hint ...

Best
Urs

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: edition-engraver and multiple scores

2018-04-04 Thread Urs Liska



Am 04.04.2018 um 10:32 schrieb Jan-Peter Voigt:

... there is a function
ly:score-add-output-def!
to add layout- and midi-blocks to a score object.

Cheers
Jan-Peter


Thanks, this finally is what I should have been looking for!
Bess
Urs

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: edition-engraver and multiple scores

2018-04-04 Thread Jan-Peter Voigt
... there is a function
ly:score-add-output-def!
to add layout- and midi-blocks to a score object.

Cheers
Jan-Peter

Am 3. April 2018 11:34:58 MESZ schrieb Urs Liska :
>I ran into an issue with the edition-engraver, targeting individual 
>scores when multiple scores are compiled within a bookpart.
>
>It's actually within the 'page-layout' or rather the 'breaks' 
>openLilyLib package, and I can imagine that my issue is related to 
>another one that was raised recently (that either of these packages 
>didn't work well with independent edition-engraver targets).
>
>The 'breaks' package 
>(https://github.com/openlilylib/breaks/blob/master/package.ily)
>installs 
>itself like this:
>
>% Install editionID
>\layout {
>   \context {
> \Score
> \editionID ##f breaks
>   }
>}
>
>which can later (e.g. in the page-layout.conditional-breaks package: 
>https://github.com/openlilylib/page-layout/blob/master/conditional-breaks/module.ily#L113)
>
>be addressed with (for example)
>
>% insert invisible barlines to enable breaks within measures
>\editionModList conditional-breaks breaks.Score.A
>\bar "" #in-measure-breaks
>
>This works perfectly - as long as there is only one score to be 
>compiled. However, if more than one score is compiled (at least in the 
>same bookpart) it seems that all the mods for all scores are merged 
>together, with the result that in each score all the line breaks for
>all 
>scores are applied.
>
>Am I understanding it right that I would have to use \editionID in a 
>layout block that only affects an individual score, giving them 
>individual names?
>
>And how could I do that if I don't have a literal \score {} block but 
>generate the scores like the following 
>(https://git.openlilylib.org/bfsc/kayser/blob/techdoc/includes/lib/engrave.ily#L163)
>
> (ly:book-process
>  workgroup-book ; a \book {} object
>  #{ \paper {} #}  ; non-functional, placeholder
>  $defaultlayout ;; merged from all layout definitions
>  (get-output-name
>
>where 'workgroup-book' is a \book to which multiple bookparts are added
>with
>
>(ly:book-add-bookpart! workgroup-book
>  (ly:make-book-part
>(let ((movements (get-movement-list work-path)))
>  (reverse
>  (append-map
>   list
>   (map (lambda (mvt)
>  (list (makeMovementTitle (append work-path (list mvt)
> movements)
>   (map (lambda (mvt)
> (make-score (append work-path (list mvt
> movements))
>
>where a list of alternating title markups and scores are added to the 
>bookpart, and the scores are created with (at its core)
>
> (ly:make-score
>  (make-music 'SimultaneousMusic 'elements
>(filter
> (lambda (l) (not (null? l)))
> (map (lambda (elt) (staff elt)) elements
>
>
>So IIUC it boils down to the question: how can I apply \editionID (or 
>some equivalent code) to a score that is created with ly:make-score. As
>
>far as I have seen ly:make-score will only accept the music expression 
>and not the \layout {} or \midi {} blocks I can nest within a \score {}
>
>written in LilyPond language.
>And: if I manage to "install" an edition ID within that expression, is 
>it true that I can later address this score specifically?
>
>Thanks for any hints or explanations
>Urs

-- 
Diese Nachricht wurde von meinem Android-Gerät mit K-9 Mail gesendet.___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: edition-engraver and multiple scores

2018-04-03 Thread Jan-Peter Voigt
... and to add the editionID with ly:make-score there are parameters to achieve 
that. The editionID is also a context prop. You might look up the code of 
editionID. And maybe the lalily templates give some inspiration. (I moved it 
oll recently)


Am 3. April 2018 11:34:58 MESZ schrieb Urs Liska :
>I ran into an issue with the edition-engraver, targeting individual 
>scores when multiple scores are compiled within a bookpart.
>
>It's actually within the 'page-layout' or rather the 'breaks' 
>openLilyLib package, and I can imagine that my issue is related to 
>another one that was raised recently (that either of these packages 
>didn't work well with independent edition-engraver targets).
>
>The 'breaks' package 
>(https://github.com/openlilylib/breaks/blob/master/package.ily)
>installs 
>itself like this:
>
>% Install editionID
>\layout {
>   \context {
> \Score
> \editionID ##f breaks
>   }
>}
>
>which can later (e.g. in the page-layout.conditional-breaks package: 
>https://github.com/openlilylib/page-layout/blob/master/conditional-breaks/module.ily#L113)
>
>be addressed with (for example)
>
>% insert invisible barlines to enable breaks within measures
>\editionModList conditional-breaks breaks.Score.A
>\bar "" #in-measure-breaks
>
>This works perfectly - as long as there is only one score to be 
>compiled. However, if more than one score is compiled (at least in the 
>same bookpart) it seems that all the mods for all scores are merged 
>together, with the result that in each score all the line breaks for
>all 
>scores are applied.
>
>Am I understanding it right that I would have to use \editionID in a 
>layout block that only affects an individual score, giving them 
>individual names?
>
>And how could I do that if I don't have a literal \score {} block but 
>generate the scores like the following 
>(https://git.openlilylib.org/bfsc/kayser/blob/techdoc/includes/lib/engrave.ily#L163)
>
> (ly:book-process
>  workgroup-book ; a \book {} object
>  #{ \paper {} #}  ; non-functional, placeholder
>  $defaultlayout ;; merged from all layout definitions
>  (get-output-name
>
>where 'workgroup-book' is a \book to which multiple bookparts are added
>with
>
>(ly:book-add-bookpart! workgroup-book
>  (ly:make-book-part
>(let ((movements (get-movement-list work-path)))
>  (reverse
>  (append-map
>   list
>   (map (lambda (mvt)
>  (list (makeMovementTitle (append work-path (list mvt)
> movements)
>   (map (lambda (mvt)
> (make-score (append work-path (list mvt
> movements))
>
>where a list of alternating title markups and scores are added to the 
>bookpart, and the scores are created with (at its core)
>
> (ly:make-score
>  (make-music 'SimultaneousMusic 'elements
>(filter
> (lambda (l) (not (null? l)))
> (map (lambda (elt) (staff elt)) elements
>
>
>So IIUC it boils down to the question: how can I apply \editionID (or 
>some equivalent code) to a score that is created with ly:make-score. As
>
>far as I have seen ly:make-score will only accept the music expression 
>and not the \layout {} or \midi {} blocks I can nest within a \score {}
>
>written in LilyPond language.
>And: if I manage to "install" an edition ID within that expression, is 
>it true that I can later address this score specifically?
>
>Thanks for any hints or explanations
>Urs

-- 
Diese Nachricht wurde von meinem Android-Gerät mit K-9 Mail gesendet.___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: edition-engraver and multiple scores

2018-04-03 Thread Jan-Peter Voigt
Hi Urs,

I am not at my desk right now, but IISC you named the right thing: Every score 
needs its own ID so that the EE is able to target the right score. 
We might *additionally* store mods as a Score context prop. for certain use 
cases. But still I strongly vote for IDs per score.

Jan-Peter

Am 3. April 2018 11:34:58 MESZ schrieb Urs Liska :
>I ran into an issue with the edition-engraver, targeting individual 
>scores when multiple scores are compiled within a bookpart.
>
>It's actually within the 'page-layout' or rather the 'breaks' 
>openLilyLib package, and I can imagine that my issue is related to 
>another one that was raised recently (that either of these packages 
>didn't work well with independent edition-engraver targets).
>
>The 'breaks' package 
>(https://github.com/openlilylib/breaks/blob/master/package.ily)
>installs 
>itself like this:
>
>% Install editionID
>\layout {
>   \context {
> \Score
> \editionID ##f breaks
>   }
>}
>
>which can later (e.g. in the page-layout.conditional-breaks package: 
>https://github.com/openlilylib/page-layout/blob/master/conditional-breaks/module.ily#L113)
>
>be addressed with (for example)
>
>% insert invisible barlines to enable breaks within measures
>\editionModList conditional-breaks breaks.Score.A
>\bar "" #in-measure-breaks
>
>This works perfectly - as long as there is only one score to be 
>compiled. However, if more than one score is compiled (at least in the 
>same bookpart) it seems that all the mods for all scores are merged 
>together, with the result that in each score all the line breaks for
>all 
>scores are applied.
>
>Am I understanding it right that I would have to use \editionID in a 
>layout block that only affects an individual score, giving them 
>individual names?
>
>And how could I do that if I don't have a literal \score {} block but 
>generate the scores like the following 
>(https://git.openlilylib.org/bfsc/kayser/blob/techdoc/includes/lib/engrave.ily#L163)
>
> (ly:book-process
>  workgroup-book ; a \book {} object
>  #{ \paper {} #}  ; non-functional, placeholder
>  $defaultlayout ;; merged from all layout definitions
>  (get-output-name
>
>where 'workgroup-book' is a \book to which multiple bookparts are added
>with
>
>(ly:book-add-bookpart! workgroup-book
>  (ly:make-book-part
>(let ((movements (get-movement-list work-path)))
>  (reverse
>  (append-map
>   list
>   (map (lambda (mvt)
>  (list (makeMovementTitle (append work-path (list mvt)
> movements)
>   (map (lambda (mvt)
> (make-score (append work-path (list mvt
> movements))
>
>where a list of alternating title markups and scores are added to the 
>bookpart, and the scores are created with (at its core)
>
> (ly:make-score
>  (make-music 'SimultaneousMusic 'elements
>(filter
> (lambda (l) (not (null? l)))
> (map (lambda (elt) (staff elt)) elements
>
>
>So IIUC it boils down to the question: how can I apply \editionID (or 
>some equivalent code) to a score that is created with ly:make-score. As
>
>far as I have seen ly:make-score will only accept the music expression 
>and not the \layout {} or \midi {} blocks I can nest within a \score {}
>
>written in LilyPond language.
>And: if I manage to "install" an edition ID within that expression, is 
>it true that I can later address this score specifically?
>
>Thanks for any hints or explanations
>Urs

-- 
Diese Nachricht wurde von meinem Android-Gerät mit K-9 Mail gesendet.___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


edition-engraver and multiple scores

2018-04-03 Thread Urs Liska
I ran into an issue with the edition-engraver, targeting individual 
scores when multiple scores are compiled within a bookpart.


It's actually within the 'page-layout' or rather the 'breaks' 
openLilyLib package, and I can imagine that my issue is related to 
another one that was raised recently (that either of these packages 
didn't work well with independent edition-engraver targets).


The 'breaks' package 
(https://github.com/openlilylib/breaks/blob/master/package.ily) installs 
itself like this:


% Install editionID
\layout {
  \context {
\Score
\editionID ##f breaks
  }
}

which can later (e.g. in the page-layout.conditional-breaks package: 
https://github.com/openlilylib/page-layout/blob/master/conditional-breaks/module.ily#L113) 
be addressed with (for example)


   % insert invisible barlines to enable breaks within measures
   \editionModList conditional-breaks breaks.Score.A
   \bar "" #in-measure-breaks

This works perfectly - as long as there is only one score to be 
compiled. However, if more than one score is compiled (at least in the 
same bookpart) it seems that all the mods for all scores are merged 
together, with the result that in each score all the line breaks for all 
scores are applied.


Am I understanding it right that I would have to use \editionID in a 
layout block that only affects an individual score, giving them 
individual names?


And how could I do that if I don't have a literal \score {} block but 
generate the scores like the following 
(https://git.openlilylib.org/bfsc/kayser/blob/techdoc/includes/lib/engrave.ily#L163)


(ly:book-process
 workgroup-book ; a \book {} object
 #{ \paper {} #}  ; non-functional, placeholder
 $defaultlayout ;; merged from all layout definitions
 (get-output-name

where 'workgroup-book' is a \book to which multiple bookparts are added with

   (ly:book-add-bookpart! workgroup-book
 (ly:make-book-part
   (let ((movements (get-movement-list work-path)))
 (reverse
 (append-map
  list
  (map (lambda (mvt)
 (list (makeMovementTitle (append work-path (list mvt)
movements)
  (map (lambda (mvt)
(make-score (append work-path (list mvt
movements))

where a list of alternating title markups and scores are added to the 
bookpart, and the scores are created with (at its core)


(ly:make-score
 (make-music 'SimultaneousMusic 'elements
   (filter
(lambda (l) (not (null? l)))
(map (lambda (elt) (staff elt)) elements


So IIUC it boils down to the question: how can I apply \editionID (or 
some equivalent code) to a score that is created with ly:make-score. As 
far as I have seen ly:make-score will only accept the music expression 
and not the \layout {} or \midi {} blocks I can nest within a \score {} 
written in LilyPond language.
And: if I manage to "install" an edition ID within that expression, is 
it true that I can later address this score specifically?


Thanks for any hints or explanations
Urs
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user