]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/snippets/numbers-as-easy-note-heads.ly
Update to LSR using only local files
[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: d9d1da30361a0bcaea1ae058eb1bc8dd3a5b2e4c
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   lsrtags = "pitches"
40   texidoc = "
41 Easy notation note heads use the @code{note-names} property
42 of the @code{NoteHead} object to determine what appears inside
43 the note head.  By overriding this property, it is possible
44 to print numbers representing the scale-degree.
45
46 A simple engraver can be created to do this for every note head
47 object it sees.
48 "
49   doctitle = "Numbers as easy note heads"
50 } % begin verbatim
51
52
53 #(define Ez_numbers_engraver
54    (list
55     (cons 'acknowledgers
56           (list
57            (cons 'note-head-interface
58                  (lambda (engraver grob source-engraver)
59                    (let* ((context (ly:translator-context engraver))
60                           (tonic-pitch (ly:context-property context 'tonic))
61                           (tonic-name (ly:pitch-notename tonic-pitch))
62                           (grob-pitch
63                            (ly:event-property (event-cause grob) 'pitch))
64                           (grob-name (ly:pitch-notename grob-pitch))
65                           (delta (modulo (- grob-name tonic-name) 7))
66                           (note-names
67                            (make-vector 7 (number->string (1+ delta)))))
68                      (ly:grob-set-property! grob 'note-names note-names))))))))
69
70 #(set-global-staff-size 26)
71
72 \layout {
73   ragged-right = ##t
74   \context {
75     \Voice
76     \consists \Ez_numbers_engraver
77   }
78 }
79
80 \relative c' {
81   \easyHeadsOn
82   c4 d e f
83   g4 a b c \break
84
85   \key a \major
86   a,4 b cis d
87   e4 fis gis a \break
88
89   \key d \dorian
90   d,4 e f g
91   a4 b c d
92 }