lilypond-user
[Top][All Lists]
Advanced

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

Re: pitch name transpose into numeric per key signature


From: Gilles
Subject: Re: pitch name transpose into numeric per key signature
Date: Fri, 02 Nov 2012 19:03:16 +0100
User-agent: Opera Mail/12.02 (Win64)


One question though:  Can the numeric displayed above the staff?

Just set the property of newgrob to UP ( = 1 )

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

numbr = #(make-engraver (acknowledgers
 ((note-head-interface engraver grob source)
    (let* (
      (context (ly:translator-context engraver))
      (tonic-pitch (ly:context-property context 'tonic))
      (tonic-index (ly:pitch-notename tonic-pitch))
      (event (ly:grob-property grob 'cause))
      (grob-pitch (ly:event-property event 'pitch))
      (grob-index (ly:pitch-notename grob-pitch))
      (delta (modulo (- grob-index tonic-index) 7))
      (name (list-ref '("1" "2" "3" "4" "5" "6" "7") delta))
      (newgrob (ly:engraver-make-grob engraver 'TextScript event)))
   (set! (ly:grob-property newgrob 'text) name)
   (set! (ly:grob-property newgrob 'direction) UP)))))

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
--
Gilles



reply via email to

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