\version "2.24.3"

#(set-default-paper-size '(cons (* 210 mm) (* 5000 mm)))

#(define-public (bracket-stencils grob)
  (let ((lp (grob-interpret-markup grob (markup #:fontsize 3.5 #:translate (cons -0.3 -0.5) "[")))
        (rp (grob-interpret-markup grob (markup #:fontsize 3.5 #:translate (cons -0.3 -0.5) "]"))))
    (list lp rp)))

bracketify = #(define-music-function (arg) (ly:music?)
  (_i "Tag @var{arg} to be parenthesized.")
#{
  \tweak Parentheses.stencils #bracket-stencils
    \parenthesize $arg
#})

\header {
  tagline = #f
}

kitOne = \drummode {
  \time 4/4
  \tempo 4 = 147
  \set Score.currentBarNumber = #-1
  hho8\mf hho \parenthesize hh \parenthesize hh <sn hh> \parenthesize hh16 sn hho4\< |
  hho4 hho hho \acciaccatura sn8 sn4 \bar ".|:"
  cymc8\ff cymc cymr cymr <sn cymr> cymr16 <sn \bracketify cymr> cymr8 cymr |
  \repeat percent 2 { cymr8-> cymr-> cymr cymr <sn cymr> cymr16 <sn \bracketify cymr> cymr8 cymr | }
  \acciaccatura sn8 sn cymc cymc \acciaccatura sn sn cymc cymc \acciaccatura sn sn \parenthesize cymc \bar ":|."
}

kitTwo = \drummode {
  bd8 bd r bd r4. bd8 |
  bd4 bd bd8 bd hhp\open bd |
  bd8-> bd-> r bd r4. bd8-> |
  \repeat percent 2 { bd8-> bd-> r bd r4. bd8-> | }
  r8 bd-> bd4-> bd8-> bd-> r bd-> |
}

fullScore = \new DrumStaff \with { drumStyleTable = #weinberg-drums-style } <<
  \new DrumVoice { \voiceOne \kitOne }
  \new DrumVoice { \voiceTwo \kitTwo }
>>

fullScoreUnfolded = \new DrumStaff \with { drumStyleTable = #weinberg-drums-style } <<
  \new DrumVoice { \unfoldRepeats { \voiceOne \kitOne } }
  \new DrumVoice { \unfoldRepeats { \voiceTwo \kitTwo } }
>>

\score {
  \fullScore

  \layout {
    indent = 0
  }
}

\score {
  \fullScoreUnfolded

  \midi { }
}
