|
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:
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.
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. |
[Prev in Thread] | Current Thread | [Next in Thread] |