lilypond-user
[Top][All Lists]
Advanced

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

numbered notes


From: MING TSANG
Subject: numbered notes
Date: Wed, 1 May 2013 19:17:42 -0700 (PDT)

Hi lily user:

  Is it possible to modify the following code. I like to display notes in numbered equivalent. eg. key c\major
f   =  4 - if possible there is a "." below the number e.g. *
f'  = 4 - e.g. 4
f'' = 4 - if possible to display a "." on top of the number e.g.$
      
Thanks,
Ming.



\version "2.17.0"
\include "english.ly"
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)))))
musicI= \relative c {\key c\major c4 d e f g a b2 |\break }
musicII= \relative c' {\key c\major c4 d e f g a b2 |\break }
musicIII = \relative c'' { \key c\major c4 d e f g a b2 |\break }
\score{
\new Staff \with {\consists #numbr }
  {\musicI \musicII  \musicIII}
\layout {}
}

Attachment: 2013-05-01_221553.png
Description: PNG image


reply via email to

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