Dear Lilypond experts,


In a carol commission by a composer colleague involving several independent 
choirs and organ I need to be able to stop a choir system and then start it a 
few bars later in the middle of a stave (there are, I think, good practical 
reasons for wishing to try to achieve this). I found a method Jean had posted 
earlier this year on Music.StackExchange 
(https://music.stackexchange.com/questions/127631/how-can-i-insert-an-additional-systemstartbrace-into-a-pianostaff-in-lilypond)
 which achieves this, but not in the context of other systems continuing around 
it.


It requires a bit of Jean’s excellent Scheme-ing, but I have tried otherwise to 
minimise my example of how this nearly works, though it is not quite a MWE:


% --------------
\version "2.25.3"


#(define replicate-stil
   (grob-transformer
    'stencil
    (lambda (grob original)
      (let* ((replicate (ly:grob-array->list (ly:grob-object grob 
'replicate-on-cols)))
             (left (ly:spanner-bound grob LEFT))
             (own (interval-start (ly:paper-column::break-align-width left 
'clef)))
             (sts (map (lambda (col)
                         (let ((tr (interval-start 
(ly:paper-column::break-align-width col 'clef))))
                           (ly:stencil-outline
                            (ly:stencil-translate-axis original (- tr own) X)
                            empty-stencil)))
                       replicate)))
        (apply ly:stencil-add (cons original sts))))))


\layout {
  \context {
    \Score
    \consists
    #(lambda (context)
       (let ((delims '())
             (cols '()))
         (make-engraver
          (acknowledgers
           ((system-start-delimiter-interface engraver grob source-engraver)
            (set! delims (cons grob delims))))
          ((stop-translation-timestep engraver)
           (let ((col (ly:context-property context 'currentCommandColumn)))
             (when (assoc-get 'replicate-delims (ly:grob-property col 'details))
               (set! cols (cons col cols)))))
          ((finalize engraver)
           (for-each (lambda (delim)
                       (ly:grob-set-object! delim 'replicate-on-cols 
(ly:grob-list->grob-array cols)))
                     delims)))))
    \override SystemStartBar.stencil = #replicate-stil
    \override SystemStartBracket.stencil = #replicate-stil
    \override SystemStartBrace.stencil = #replicate-stil
    \override SystemStartSquare.stencil = #replicate-stil
  }
}


replicateDelims = {
  \once \override Score.NonMusicalPaperColumn.details.replicate-delims = ##t
  \once \set Staff.forceClef = ##t
  \once \override Staff.Clef.full-size-change = ##t
  \once \set Score.measureBarType = ##f
  \once \override Score.BreakAlignment.X-extent =
  #(lambda (grob)
     (match-let (((a . b) (ly:axis-group-interface::width grob)))
                (cons (- a 0.8) b)))
}


sopmusic = \relative c' {

  c4 c c c
  \once \omit Staff.TimeSignature
  \stopStaff
  s2.
  \replicateDelims
  \startStaff
  \time 4/4
  c8 e f d c2
}


tenmusic = \relative c {
  \clef "treble_8"
  c4 c c c
  \once \omit Staff.TimeSignature
  \stopStaff
  s2.
  \replicateDelims
  \startStaff
  \time 4/4
  e8 g d f e2
}


organUp = \relative c' {
  c8 e g c e, g c e 
  \time 3/4
  g8 e c g c e
  \time 4/4
  g1
}


organDown = \relative c {
  \clef bass
  c8 e g c e, g c e 
  \time 3/4
  g8 e c g c e
  \time 4/4
  \clef treble
  g1
}


\score {
  <<
    \new ChoirStaff = “Choir_II” <<
      \new Staff = "soprano" \sopmusic
      \new Staff = "tenor" \tenmusic  >>
   
    \new PianoStaff = “Organ"  <<
      \new Staff \organUp
      \new Staff \organDown  >>
  >> 
}


% --------------




I should like, if possible, 
the Piano Staff at the bottom not to have its brace reinstated,
to lose the SpanBar between ChoirStaff and PianoStaff (that’s probably the easy 
bit - I’ve just forgotten how!)

and to place the BarLine before the third bar in the PianoStaff between the new 
Clef and the TimeSignature (that is, not aligned with the beginning of staff 
line in the ChoirStaff), so producing as little interruption to the flow of the 
PianoStaff as possible.


This has been the most challenging score I have tackled (my colleague having 
given up on other engraving programs for this). If it were possible to achieve 
any or all this I would be so grateful.


With many thanks in advance.


Alex Voice


Reply via email to