Hi all,

>> I'm trying to put dashed bar lines between PianoStaff like in this 
>> screenshot.
>> I believe it's the same with StaffGroup.

> Maybe there’s a more elegant solution

How about something like this?

%%%% SNIPPET STARTS HERE %%%%

\version "2.24.4"

\language "english"

\defineBarLine "|-dashedSpan" #'(#t #f "!!")

\layout {
 \context {
   \GrandStaff
   \name GrandStaffDashed
   \override SpanBar.glyph-name = #"|-dashedSpan"
 }
 \context {
   \Score
   \accepts GrandStaffDashed
 }
 \context {
   \PianoStaff
   \override SpanBar.glyph-name = #"|"
 }
}

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 {
 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 }
>> 

\score {
 \new GrandStaffDashed <<
   \scoreAPianoIPart
   % \dashBarBetween
   \scoreAPianoIIPart
>> 
}

%%%% SNIPPET ENDS HERE %%%%

Hope that helps!
Kieren.


__________________________________________________

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.


Reply via email to