]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/snippets/numbers-as-easy-note-heads.ly
Updates LSR locally
[lilypond.git] / Documentation / snippets / numbers-as-easy-note-heads.ly
1 % DO NOT EDIT this file manually; it is automatically
2 % generated from Documentation/snippets/new
3 % Make any changes in Documentation/snippets/new/
4 % and then run scripts/auxiliar/makelsr.py
5 %
6 % This file is in the public domain.
7 %% Note: this file works from version 2.14.0
8 \version "2.14.0"
9
10 \header {
11 %% Translation of GIT committish: 8b93de6ce951b7b14bc7818f31019524295b990f
12   texidoces = "
13
14 Las cabezas de nota de notación fácil utilizan la propiedad
15 @code{note-names} del objeto @code{NoteHead} para determinar lo que
16 aparece dentro de la cabeza.  Mediante la sobreescritura de esta
17 propiedad, es posible imprimir números que representen el grado de la
18 escala.
19
20 Se puede crear un grabador simple que haga esto para la cabeza de cada
21 nota que ve.
22
23 "
24
25   doctitlees = "Números como notas de notación fácil"
26
27 %% Translation of GIT committish: 099369f020021577e7455eb627b547482af7cd02
28   texidocfr = "
29 En mode « easy play », les têtes de note utilisent la propriété
30 @code{note-names} attachée à l'objet @code{NoteHead} pour déterminer ce
31 qui apparaîtra dans la tête.  Intervenir sur cette propriété permet
32 d'imprimer un chiffre correspondant au degré dans la gamme.
33
34 La création d'un graveur dédié permet de traiter toutes les notes.
35 "
36
37   doctitlefr = "Easy play -- chiffre en lieu et place des lettres"
38
39
40   lsrtags = "pitches"
41   texidoc = "
42 Easy notation note heads use the @code{note-names} property
43 of the @code{NoteHead} object to determine what appears inside
44 the note head.  By overriding this property, it is possible
45 to print numbers representing the scale-degree.
46
47 A simple engraver can be created to do this for every note head
48 object it sees.
49 "
50   doctitle = "Numbers as easy note heads"
51 } % begin verbatim
52
53
54 #(define Ez_numbers_engraver
55    (list
56     (cons 'acknowledgers
57           (list
58            (cons 'note-head-interface
59                  (lambda (engraver grob source-engraver)
60                    (let* ((context (ly:translator-context engraver))
61                           (tonic-pitch (ly:context-property context 'tonic))
62                           (tonic-name (ly:pitch-notename tonic-pitch))
63                           (grob-pitch
64                            (ly:event-property (event-cause grob) 'pitch))
65                           (grob-name (ly:pitch-notename grob-pitch))
66                           (delta (modulo (- grob-name tonic-name) 7))
67                           (note-names
68                            (make-vector 7 (number->string (1+ delta)))))
69                      (ly:grob-set-property! grob 'note-names note-names))))))))
70
71 #(set-global-staff-size 26)
72
73 \layout {
74   ragged-right = ##t
75   \context {
76     \Voice
77     \consists \Ez_numbers_engraver
78   }
79 }
80
81 \relative c' {
82   \easyHeadsOn
83   c4 d e f
84   g4 a b c \break
85
86   \key a \major
87   a,4 b cis d
88   e4 fis gis a \break
89
90   \key d \dorian
91   d,4 e f g
92   a4 b c d
93 }