\version "2.25.1"

\include "score_glb.ily"

%%%%%%%%%%

\include "bwv086.instr_ily"

%pitchTranspose = bes,
%clef = { \clef  }
% "french" "treble" "soprano" "mezzosoprano" "alto" "baritone" "varbaritone" "tenor" "treble_8" "bass"
clefSop = { \clef "treble" }
clefAlt = { \clef "treble" }
clefTen = { \clef "treble_8" }
%clefBas = { \clef  }

nameoba = {
  \set Staff.instrumentName = \markup \center-column { "Oboe d'amore I" "Violino I" }
  \set Staff.shortInstrumentName = #"I "
}
nameobb = {
  \set Staff.instrumentName = \markup \center-column { "Oboe d'amore II" "Violino II" }
  \set Staff.shortInstrumentName = #"II "
}

\include "bwv086_01.ily"
\include "bwv086.staff_ily"

\score {
  \header { piece = \hdrab }
  <<
    \scorePre
%    \scoreTimeSig
    \new GrandStaff <<
      \staffoba
      \staffobb
%    >>
%    \new GrandStaff <<
%      \staffvia
%      \staffvib
      \staffvio
    >>
      \staffBas
      \lyricsto voiceBas \lyrBas
      \staffCB
  >>
  \layout {
    \context {
      \Score
      %\override SpacingSpanner.base-shortest-duration = #(ly:make-moment 2/1)
    }
    \context {
      \Staff
      \RemoveEmptyStaves
      %\override VerticalAxisGroup.remove-first = ##t % this does not work with Ambitus_engraver
      \consists "Ambitus_engraver"
    }
    \context {
      \Voice
      %\consists "Ambitus_engraver"
    }
  }
}

\score {
  \unfoldRepeats
  <<
      \mstaffoba
      \mstaffobb
      \mstaffvia
      \mstaffvib
      \mstaffvio
      \mstaffSop
      \mstaffAlt
      \mstaffTen
      \mstaffBas
      \mstaffCB
  >>
  \midi { }
}
