On Wed, 17 Jan 2024, Martin Brown wrote:

> To answer my own question, I've fudged this with:
>     \omit MultiMeasureRestNumber at the start of the bass line
>     \override MultiMeasureRestNumber.Y-offset = -5 at the start of the
> treble line
> but that seems a bit fragile. Eg. if the staves need to be separated more.
> Any other solutions?

Although still not a perfect solution, you may be able to make it less
fragile by putting a Dynamics context between the two staves, adding the
multi-measure rest engraver to that, and then hiding the actual rests
there, to only show the numbers.  I still have to add an offset adjustment
to make this look decent, but I think the offset adjustment shouldn't
change with the height of the things in the staves.  The height of other
things in the Dynamics context, if any, will be less variable.

There are probably more elegant ways to do the overriding, such as
defining a new context just for this purpose instead of modifying
"Dynamics."  But this is what I got from a quick experiment.

\new PianoStaff <<
  \new Staff {
    \omit MultiMeasureRestNumber
    \clef treble
    \compressMMRests { <c' e'>1 | R1*10 | <c' e'>1 | }
  }
  \new Dynamics {
    \hide MultiMeasureRest
    \override MultiMeasureRestNumber.Y-offset = -1
    \compressMMRests { s1 | R1*10 | s1 | }
  }
  \new Staff {
    \omit MultiMeasureRestNumber
    \clef bass
    \compressMMRests { g1 | R1*10 | g1 | }
  }
>>

\layout {
  \context { \Dynamics \consists Multi_measure_rest_engraver }
}


-- 
Matthew Skala
msk...@ansuz.sooke.bc.ca                 People before tribes.
https://ansuz.sooke.bc.ca/

Reply via email to