lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Enharmonically override key signature


From: Christian Masser
Subject: Re: Enharmonically override key signature
Date: Tue, 30 Mar 2021 14:54:12 +0200

Hi Craig!

You might try to tag the key signatures:

\version "2.20.00"
\language "english"

\include "enharmonic.ly"

fluteNotes = { \repeat unfold 3 { c'4 d' e' f' } }

altosaxNotes = \transpose c' ef
{ \repeat unfold 3 { c'4 d' e' f' } }

global = {
  \key bf \major
  s1
  \tag #'flatMusic { \key cf \major }
  \tag #'generalMusic { \key b \major }
  s1
  \key ef \major
  s1
}

\score {
  <<
    \new Staff {
      \set Staff.instrumentName = "Flute"
      <<
        \keepWithTag #'generalMusic \global
        \fluteNotes
      >>
    }
    \new Staff {
      \set Staff.instrumentName = "Alto Sax"
      \transpose ef c'    
      <<
        \keepWithTag #'flatMusic \global
        \altosaxNotes
      >>
      }
  >>
}

It's not as elegant as having it automated, but it worked for me at the few occasions, where I had that problem. You only need to be cautious about using \global without a \keepWithTag, but Lilypond will give you a warning about colliding key signatures then.

All the best
Christian

Am Di., 30. März 2021 um 01:43 Uhr schrieb Craig Dabelstein <craig.dabelstein@gmail.com>:
Thanks Kieren. That worked for my over-simplified MWE. But here's my real-world problem with multiple key changes. There are only some that need to be over-ridden enharmonically. See bar 2 of the Alto Sax where I'd like to override this key signature without changing the whole global setup. Is this possible?

All the best,

Craig

%%%%%%%%%%%

\version "2.20.00"
\language "english"

\include "enharmonic.ly"

fluteNotes = { \repeat unfold 3 { c'4 d' e' f' } }

altosaxNotes = \transpose c' ef
{ \repeat unfold 3 { c'4 d' e' f' } }

global = {
  \key bf \major
  s1
  \key b \major
  s1
  \key ef \major
  s1
}

\score {
  <<
    \new Staff {
      \set Staff.instrumentName = "Flute"
      <<
        \global
        \fluteNotes
      >>
    }
    \new Staff {
      \set Staff.instrumentName = "Alto Sax"
      \transpose ef c'    
      <<
        \global
        \altosaxNotes
      >>
      }
  >>
}

%%%%%%


On Tue, 30 Mar 2021 at 09:23, Kieren MacMillan <kieren_macmillan@sympatico.ca> wrote:
Hi Craig,

> In this snippet, how can I override the Alto Sax key signature so it displays as A-flat major instead of G-sharp major?

\transpose ds c'

But then you’ll probably want the old “naturalize notes” snippet (wherever that is…).

Hope that helps!
Kieren.
________________________________

Kieren MacMillan, composer (he/him/his)
‣ website: www.kierenmacmillan.info
‣ email: kieren@kierenmacmillan.info


reply via email to

[Prev in Thread] Current Thread [Next in Thread]