summaryrefslogtreecommitdiff
path: root/Documentation/snippets/numbers-as-easy-note-heads.ly
blob: 4c4dfac113cf7d9d28abe8c38f8e7a8ef06a9d94 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
% DO NOT EDIT this file manually; it is automatically
% generated from Documentation/snippets/new
% Make any changes in Documentation/snippets/new/
% and then run scripts/auxiliar/makelsr.py
%
% This file is in the public domain.
%% Note: this file works from version 2.15.31
\version "2.15.31"

\header {
%% Translation of GIT committish: b482c3e5b56c3841a88d957e0ca12964bd3e64fa
  texidoces = "

Las cabezas de nota de notación fácil utilizan la propiedad
@code{note-names} del objeto @code{NoteHead} para determinar lo que
aparece dentro de la cabeza.  Mediante la sobreescritura de esta
propiedad, es posible imprimir números que representen el grado de la
escala.

Se puede crear un grabador simple que haga esto para la cabeza de cada
nota que ve.

"

  doctitlees = "Números como notas de notación fácil"

%% Translation of GIT committish: 6ae36b6f8a7cf2df5f4e46c3c06820fccd9f35e1
  texidocit = "
Le teste di nota con nome della nota usano la proprietà @code{note-names}
dell'oggetto @code{NoteHead} per determinare cosa appaia
all'interno della testa.  È possibile sovrascrivere questa proprietà
e mostrare numeri che corrispondano ai gradi della scala.

Si può creare un semplice incisore che faccia questo per oggni
oggetto testa di nota che incontra.
"
  doctitleit = "Numeri dentro le teste di nota"

%% Translation of GIT committish: 3b125956b08d27ef39cd48bfa3a2f1e1bb2ae8b4
  texidocfr = "
En mode @qq{easy play}, les têtes de note utilisent la propriété
@code{note-names} attachée à l'objet @code{NoteHead} pour déterminer ce
qui apparaîtra dans la tête.  Intervenir sur cette propriété permet
d'imprimer un chiffre correspondant au degré dans la gamme.

La création d'un graveur dédié permet de traiter toutes les notes.
"
  doctitlefr = "Easy play -- chiffre en lieu et place des lettres"

  lsrtags = "pitches"
  texidoc = "
Easy notation note heads use the @code{note-names} property
of the @code{NoteHead} object to determine what appears inside
the note head.  By overriding this property, it is possible
to print numbers representing the scale-degree.

A simple engraver can be created to do this for every note head
object it sees.
"
  doctitle = "Numbers as easy note heads"
} % begin verbatim


#(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))))))

#(set-global-staff-size 26)

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

\relative c' {
  \easyHeadsOn
  c4 d e f
  g4 a b c \break

  \key a \major
  a,4 b cis d
  e4 fis gis a \break

  \key d \dorian
  d,4 e f g
  a4 b c d
}