1 @c -*- coding: utf-8; mode: texinfo; documentlanguage: es -*-
2 @c This file is part of lilypond.tely
4 Translation of GIT committish: 4a527608c5ff2ce31e596495d00dce181dc1b9ea
6 When revising a translation, copy the HEAD committish of the
7 version that you are working on. See TRANSLATION for details.
12 @node Interfaces for programmers
13 @chapter Interfaces for programmers
15 Se pueden realizar trucos avanzados mediante el uso de Scheme. Si no
16 está familizarizado con Scheme, le conviene leer nuestro tutorial de
17 Scheme, @rlearning{Scheme tutorial}.
21 * Programmer interfaces::
22 * Building complicated functions::
23 * Markup programmer interface::
24 * Contexts for programmers::
25 * Scheme procedures as properties::
26 * Using Scheme code instead of \tweak::
32 @section Music functions
34 Esta sección trata sobre cómo crear funciones musicales dentro de
38 * Overview of music functions::
39 * Simple substitution functions::
40 * Paired substitution functions::
41 * Mathematics in functions::
43 * Functions without arguments::
44 * Overview of available music functions::
47 @node Overview of music functions
48 @subsection Overview of music functions
50 Es fácil hacer una función que sustituya a una variable en código de
51 LilyPond. La forma general de estas funciones es:
55 #(define-music-function (analizador posicion @var{var1} @var{var2}... )
56 (@var{var1-type?} @var{var2-type?}...)
65 @multitable @columnfractions .33 .66
66 @item @var{argi} @tab @var{i}-ésima variable
67 @item @var{argi-type?} @tab tipo de variable
68 @item @var{...música...} @tab entrada normal de LilyPond, usando las variables como @code{#$var1}.
71 Los siguientes tipos de entrada se pueden usar como variables en una
72 función musical. Esta lista no es exhaustiva; consulte otros lugares
73 de la documentación específica de Scheme para ver otros tipos de
76 @multitable @columnfractions .33 .66
77 @headitem Tipo de entrada @tab notación de @var{argi-type?}
78 @item Entero @tab @code{integer?}
79 @item Flotante (número decimal) @tab @code{number?}
80 @item Cadena de texto @tab @code{string?}
81 @item Marcado @tab @code{markup?}
82 @item Expresión musical @tab @code{ly:music?}
83 @item Pareja de variables @tab @code{pair?}
86 Los argumentos @code{analizador} y @code{posicion} son obligatorios, y
87 se usan en ciertas situaciones avanzadas. El argumento
88 @code{analizador} se usa para acceder al valor de otra variable de
89 LilyPond. El argumento @code{posicion} se usa para establecer el
90 @q{origen} de la expresión musical que construye la función musical,
91 de forma que en caso de producirse un error de sintaxis LilyPond pueda
92 informar al usuario de un lugar adecuado donde buscar en el archivo de
96 @node Simple substitution functions
97 @subsection Simple substitution functions
102 @node Paired substitution functions
103 @subsection Paired substitution functions
108 @node Mathematics in functions
109 @subsection Mathematics in functions
115 @subsection Void functions
120 @node Functions without arguments
121 @subsection Functions without arguments
126 @node Overview of available music functions
127 @subsection Overview of available music functions
132 @include identifiers.tely
133 @node Programmer interfaces
134 @section Programmer interfaces
140 * Input variables and Scheme::
141 * Internal music representation::
144 @node Input variables and Scheme
145 @subsection Input variables and Scheme
150 @node Internal music representation
151 @subsection Internal music representation
156 @node Building complicated functions
157 @section Building complicated functions
163 * Displaying music expressions::
165 * Doubling a note with slurs (example)::
166 * Adding articulation to notes (example)::
169 @node Displaying music expressions
170 @subsection Displaying music expressions
175 @node Music properties
176 @subsection Music properties
181 @node Doubling a note with slurs (example)
182 @subsection Doubling a note with slurs (example)
187 @node Adding articulation to notes (example)
188 @subsection Adding articulation to notes (example)
193 @node Markup programmer interface
194 @section Markup programmer interface
200 * Markup construction in Scheme::
201 * How markups work internally::
202 * New markup command definition::
203 * New markup list command definition::
206 @node Markup construction in Scheme
207 @subsection Markup construction in Scheme
212 @node How markups work internally
213 @subsection How markups work internally
218 @node New markup command definition
219 @subsection New markup command definition
224 @node New markup list command definition
225 @subsection New markup list command definition
230 @node Contexts for programmers
231 @section Contexts for programmers
237 * Context evaluation::
238 * Running a function on all layout objects::
241 @node Context evaluation
242 @subsection Context evaluation
247 @node Running a function on all layout objects
248 @subsection Running a function on all layout objects
253 @node Scheme procedures as properties
254 @section Scheme procedures as properties
260 @node Using Scheme code instead of \tweak
261 @section Using Scheme code instead of @code{\tweak}
266 @node Difficult tweaks
267 @section Difficult tweaks