I would like to include chord names in only part of a song. The example I attached does that. The problem is that the use of spaces in the ChordNames section interferes with the \CompressMMRests directive in the "notes" section. Is there another way to include chordnames in a portion of the part and still ?
\version "2.22.1"

\header {
  title = "a part with a ride"
}

sl = {
  \override NoteHead.style = #'slash
  \hide Stem
}
nsl = {
  \revert NoteHead.style
  \undo \hide Stem
}

myRide = \chordmode {
  \repeat unfold 8 {s1}
  \bar "||"
  \repeat unfold 2 {c1 | d:m | g2:7  a:m9 | c1:7}
  % dont add space here
}

mypart = \relative c'' {
  \time 4/4
  \key c \major
  \tempo 4=100

  % some composed music without chords
  \repeat unfold 2 {c4 d e f}
  \compressMMRests {R1*4}
  \repeat unfold 2 {c4 d e f}
  \bar "||"

  % a solo
  \sl
  \repeat unfold 8 {b,4 b b b}
  \nsl
  \bar "||"

  % some composed music without chords
  \repeat unfold 2 {c4 d e f}
  \compressMMRests {R1*4}
  \repeat unfold 2 {c4 d e f}
  \bar "|."
}

\score {
  <<
    \new ChordNames \myRide
    \mypart
  >>
  \layout { }
  \midi { }
}

Reply via email to