lilypond-user
[Top][All Lists]
Advanced

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

Re: pitch name transpose into numeric pr key signature


From: Tim Roberts
Subject: Re: pitch name transpose into numeric pr key signature
Date: Wed, 24 Oct 2012 09:53:32 -0700
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:16.0) Gecko/20121010 Thunderbird/16.0.1

MING TSANG <address@hidden> wrote:

This is my third post on the same subject. First time on Oct 14, Second time on Oct 19.  In the past, I get reply on the same day, and sometime 2 to 3 day later.  I don't know what happpen.

Appreciate someone acknowledge receipt of the post.  Even better tell me is there any solution or it can't be done.

You subscribe to the list, right?  Then you should be able to see that the message went through.  A lack of response usually means no one had an immediately obvious answer.  People don't jump in to say "I don't know", because it's not useful to have 50 such responses.


I am seeking to print number beneath the note.  Refer to the png. 
On Key C seems correct on "AA" "BB".
On Key G only "AA" is correct and "BB" is wrong
On Key E-flat, again "AA" is correct, and "BB" is wrong.

Is it possible to resolve the \numer?

The code you have simply changes C to 1, and D to 2, etc.  It does not look at the key signature.  What the code needs to do is subtract the key signature base pitch from the pitch of the note being engraved, modulo 7, and use that as a lookup to the string.  I am not sufficiently versed in the Lilypond object model to know where the base pitch of the current key signature lives.  Is it just the tonic property of the pitch?  So the numbr code will look something like:

        (let* ...
             (scalestep (modulo
                       (- (ly:pitch-notename pitch) (...base of key signature...)) 7))
             (name (format #f "~a~a"
                    (string-ref "1234567" (scalestep))...

assuming someone can point out what to substitute for my unknown quantity.
-- 
Tim Roberts, address@hidden
Providenza & Boekelheide, Inc.

reply via email to

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