lilypond-user
[Top][All Lists]
Advanced

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

Re: keyAlterationOrder


From: Freeman Gilmore
Subject: Re: keyAlterationOrder
Date: Thu, 24 Dec 2020 00:16:19 -0500



On Wed, Dec 23, 2020 at 9:49 PM Carl Sorensen <carl.d.sorensen@gmail.com> wrote:


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


On Wed, Dec 23, 2020 at 4:59 PM Carl Sorensen <carl.d.sorensen@gmail.com> wrote:
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: 

.
When i go here I get a blank page with a menu on the left and nothing opens

OK, it works for me even in an incognito window.  I don't know why it doesn't work for you.  Go to gitlab.com and search for lilypond.  Or get the file from Savannah

 

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)
  )
There are 4 sets with the same 7 keys 2 different orders of the keys.
There are several out there.   Here is one with the same accidental vertical not horizontal:

It doesn't matter whether it's rows or columns; the alist has no rows or columns; it's just sequential.  An alteration that shows up earlier in the list is displayed before one that shows up later in the list.
 
 keyAlterationOrder = #`(
      % Flats:
      (6 . -6/53)  (6 . -12/53)  (6 . -18/53)  (6 . -24/53)  (6 . -36/53)  (6 . -30/53)  (6 . -42/53)  (6 . -48/53)  (6 . -54/53)  (6 . -60/53)  (6 . -66/53)  (6 . -72/53)
      (2 . -6/53)  (2 . -12/53)  (2 . -18/53)  (2 . -24/53)  (2 . -36/53)  (2 . -30/53)  (2 . -42/53)  (2 . -48/53)  (2 . -54/53)  (2 . -60/53)  (2 . -66/53)  (2 . -72/53)
      (5 . -6/53)  (5 . -12/53)  (5 . -18/53)  (5 . -24/53)  (5 . -36/53)  (5 . -30/53)  (5 . -42/53)  (5 . -48/53)  (5 . -54/53)  (5 . -60/53)  (5 . -66/53)  (5 . -72/53)
      (1 . -6/53)  (1 . -12/53)  (1 . -18/53)  (1 . -24/53)  (1 . -36/53)  (1 . -30/53)  (1 . -42/53)  (1 . -48/53)  (1 . -54/53)  (1 . -60/53)  (1 . -66/53)  (1 . -72/53)
      (4 . -6/53)  (4 . -12/53)  (4 . -18/53)  (4 . -24/53)  (4 . -36/53)  (4 . -30/53)  (4 . -42/53)  (4 . -48/53)  (4 . -54/53)  (4 . -60/53)  (4 . -66/53)  (4 . -72/53)
      (0 . -6/53)  (0 . -12/53)  (0 . -18/53)  (0 . -24/53)  (0 . -36/53)  (0 . -30/53)  (0 . -42/53)  (0 . -48/53)  (0 . -54/53)  (0 . -60/53)  (0 . -66/53)  (0 . -72/53)
      (3 . -6/53)  (3 . -12/53)  (3 . -18/53)  (3 . -24/53)  (3 . -36/53)  (3 . -30/53)  (3 . -42/53)  (3 . -48/53)  (3 . -54/53)  (3 . -60/53)  (3 . -66/53)  (3 . -72/53)
      % Sharps:
      (3 . 6/53)  (3 . 12/53)  (3 . 18/53)  (3 . 24/53)  (3 . 30/53)  (3 . 36/53)  (3 . 42/53)  (3 . 48/53)  (3 . 54/53)  (3 . 60/53)  (3 . 66/53)  (3 . 72/53)
      (0 . 6/53)  (0 . 12/53)  (0 . 18/53)  (0 . 24/53)  (0 . 30/53)  (0 . 36/53)  (0 . 42/53)  (0 . 48/53)  (0 . 54/53)  (0 . 60/53)  (0 . 66/53)  (0 . 72/53)
      (4 . 6/53)  (4 . 12/53)  (4 . 18/53)  (4 . 24/53)  (4 . 30/53)  (4 . 36/53)  (4 . 42/53)  (4 . 48/53)  (4 . 54/53)  (4 . 60/53)  (4 . 66/53)  (4 . 72/53)
      (1 . 6/53)  (1 . 12/53)  (1 . 18/53)  (1 . 24/53)  (1 . 30/53)  (1 . 36/53)  (1 . 42/53)  (1 . 48/53)  (1 . 54/53)  (1 . 60/53)  (1 . 66/53)  (1 . 72/53)
      (5 . 6/53)  (5 . 12/53)  (5 . 18/53)  (5 . 24/53)  (5 . 30/53)  (5 . 36/53)  (5 . 42/53)  (5 . 48/53)  (5 . 54/53)  (5 . 60/53)  (5 . 66/53)  (5 . 72/53)
      (2 . 6/53)  (2 . 12/53)  (2 . 18/53)  (2 . 24/53)  (2 . 30/53)  (2 . 36/53)  (2 . 42/53)  (2 . 48/53)  (2 . 54/53)  (2 . 60/53)  (2 . 66/53)  (2 . 72/53)
      (6 . 6/53)  (6 . 12/53)  (6 . 18/53)  (6 . 24/53)  (6 . 30/53)  (6 . 36/53)  (6 . 42/53)  (6 . 48/53)  (6 . 54/53)  (6 . 60/53)  (6 . 66/53)  (6 . 72/53)
    )
So where is the order?    7 key each with 24 pairs.
No there are 168 (step . alteration) pairs.  These are microtonal accidentals.  For negative (flat) alterations, b comes first, then e, then a, then d, then g, then c, then f.  A smaller flat comes before a larger flat. 
 
For positive (sharp) alterations, f comes first, followed by c g d a e b  in order.  smaller sharps come before larger sharps.
Ok that is a part of what I want to know.    If I understand you, the order of the pairs  in the alist  is not important the accidental will be rendered in the c g d a e b order starting with the lowest value.    Which explains the difference between the two the two  examples above (in the microtonal alist the accidentals of the same value are not adjacent. as they are in the first example.   

This is a start, I need more information.   For example can I use two accidentals at the same time may or may not be on the same note.    For example starting with  FM = f c g d^ a^ e^ bb; CM = c g d a^ e^ b^;  GM = f#^ c g d a e^ b^; DM =  f#^ c#^ g d a e^ b^; ...; BM =  f# c# g#^ d#^ a#^ e band Cm = c g d abv ebv bbv; that could be a problem.   There would be more accidentals but not in the key signature.    
 
 


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 now the order of 5th and 4th as you explain here. 

I don't know what other documentation you want.
Something that explains the way the alist is formed?  .

The alist is formed the way all alists in Scheme are formed. 

Why is the example (especially with two different examples) not sufficient?  What specific questions do you have about how the alist is formed?  What are you trying to do?   
Learn how it works to see if it can be used in a program I am working on, see the above examples.

Thank you, ƒg

Carl


reply via email to

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