LilyPond: Is it possible to revert to "atonal" key?

408 views Asked by At

In LilyPond, there is a distinction between specifying \key c \major and leaving the key blank. In the former case, transposing instruments will change the key signature accordingly, while in the latter case, no key signature will be added. Using \transpose c d, for instance, will add two sharps if \key c \major is listed, but not when no key is listed.

What happens when I go from an ‘open key’ section to a tonal section, and back to ‘open key’? I've tried \revert \key, but this seems to be bad syntax. Is there a way to revert to a key-free area?

Minimal example, which should have a key signature of one flat in the second section but no sharps or flats elsewhere:

\transpose c d {
  % Open key
  c8 e f g e d des c

  \key c \minor
  c es g es f d c b

  % How to return to open key??
  c8 e f g e d des c
}
1

There are 1 answers

0
Micah Walter On BEST ANSWER

On the LilyPond mailing list, I was told that there really isn't a way for this to be done—although the following is a workaround as regards the problem with transposition:

\withMusicProperty #'untransposable ##t \key c \major

This code prevents C major from being transposed.


Another workaround, which I have used, is to use tags, so that transposing scores use different keys than C scores. Here is an overview of tags: http://lilypond.org/doc/v2.12/Documentation/user/lilypond/Different-editions-from-one-source