\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" }

nameSop = {
  \set Staff.instrumentName = \markup \center-column { "Soprano" "Oboe d'amore I" "Violino I" }
  \set Staff.shortInstrumentName = #"S "
}
nameAlt = {
  \set Staff.instrumentName = \markup \center-column { "Alto" "Oboe d'amore II" "Violino II" }
  \set Staff.shortInstrumentName = #"A "
}
nameTen = {
  \set Staff.instrumentName = \markup \center-column { "Tenore" "Violino I" }
  \set Staff.shortInstrumentName = #"T "
}

\include "bwv086_06.ily"
\include "bwv086.staff_ily"

\score {
  \header { piece = \hdrag }
  <<
    \scorePre
%    \scoreTimeSig
    \new ChoirStaff <<
      \staffSop
      \lyricsto voiceSop \lyrSopa
      \lyricsto voiceSop \lyrSopb
      \staffAlt
      \lyricsto voiceAlt \lyrAlta
      \lyricsto voiceAlt \lyrAltb
      \staffTen
      \lyricsto voiceTen \lyrTena
      \lyricsto voiceTen \lyrTenb
      \staffBas
      \lyricsto voiceBas \lyrBasa
      \lyricsto voiceBas \lyrBasb
    >>
      \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 { }
}
