]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/snippets/numbers-as-easy-note-heads.ly
Merge branch 'master' into lilypond/translation
[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: 6977ddc9a3b63ea810eaecb864269c7d847ccf98
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: bbf8fd2b5a3ebf20a1fdc91613dc49045a53a270
28   texidocit = "
29 Le teste di nota con nome della nota usano la proprietà @code{note-names}
30 dell'oggetto @code{NoteHead} per determinare cosa appaia
31 all'interno della testa.  È possibile sovrascrivere questa proprietà
32 e mostrare numeri che corrispondano ai gradi della scala.
33
34 Si può creare un semplice incisore che faccia questo per oggni
35 oggetto testa di nota che incontra.
36 "
37   doctitleit = "Numeri dentro le teste di nota"
38
39 %% Translation of GIT committish: 3b125956b08d27ef39cd48bfa3a2f1e1bb2ae8b4
40   texidocfr = "
41 En mode @qq{easy play}, les têtes de note utilisent la propriété
42 @code{note-names} attachée à l'objet @code{NoteHead} pour déterminer ce
43 qui apparaîtra dans la tête.  Intervenir sur cette propriété permet
44 d'imprimer un chiffre correspondant au degré dans la gamme.
45
46 La création d'un graveur dédié permet de traiter toutes les notes.
47 "
48   doctitlefr = "Easy play -- chiffre en lieu et place des lettres"
49
50   lsrtags = "pitches"
51   texidoc = "
52 Easy notation note heads use the @code{note-names} property
53 of the @code{NoteHead} object to determine what appears inside
54 the note head.  By overriding this property, it is possible
55 to print numbers representing the scale-degree.
56
57 A simple engraver can be created to do this for every note head
58 object it sees.
59 "
60   doctitle = "Numbers as easy note heads"
61 } % begin verbatim
62
63
64 #(define Ez_numbers_engraver
65    (list
66     (cons 'acknowledgers
67           (list
68            (cons 'note-head-interface
69                  (lambda (engraver grob source-engraver)
70                    (let* ((context (ly:translator-context engraver))
71                           (tonic-pitch (ly:context-property context 'tonic))
72                           (tonic-name (ly:pitch-notename tonic-pitch))
73                           (grob-pitch
74                            (ly:event-property (event-cause grob) 'pitch))
75                           (grob-name (ly:pitch-notename grob-pitch))
76                           (delta (modulo (- grob-name tonic-name) 7))
77                           (note-names
78                            (make-vector 7 (number->string (1+ delta)))))
79                      (ly:grob-set-property! grob 'note-names note-names))))))))
80
81 #(set-global-staff-size 26)
82
83 \layout {
84   ragged-right = ##t
85   \context {
86     \Voice
87     \consists \Ez_numbers_engraver
88   }
89 }
90
91 \relative c' {
92   \easyHeadsOn
93   c4 d e f
94   g4 a b c \break
95
96   \key a \major
97   a,4 b cis d
98   e4 fis gis a \break
99
100   \key d \dorian
101   d,4 e f g
102   a4 b c d
103 }