Hi, lily user community

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.

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 png is produce by test_namer.ly



 
Blessing in+,
Ming.


>________________________________
> From: MING TSANG <[email protected]>
>To: lilypond-usermailinglist <[email protected]> 
>Sent: Friday, October 19, 2012 8:54:11 AM
>Subject: Re: pitch name transpose into numeric pr key signature
> 
>
>Hi, lily user,
>
>
>Just want to find out how can I fix the problem I have with the following 
>email sent on Oct 14.
>
>
> 
>Blessing in+,
>Ming.
>
>
>>________________________________
>> From: MING TSANG <[email protected]>
>>To: lilypond-usermailinglist <[email protected]> 
>>Sent: Sunday, October 14, 2012 6:08:56 PM
>>Subject: pitch name transpose into numeric pr key signature
>> 
>>
>>The following snippet did not transpose the pitch name to numbers
>>
>>
>>e.g.  for key g\major the transpose should be:
>>     g= 1(do)  a= 2(re)  b= 3(mi)  c= 4(fa)  d= 5(so)  e= 6(la) ff=7(ti)
>>
>>
>>
>>I was told to substitute CDEFGAB(namer) for 1234567(numbr) will produce the 
>>right numeric.  I appreciate if someone can show me how to fix \numbr so that 
>>it will generate proper numeric per key signature.  Attached png file is the 
>>output of the snippet.
>>
>>
>>
>>%snippet begins
>>%
>>
>>\version "2.17.0"
>>\include "english.ly"
>>%\include "include_namer.ly"
>>namer =
>>#(make-engraver
>>(acknowledgers
>>((note-head-interface engraver grob source)
>>(let* ((event (ly:grob-property grob 'cause))
>>(pitch (ly:event-property event 'pitch))
>>(newgrob (ly:engraver-make-grob engraver 'TextScript event))
>>(name (format #f "~a~a"
>>(string-ref "CDEFGAB" (ly:pitch-notename pitch))
>>(assoc-ref 
>>'((-1/2 . "") (0 . "") (1/2 . ""))
>>(ly:pitch-alteration pitch)))))
>>(if (string= name "Hb")
>>(set! name "B"))
>>(set! (ly:grob-property newgrob 'text) name)))))
>>numbr =
>>#(make-engraver
>>(acknowledgers
>>((note-head-interface engraver grob source)
>>(let* ((event (ly:grob-property grob 'cause))
>>(pitch (ly:event-property event 'pitch))
>>(newgrob (ly:engraver-make-grob engraver 'TextScript event))
>>(name (format #f "~a~a"
>>(string-ref "1234567" (ly:pitch-notename pitch))
>>(assoc-ref 
>>'((-1/2 . "") (0 . "") (1/2 . ""))
>>(ly:pitch-alteration pitch)))))
>>(if (string= name "Hb")
>>(set! name "B"))
>>(set! (ly:grob-property newgrob 'text) name)))))
>>SRxxSSa = \relative c' {
>>\clef treble \key c\major
>>\set Staff.instrumentName = \markup {\larger "AA"}
>>c4 d e f g a b2  | \key g\major g4 a b c d e fs2 | \key ef\major  ef,4 f g af 
>>bf c d2 
>>}
>>SRxxSSb = \relative c' {
>>\set Staff.instrumentName = \markup {\larger "BB"}
>>\key c\major 
>>c4 d e f g a b2  | \key g\major g4 a b c d e fs2 | \key ef\major  ef,4 f g af 
>>bf c d2 
>>}
>>\score{ 
>>\new Staff 
>>\with {\consists #namer } 
>>{ 
>>\SRxxSSa 
>>}
>>\layout {}
>>}
>>\score{ 
>>\new Staff 
>>\with {\consists #numbr } 
>>{ 
>>\SRxxSSb 
>>}
>>\layout {}
>>}
>>%
>>%snippet ends
>>
>> 
>>Blessing in+,
>>
>>
>
>

<<attachment: 2012-10-24_115010.png>>

Attachment: test_namer.ly
Description: Binary data

_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to