Re: No line break after score

2022-03-20 Thread Robin Bannister

On 14.03.2022 11:22, Robin Bannister wrote:

Patrick Martin wrote:

For example, in this picture, 22 follows directly on from the end of 21, 
and 23 from 22, etc. Or would this need to be implemented some other way?



Pseudoindent could help with the horizontal aspect.
https://lsr.di.unimi.it/LSR/Item?id=1098
You would choose an initial left-indent and a final right-indent for
each piece, and apply these manually.


Then get the appropriate vertical neighbours to overlap, without
involving enclosing StaffGroups and such.  I have no concrete
suggestions for that



Well, here is a way, using a NonMusicalPaperColumn override, such as
pseudoIndent already uses.  The whole thing is rather clunky and 
includes a crude workaround which may need refining.


You copy the first part of pseudoIndentsYdemo.ly.
Choose a global-staff-size, set it, and don't change it later.
Then you work down the page, filling each line with system fragments.
   Each pseudoIndentsY call produces and places one fragment.
   Keep these calls in a separate voice in the first staff.
   All the parameters are in staff-spaces.
   In this inlay usage, the right-indent parameter can trip you up.
   Measures squeezed out by lack of space may jump out of sight.
   But the pagewise lookups make the line positioning easy to adjust.
When you reach the page bottom insert a manual pageBreak.

The whole thing is extremely manual.
Don't want to change anything bulky when you're done!
It should work ok with tame systems like your chorales example.


Cheers,
Robin


\version "2.22.0"

\include "pseudoIndent.ily" %  cf LSR1098

pseudoIndentsY = % applies vertical positioning to pseudoIndents result 
#(define-music-function (parser location name-tweaks left-indent right-indent 
Y-pos) ; cf apply-Y-pos, which needs pseudoIndentsY in the _first_ staff
  ((markup-list? '()) number? number? number?)
  (let* ( 
(apply-Y-pos ; position our system  staff-spaces from top of page
  (let* ((even-taller 10)) ; than the top of the tallest grob, we hope! 
   #{ % misusing barline to swamp unknown first_staff_min_translation
 \override Staff.BarLine.Y-extent = #(cons -2 even-taller)
 \overrideProperty Score.NonMusicalPaperColumn.line-break-system-details
  .Y-offset #(- Y-pos even-taller) % wonky if even-taller isn't taller
   #}))) % cf lilypond-user/2011-05/msg00366.html patch from Joe N.
  #{
\pseudoIndents $name-tweaks $left-indent $right-indent 
% try for explicit vertical positioning: 
#apply-Y-pos 
  #}))

\paper { % needed for apply-Y-pos
  system-system-spacing = #'(
(basic_distance . 0)
(minimum_distance . 0)
(padding . -10)
(stretchability . 0))
  score-system-spacing =  #'(
(basic_distance . 0)
(minimum_distance . 0)
(padding . -10)
(stretchability . 0))
}

\layout { \autoPageBreaksOff } % but manual \pageBreak still effective

%

#(set-global-staff-size 20) % choose a value and stick to it!
\paper { indent = 8 } % or = 0, adjusting initial left-indents individually 
\layout { \override Score.InstrumentName.padding = #2 }
\header { title = "pseudoIndentsY  demo" }


% convenience pagewise lookups for desired Y-pos staff-spaces via line-number: 
%   the first value is the distance of line 1 below the page top 
%   the second value is the distance of line 2 below line 1, and so on
#(define (Y-p1 line-num) (apply + (take '(15 22 23 22 21 21 21 21) line-num)))
#(define (Y-p2 line-num) (apply + (take '(10 00 00 00 00 00 00 00) line-num)))

  
\score { 
  \new StaffGroup \with { instrumentName = "A" }
   <<
 \new Staff
 <<
   \new Voice { \repeat unfold 47 a'4 a'''4 }
   \new Voice {
 \pseudoIndentsY 00 00 #(Y-p1 1) s1*8 
 \pseudoIndentsY 00 55 #(Y-p1 2) s1*4 \bar"|." 
   }
 >>
 \new Staff { \clef bass \repeat unfold 23 a2 a''2 }
   >>
}

\noPageBreak

\score { 
  \new StaffGroup \with { instrumentName = "B" }
  <<
\new Staff
<< 
  \new Voice { \repeat unfold 48 b'4 }
  \new Voice {
\pseudoIndentsY 60 00 #(Y-p1 2) s1*3
\pseudoIndentsY 00 00 #(Y-p1 3) s1*8 
\pseudoIndentsY 00 90 #(Y-p1 4) s1*1\bar"|." 
  }
>>
\new Staff { \clef bass \repeat unfold 24 b2 } 
  >>
}

\noPageBreak

\score { 
  \new Staff \with { instrumentName = "C" }
  << 
\new Voice { \repeat unfold 8 c''4 }
\new Voice {
  \pseudoIndentsY 25 50 #(Y-p1 4) s1*2 \bar"|." 
}
  >>
}

\noPageBreak

\score { 
  \new StaffGroup \with { instrumentName = "D" }
  <<
\new Staff
<< 
  \new Voice { \repeat unfold 12 d''4 }
  \new Voice {
\pseudoIndentsY 65 00 #(Y-p1 4) s1*3 \bar"|." 
  }
>>
\new Staff { \clef bass \repeat unfold 6 d2 }
  >>
}

\noPageBreak
  
\score { 
\new StaffGroup \with { instrumentName = "E" }
  <<
\new Staff
<<
  \new Voice { \repeat unfold 47 e'4 e'''4 }
  \new Voice {
 

Re: No line break after score

2022-03-14 Thread Robin Bannister

Patrick Martin wrote:

For example, in this picture, 22 follows directly on from the end of 21, 
and 23 from 22, etc. Or would this need to be implemented some other way?


Are you a Tetris fan?


Pseudoindent could help with the horizontal aspect.
https://lsr.di.unimi.it/LSR/Item?id=1098
You would choose an initial left-indent and a final right-indent for 
each piece, and apply these manually.



Then get the appropriate vertical neighbours to overlap, without 
involving enclosing StaffGroups and such.  I have no concrete 
suggestions for that, but Aaron demonstrated \markup \overlay for a 
similar case here:

https://lists.gnu.org/archive/html/lilypond-user/2021-08/msg00115.html


Cheers,
Robin



Re: No line break after score

2022-03-13 Thread Valentin Petzel
Hello  Patrick, hello Kieren (how is your musical going?),

Considering how this probably does not make a lot of sense with variable 
instrumentation I guess the thing we actually want there is being able to 
break a system without skipping to the next line. This is something that is 
occasionally used for codas and stuff, and there are some solutions for this, 
which rely on stopping and starting staves and drawing kind of "fake" start 
delimiter. Still, I’m dreaming of eventually being able to do this properly. 
But it would require a rework of some things, so it takes some time to do.

Cheers, Valentin

Am Montag, 14. März 2022, 00:08:31 CET schrieb Kieren MacMillan:
> Hi Patrick,
> 
> If you implemented this in markup, could it be returned in markup-lines and
> then stacked? Just a thought… I've never tried to do such a thing!
> Certainly, you could do this manually… but it would be amazing if Lilypond
> had a way of handling "irregular" layouts (this, piano duo, etc.)
> "automagically".
> 
> Looking forward to seeing the solution!
> Kieren.
> 
> > On Mar 11, 2022, at 11:44 AM, Patrick Martin 
> > wrote:
> > 
> > Hello,
> > 
> > Can anyone help with a layout query, please? Is there some way to allow a
> > score within a book to follow the previous score without a line break?
> > For example, in this picture, 22 follows directly on from the end of 21,
> > and 23 from 22, etc. Or would this need to be implemented some other way?
> > 
> > Many thanks,
> > Patrick



signature.asc
Description: This is a digitally signed message part.


Re: No line break after score

2022-03-13 Thread Kieren MacMillan
Hi Patrick,

If you implemented this in markup, could it be returned in markup-lines and 
then stacked? Just a thought… I've never tried to do such a thing! Certainly, 
you could do this manually… but it would be amazing if Lilypond had a way of 
handling "irregular" layouts (this, piano duo, etc.) "automagically".

Looking forward to seeing the solution!
Kieren.

> On Mar 11, 2022, at 11:44 AM, Patrick Martin  wrote:
> 
> Hello,
> 
> Can anyone help with a layout query, please? Is there some way to allow a 
> score within a book to follow the previous score without a line break? For 
> example, in this picture, 22 follows directly on from the end of 21, and 23 
> from 22, etc. Or would this need to be implemented some other way?
> 
> Many thanks,
> Patrick