Ossia staves with clefs and time signatures

Under Notation Reference > Staff notation > Modifying single staves (section 1.6.2) > Ossia staves, one technique is given in which a separate staff is created for the ossia, and \context Staff="ossia" places notes on the ossia staff.

The technique recommends removing the time signature engraver and making clefs transparent. If there is a key signature, then the "Key_engraver" may also need to be removed.

  \remove "Time_signature_engraver"
  \override Clef #'transparent = ##t

Problem: If there is a meter, clef, or key change in the middle of an ossia passage, those will be invisible.

Solution: Instead of removing the engravers, override the relevant stencils to be #f, hiding them where they are not needed. Then it's easy to \once \revert the stencil(s) where needed.

In this example, the change to 3/4 time appears in the ossia staff at the end of the first system, and both the clef and meter appear at the beginning of the second system (whereas they are hidden at the start of the first system).