This code

\version "2.19.81"
\new RhythmicStaff { \easyHeadsOn a4 b8 a }


generate this score:

[image: image.png]

That's great.

Now instead of the note name, I would like to write the numbers
representing the scale-degree inside the note head. So I tried adding to
the previous code the snippet I found in the documentation but it doesn't
compile. This is code..

\version "2.19.81"
#(define Ez_numbers_engraver
   (make-engraver
    (acknowledgers
     ((note-head-interface engraver grob source-engraver)
      (let* ((context (ly:translator-context engraver))
     (tonic-pitch (ly:context-property context 'tonic))
     (tonic-name (ly:pitch-notename tonic-pitch))
     (grob-pitch
      (ly:event-property (event-cause grob) 'pitch))
     (grob-name (ly:pitch-notename grob-pitch))
     (delta (modulo (- grob-name tonic-name) 7))
     (note-names
      (make-vector 7 (number->string (1+ delta)))))
(ly:grob-set-property! grob 'note-names note-names))))))

\layout {
  ragged-right = ##t
  \context {
    \Voice
    \consists \Ez_numbers_engraver
  }
}

\new RhythmicStaff { a4 b8 a }

and this is the error I get

Interpreting music..document.ly:8:26 <0>: In procedure ly:pitch-notename in
expression (ly:pitch-notename tonic-pitch):

..document.ly:8:26 <1>: Wrong type argument in position 1 (expecting
Pitch): ()


Any suggestion to fix it?
Thank you, g.
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to