> Hi,
> 
> I'm trying to put dashed bar lines between PianoStaff like in this screenshot.
> 
> I believe it's the same with StaffGroup.
> 
> However I haven't been able to find a solution.
> Writing several with \with measureBarType or \defineBarLine was to no avail 
> on me, e.g. all dashed.
> Have you got a proper way to write such bar lines?
> 
> 
> Kind regards,
> Nike


Dear Nike,

Having explored the measureBarType or \defineBarLine myself this morning, I 
ultimately came up with the following solution, which may not be a proper way 
necessarily, but it is a way I could trick the LilyPond to do what needs to be 
accomplished. Essentially, I came up with a new Staff, called dashBarBetween, 
which is actually a copy of the left hand of staff of the Klavier I. However, I 
omitted everything, except the barline, which I specified “!” as its default 
setting. I have then adjusted the distance between the Klavier I StaffGroup and 
this dashBarBetween, and dashBarBetween and Klavier II, adjusting the barline 
length of the dashBarBetween by  \override BarLine.bar-extent = #'(-5 . 5), 
which you can control later.

Maybe there’s a more elegant solution, but trying to do some kind of 
Mensurstriche technique didn’t get me far.

I hope this helps!

Yoshi


%%%% SNIPPET STARTS HERE %%%%

\version "2.24.4"

\language "english"

global = {
 \key d \major
 \time 4/4
}

scoreARightPianoI =  {
 \global
 % Music follows here.
 \tempo "Allegro con spirito"
 \repeat unfold 3 {<d' fs' a' d''>2 a'}
}

scoreADynamicsPianoI = {
 \global
 1\f
}

scoreALeftPianoI =  {
 \global
 % Music follows here.
 \repeat unfold 3  {<d, d>2 a,}
}

scoreARightPianoII =  {
 \global
 % Music follows here.
 \repeat unfold 3 { <d' fs' a' d''>2 a'}
}

scoreADynamicsPianoII = {
 \global
 % Dynamics follow here.
 1\f
}

scoreALeftPianoII =  {
 \global
 % Music follows here.
 \repeat unfold 3 {<d, d>2 a, }
}

scoreAPianoIPart = \new PianoStaff \with {

 \override StaffGrouper.staffgroup-staff-spacing =
 #'((basic-distance . 0)
    (minimum-distance . 5)
    (padding . -10))

 instrumentName = "Klavier I"
} <<
 \new Staff = "right" \scoreARightPianoI
 \new Dynamics \scoreADynamicsPianoI
 \new Staff = "left"  { \clef bass \scoreALeftPianoI }
>>

scoreAPianoIIPart = \new PianoStaff \with {
 instrumentName = "Klavier II"
} <<
 \new Staff = "right" \scoreARightPianoII
 \new Dynamics \scoreADynamicsPianoII
 \new Staff = "left"  { \clef bass \scoreALeftPianoII }
>>

dashBarBetween = \new Staff \with {
 \override VerticalAxisGroup.default-staff-staff-spacing =
 #'((basic-distance . 0)
    (minimum-distance . 5)
    (padding . -10))
 measureBarType = #"!"
 \omit Clef
 \omit TimeSignature
 \omit NoteHead
 \omit StaffSymbol
 \omit KeySignature
 \omit Stem
 \override BarLine.bar-extent = #'(-5 . 5)
}
\scoreALeftPianoI


\score {
 <<
  \scoreAPianoIPart
  \dashBarBetween
  \scoreAPianoIIPart
 >>
}

%%%% SNIPPET ENDS HERE %%%%


Reply via email to