Hi,

I have a situation with a lot of transposing instruments and some key
changes. I have disabled key cancellations, but of course they are
necessary if the new key has no sharps or flats. When naturals are
required, they push key signatures to the right, even though the two will
never appear together.

I had an idea to set the X-extent of KeyCancellation to zero (commented in
the file), but I am not sure if this is robust.

Cheers,
Vaughan
\version "2.24.3"

\paper {
  ragged-right = ##t
}

global = {
  \set Staff.printKeyCancellation = ##f
  \time 4/4
  \key ees \minor
  s1
  \bar "||"
  \key c \minor
  s1
  \bar "||"
}

music = { ees'1 ees' }

\score {
  <<
    \new Staff \with {
      instrumentName = "Trumpet"
    }
    {
      \transposition bes
      \transpose bes c' \new Voice
      <<
        \global
        \music
      >>
    }

    \new Staff \with {
      instrumentName = "Alto Sax"
    }
    {
      \transposition ees
      \transpose ees c' \new Voice
      <<
        \global
        \music
      >>
    }
  >>
  \layout {
    \context {
      \Staff
      % This works but may not be robust
      %\override KeyCancellation.X-extent = #'(0 . 0)
    }
  }
}

Reply via email to