1 % Do not edit this file; it is automatically
2 % generated from Documentation/snippets/new
3 % This file is in the public domain.
4 %% Note: this file works from version 2.13.11
10 Easy notation note heads use the @code{note-names} property
11 of the @code{NoteHead} object to determine what appears inside
12 the note head. By overriding this property, it is possible
13 to print numbers representing the scale-degree.
15 A simple engraver can be created to do this for every note head
18 doctitle
= "Numbers as easy note heads"
22 #(define Ez
_numbers
_engraver
(list
25 (cons
'note-head-interface
26 (lambda
(engraver grob source-engraver
)
28 (context
(ly
:translator-context engraver
))
29 (tonic-pitch
(ly
:context-property context
'tonic
))
30 (tonic-name
(ly
:pitch-notename tonic-pitch
))
31 (grob-pitch
(ly
:event-property
(event-cause grob
) 'pitch
))
32 (grob-name
(ly
:pitch-notename grob-pitch
))
33 (delta
(modulo
(- grob-name tonic-name
) 7))
34 (note-names
(make-vector
7 (number-
>string
(+
1 delta
)))))
35 (ly
:grob-set-property
! grob
'note-names note-names
))))))))
37 #(set-global-staff-size
26)
43 \consists \Ez_numbers_engraver