lilypond-user
[Top][All Lists]
Advanced

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

Re: keyAlterationOrder


From: Carl Sorensen
Subject: Re: keyAlterationOrder
Date: Wed, 23 Dec 2020 14:59:48 -0700

Freeman,

On Wed, Dec 23, 2020 at 2:41 PM Freeman Gilmore <freeman.gilmore@gmail.com> wrote:


On Tue, Dec 22, 2020 at 1:02 PM Mark Stephen Mrotek <carsonmark@ca.rr.com> wrote:

I read through the Key_Engraver, url above, and related KeySignature and KeyCancellation.

The only details there, which I think I know, is how the pairs are constructed in the keyAlterationOrder.   And they have it wrong.    I believe it should read:  … step is a number from 0 to 6 and alter from  -2 (flat) to 2 (sharp)?   (Not -2 (sharp) to 2 (flat).)

No details are given as to how the alist order is read or constructed.    I do see The 5th in the pairs (step).   I know that the alist cannot be read with assoc, at least in its simple form.

Any suggestions were the details of the keyAlterationOrderis explained?


That's the best documentation we have.  The next place to look is in the source.

Line 177 of ly/engraver-init.ly is where keyAlterationOrder is defined: 

https://gitlab.com/lilypond/lilypond/-/blob/master/ly/engraver-init.ly

keyAlterationOrder = #`(
    (6 . ,FLAT) (2  . ,FLAT) (5 . ,FLAT ) (1  . ,FLAT) (4  . ,FLAT) (0  . ,FLAT) (3  . ,FLAT)
    (3 . ,SHARP) (0 . ,SHARP) (4 . ,SHARP) (1 . ,SHARP) (5 . ,SHARP) (2 . ,SHARP) (6 . ,SHARP)
    (6 . ,DOUBLE-FLAT) (2 . ,DOUBLE-FLAT) (5 . ,DOUBLE-FLAT ) (1 . ,DOUBLE-FLAT) (4 . ,DOUBLE-FLAT) (0 . ,DOUBLE-FLAT) (3 . ,DOUBLE-FLAT)
    (3  . ,DOUBLE-SHARP) (0 . ,DOUBLE-SHARP) (4 . ,DOUBLE-SHARP) (1 . ,DOUBLE-SHARP) (5 . ,DOUBLE-SHARP) (2 . ,DOUBLE-SHARP) (6 . ,DOUBLE-SHARP)
  )

It appears that the accidentals show up in the list in the relative order they will appear in a key signature.  They are grouped by the kind of alteration (flats, sharps, double flats, double sharps).  So for sharps, the first to appear in a key signature is f#, followed by c#, followed by g#, then d#, and so on.  For flats, we start with bb, then eb, then ab, and so on.

I don't know what other documentation you want.

I hope this helps.

Carl


reply via email to

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