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

bass = \relative {
  \mark \markup { \circle A }
  \set Score.tempoHideNote = ##t
  \omit Staff.TimeSignature
  \key cis \minor
  \tempo 4 = 170
  \repeat volta 2 {
    \time 4/4
    a,,8( gis fis4) e2\fermata | \mark \markup { \circle B } \bar "!"
    \time 7/4
    cis8([ e cis)] \bracketify gis'4( b8 \bracketify gis4) fis2.\fermata |
  }
}

fullScore = \new Staff \with {
  midiInstrument = "electric bass (pick)"
  midiPanPosition = #0.0
} {
  \clef "bass_8"
  \bass
}

\score {
  \fullScore

  \layout {
    indent = 0
  }
}

\score {
  \fullScore

  \midi { }
}
