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
6 % This file is in the public domain.
7 %% Note: this file works from version 2.14.0
11 %% Translation of GIT committish: 6977ddc9a3b63ea810eaecb864269c7d847ccf98
15 Se puede acceder @qq{lateralmente} a algunos grobs desde dentro de la
16 función de callback de otro grob. Éstos se encuentran relacionados
17 normalmente como @qq{layout objects} (objetos de presentación) en la
18 sección @qq{Internal properties} (propiedades internas) de un
19 interface de grob. Se usa la función @code{ly:grob-object} para
20 acceder a estos grobs.
23 Se presentan más abajo como ejemplo algunas formas de addecer a grobs
24 desde dentro de una función de callback de NoteHead, pero la técnica
25 no se limita a las cabezas de nota. Sin embargo, la función de
26 callback de NoteHead es especialmente importante, porque es la función
27 de callback implícita que utiliza la instrucción @code{\\tweak}.
30 La función de ejemplo que se define abajo (\"display-grobs\") no es
31 probablemente tan útil, pero muestra que se está accediendo
32 efectivamente a los grobs.
35 Salida de ejemplo de la consola:
48 doctitlees = "Utilizar ly:grob-object para acceder a los grobs con \\tweak"
51 lsrtags = "tweaks-and-overrides"
54 Some grobs can be accessed @qq{laterally} from within another grob's
55 callback. These are usually listed as @qq{layout objects} in the
56 @qq{Internal properties} section of a grob-interface. The function
57 @code{ly:grob-object} is used to access these grobs.
60 Demonstrated below are some ways of accessing grobs from within a
61 NoteHead callback, but the technique is not limited to NoteHeads.
62 However, the NoteHead callback is particularly important, since it is
63 the implicit callback used by the @code{\\tweak} command.
66 The example function defined below (\"display-grobs\") is probably not
67 that useful, but it demonstrates that the grobs are indeed being
71 Example console output:
83 doctitle = "Using ly:grob-object to access grobs with \\tweak"
87 #(define (notehead-get-accidental notehead)
89 (ly:grob-object notehead 'accidental-grob))
91 #(define (notehead-get-arpeggio notehead)
93 (let ((notecolumn (notehead-get-notecolumn notehead)))
94 (ly:grob-object notecolumn 'arpeggio)))
96 #(define (notehead-get-notecolumn notehead)
98 (ly:grob-parent notehead X))
100 #(define (notehead-get-stem notehead)
102 (let ((notecolumn (notehead-get-notecolumn notehead)))
103 (ly:grob-object notecolumn 'stem)))
105 #(define (display-grobs notehead)
107 (let ((accidental (notehead-get-accidental notehead))
108 (arpeggio (notehead-get-arpeggio notehead))
109 (stem (notehead-get-stem notehead)))
110 (format #t "~2&~a\n" (make-string 20 #\-))
112 (lambda (x) (format #t "~a\n" x))
113 (list accidental arpeggio stem))))
116 %% display grobs for each note head:
117 %\override NoteHead #'before-line-breaking = #display-grobs
120 \tweak #'before-line-breaking #display-grobs