]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/hu/learning/fundamental.itely
Issue 4894: Remove unescaped @funindex entries
[lilypond.git] / Documentation / hu / learning / fundamental.itely
1 @c -*- coding: utf-8; mode: texinfo; documentlanguage: hu -*-
2 @c This file is part of learning.tely
3 @ignore
4     Translation of GIT committish: 48c2b169dc8a9bc2ab2c767cbb83b57cc158742b
5
6     When revising a translation, copy the HEAD committish of the
7     version that you are working on.  For details, see the Contributors'
8     Guide, node Updating translation committishes..
9 @end ignore
10
11 @c Translators: Griechisch Erika, Harmath Dénes
12
13 @c -*- coding: utf-8; mode: texinfo; -*-
14 @c \version "2.19.22"
15 @node Alapfogalmak
16 @chapter Alapfogalmak
17 @translationof Fundamental concepts
18 @translationof Fundamental concepts
19
20 Miután megtanultuk, hogyan állíthatunk elő gyönyörű kottákat egyszerű szöveges
21 fájlokból, ebben a szakaszban megismerjük azokat a fogalmakat és technikákat,
22 amelyek segítségével hasonlóan gyönyörű, de bonyolultabb kottákat készíthetünk.
23
24 @menu
25 * Hogyan működnek a LilyPond bemeneti fájlok?::
26 * A szólamok zenét tartalmaznak::
27 * Kontextusok és ábrázolók::
28 * A sablonok kibővítése::
29 @end menu
30
31 @node Hogyan működnek a LilyPond bemeneti fájlok?
32 @section Hogyan működnek a LilyPond bemeneti fájlok?
33 @translationof How LilyPond input files work
34 @translationof How LilyPond input files work
35
36 A LilyPond bemeneti formátuma meglehetősen rugalmas, így a tapasztalt
37 felhasználóknak nagy szabadságot ad abban, hogyan strukturálják a
38 forrásfájljaikat. Azonban ez a rugalmasság az újdonsült felhasználók számára
39 bonyolult lehet. Ez a szakasz elmagyarázza a struktúra nagy részét, az
40 egyszerűség kedvéért bizonyos részleteket elnagyolva. A bemeneti formátum
41 felépítésének teljes leírása a @ruser{File structure} c. szakaszban olvasható.
42
43 @menu
44 * Bevezetés a LilyPond fájlok szerkezetébe::
45 * A kotta egy összetett zenei kifejezés::
46 * Zenei kifejezések egymásba ágyazása::
47 * A gerendák és ívek átfedhetik egymást::
48 @end menu
49
50 @node Bevezetés a LilyPond fájlok szerkezetébe
51 @subsection Bevezetés a LilyPond fájlok szerkezetébe
52 @translationof Introduction to the LilyPond file structure
53 @translationof Introduction to the LilyPond file structure
54
55 @c index bemeneti formátum
56 @c index fájlstruktúra
57
58 A LilyPond bemeneti fájlok szerkezetére egy tipikus példa:
59
60 @example
61 \version @w{"@version{}"}
62
63 \header @{ @}
64
65 \score @{
66   @var{...összetett zenei kifejezés...}  % ide jön a zene!
67   \layout @{ @}
68   \midi @{ @}
69 @}
70 @end example
71
72 @noindent
73 Ennek az alapvető mintának sok változata lehetséges, de ez a példa jó
74 kiindulási alapot jelent.
75
76 @funindex \book
77 @funindex \score
78 @cindex book
79 @cindex score
80
81 Eddig egyik példa sem használta a @code{\score@{@}} parancsot. Ennek oka, hogy
82 a LilyPond automatikusan hozzáadja az egyszerű bemenethez a szükséges
83 parancsokat. A következő bemenet például:
84
85 @example
86 \relative @{
87   c''4 a d c
88 @}
89 @end example
90
91 @noindent
92 a következő rövidítése:
93
94 @example
95 \book @{
96   \score @{
97     \new Staff @{
98       \new Voice @{
99         \relative @{
100           c''4 a b c
101         @}
102       @}
103     @}
104     \layout @{ @}
105   @}
106 @}
107 @end example
108
109 Más szóval, ha a bemenet egyetlen zenei kifejezést tartalmaz, a LilyPond úgy
110 értelmezi a fájlt, mintha a zenei kifejezés körül már szerepelnének a fenti
111 parancsok.
112
113 @cindex implicit kontextusok
114
115 @strong{Figyelem!} A dokumentációban sok példa nem tartalmazza a
116 @code{\new Staff} és @code{\new Voice} parancsokat, így azok implicite kerülnek
117 létrehozásra. Ez egyszerű példáknál jól működik, de bonyolultabb esetekben,
118 főleg, ha más parancsokat is használunk, a kontextusok implicit létrehozása
119 meglepő kimenetet eredményezhet, például nemkívánatos kottasorok jelenlétét.
120 A kontextusok explicit megadásának módja a @ref{Kontextusok és ábrázolók} c.
121 részben olvasható.
122
123 @warning{Többszólamú zeneművek esetén ajánlott explicit módon létrehozni a
124 kottasorokat és az azon belüli szólamokat.}
125
126 Egyelőre térjünk vissza az első példánkhoz, és vizsgáljuk meg csak a
127 @code{\score} parancsot.
128
129 A @code{\score} blokkon belül először pontosan egy zenei kifejezésnek kell
130 következnie.
131 Emlékezzünk arra, hogy egy zenei kifejezés lehet egy hang is, de akár
132 egy olyan nagy összetett kifejezés is, mint:
133
134 @example
135 @{
136   \new StaffGroup <<
137     @var{...egy teljes Wagner-opera zenei anyaga...}
138   >>
139 @}
140 @end example
141
142 @noindent
143 Mivel mindez egy @code{@{ ... @}} blokkban szerepel, egy zenei
144 kifejezésnek számít.
145
146 Ahogy korábban láttuk, a @code{\score} blokk a zenén kívül más definíciókat is
147 tartalmazhat, mint például:
148
149 @example
150 \score @{
151   @{ c'4 a b c' @}
152   \header @{ @}
153   \layout @{ @}
154   \midi @{ @}
155 @}
156 @end example
157
158 @funindex \header
159 @funindex \layout
160 @funindex \midi
161 @cindex header
162 @cindex layout
163 @cindex midi
164
165 @noindent
166 Ez a három parancs -- @code{\header}, @code{\layout} és @code{\midi} --
167 speciális: az eddigi parancsokkal ellentétben @emph{nem} zenei kifejezések, és
168 nem azok részei. A @code{\score} blokkon belül vagy kívül is elhelyezkedhetnek
169 -- például a @code{\header} (fejléc) blokk, melyben a kotta adatait (pl. cím,
170 szerző stb.) lehet megadni, legtöbbször a @code{\score} parancs előtt szerepel,
171 ahogy a szakasz elején található példában is látható.
172
173 A két további, még ismeretlen parancs: @code{\layout @{@}} és
174 @code{\midi @{@}}. Ezek ebben a formában rendre azt jelentik, hogy a LilyPond
175 kottaképet, ill. hangzó anyagot állítson elő. Teljes leírásuk a Kottaírás
176 Kézikönyvében található, a @ruser{Score layout} és a
177 @ruser{Creating MIDI files} szakaszokban.
178
179 @cindex több kotta
180 @cindex implicit book blokk
181 @funindex \book
182
183 Egy fájlban több @code{\score} blokk lehet. Mindegyik egy-egy zeneművet
184 vagy tételt jelöl, de ezek egy kimeneti fájlban fognak megjelenni. Nem
185 szükséges @code{\book} blokkba foglalni őket -- ez implicite megtörténik.
186 Ha azonban több kimeneti fájlt szeretnénk kapni egy forrásfájlból, akkor több
187 @code{\book} blokkot kell megadnunk -- kimeneti fájlonként egyet-egyet.
188
189 Összegezve:
190
191 Minden @code{\book} blokk külön kimeneti fájlt eredményez (pl. egy-egy PDF
192 állományt). Ha nem szerepel explicit módon a forráskódban, akkor a LilyPond
193 körülveszi az egész forráskódot egy @code{\book} blokkal.
194
195 Egy @code{\book} blokkon belül minden @code{\score} blokk különálló zenei
196 egységet jelöl.
197
198 @cindex layout blokk helye
199
200 Minden @code{\layout} blokk arra a @code{\score} vagy @code{\book} blokkra
201 érvényes, amelyben szerepel -- tehát egy @code{\score} blokkon belüli
202 @code{\layout} blokk csakis arra az egy @code{\score} blokkra vonatkozik,
203 de egy @code{\score} blokkon kívüli @code{\layout} blokk a @code{\score}
204 blokkot tartalmazó (akár explicit, akár implicit) @code{\book} blokkon belüli
205 minden @code{\score} blokkra érvényes.
206
207 A részletek a @ruser{Multiple scores in a book} c. részben olvashatók.
208
209 @cindex változók
210
211 Fájljainkat áttekinthetőbbé tehetjük változók definiálásával (ld.
212 @ref{Művek szervezettebbé tétele változók segítségével}). Minden sablonban ezt
213 a módszert használjuk:
214
215 @example
216 dallam = \relative @{
217   c'4 a b c
218 @}
219
220 \score @{
221   \dallam
222 @}
223 @end example
224
225 Amikor a LilyPond feldolgozza ezt a fájlt, a @code{dallam} változó értékét
226 (azaz mindent az egyenlőségjel utáni zenei kifejezésből) beszúrja mindenhova,
227 ahol @code{\dallam} hivatkozást lát. A változók nevére nincs sok megkötés -- a
228 következők mind helyes példák:  @code{dallam}, @code{jobbkéz}, @code{fuvola},
229 @code{BII} stb. A @ref{Kevesebb gépelés változókkal és függvényekkel} c.
230 szakasz további információkat tartalmaz. Mindössze annyi a korlátozás, hogy a
231 változónevek csak betűket tartalmazhatnak, és nem ütközhetnek a
232 LilyPond parancsok neveivel. A pontos szabályok a @ruser{File structure} c.
233 részben vannak leírva.
234
235 @seealso
236 A bemeneti formátum teljes definíciója a
237 @ruser{File structure} c. szakaszban található.
238
239 @node A kotta egy összetett zenei kifejezés
240 @subsection A kotta egy összetett zenei kifejezés
241 @translationof Score is a (single) compound musical expression
242 @translationof Score is a (single) compound musical expression
243
244 @funindex \score
245 @cindex score
246 @cindex összetett zenei kifejezés
247
248 Az előző szakaszban (@ref{Bevezetés a LilyPond fájlok szerkezetébe}) már láttuk
249 a LilyPond fájlok általános felépítését. De a legfontosabb részt mintha
250 átugrottuk volna: mi kerüljön a @code{\score} blokk belsejébe?
251
252 Valójában ez sokkal egyszerűbb, mint gondolnánk. Ez a mondat mindent
253 megmagyaráz:
254
255 @quotation
256 @emph{A @code{\score} blokknak egy összetett zenei kifejezéssel kell
257 kezdődnie.}
258 @end quotation
259
260 @noindent
261 Az összetett zenei kifejezés fogalmát már tisztáztuk
262 @ref{A zenei kifejezés fogalma} c. részben. Láttuk, hogy építhetünk fel nagy
263 zenei kifejezéseket kis részekből -- először hangokból, aztán akkordokból stb.
264 Most egy összetett zenei kifejezést vizsgálunk meg felülről lefelé. Az
265 egyszerűség kedvéért egy zongorakíséretes dal lesz a példánk. Először is
266 szükségünk van az énekes és a zongorista szólamára.
267
268 @example
269 \score @{
270   <<
271     \new Staff = "ének" <<
272     >>
273     \new PianoStaff = "zongora" <<
274     >>
275   >>
276   \layout @{ @}
277 @}
278 @end example
279
280 Elneveztük a két szólamot @qq{ének} és @qq{zongora} néven. Ez nem kötelező,
281 de jó szokás, hogy első pillantásra lássuk, melyik szólam mire szolgál.
282
283 Emlékezzünk arra, hogy @code{<< ... >>} szolgál több szólam jelölésére. Ennek
284 hatására az ének- és a zongoraszólam egymás alatt fog megjelenni a kottában.
285 A zongoraszólam két kottasort fog tartalmazni, az énekszólam pedig egy
286 kottasort és egy dalszöveget, így mindkettőhöz @code{<< ... >>} blokk kell.
287 A dalszöveghez az @code{\addlyrics} parancsot fogjuk használni. Ha szükséges
288 feleleveníteni, az @ref{Egyszerű dalok kottázása} c. részben olvashatunk róla.
289
290 @lilypond[verbatim,quote,ragged-right]
291 \score {
292   <<
293     \new Staff = "ének" <<
294       \new Voice = "dallam" { c'1 }
295       \addlyrics { Szólt }
296     >>
297     \new PianoStaff = "zongora" <<
298       \new Staff = "jobbkéz" { c'1 }
299       \new Staff = "balkéz" { c'1 }
300     >>
301   >>
302   \layout { }
303 }
304 @end lilypond
305
306 Most megvan a teljes struktúra. Az énekszólam egy @code{Voice} kontextust
307 tartalmaz a hangoknak, és egy versszaknyi dalszöveget. A zongoraszólam pedig
308 a jobb- és balkéz kottasorait tartalmazza.
309
310 Most elkezdhetjük kitölteni a hangokat. Elkezdhetnénk közvetlenül a Voice
311 kontextus belsejébe beleírni, hogy:
312
313 @example
314 \relative @{
315   r4 d''8\noBeam g, c4 r
316 @}
317 @end example
318
319 De ha ezt tennénk, a @code{\score} blokk nagyon bonyolult lenne, és nem lehetne
320 átlátni a szólamok szerkezetét. Így érdemes változókat használni. A dalszöveg
321 változóként való megadására a @code{\lyricmode} parancsot kell használni, hogy
322 a LilyPond dalszövegként és ne hangokként értelmezze a változó tartalmát.
323 (A dalszöveg egy külön beviteli mód, ezekből még több is van, ld. az
324 @ruser{Input modes} c. részt.)
325
326 Tehát miután definiáltuk a megfelelő változókat, hivatkoztunk rájuk, és
327 basszuskulccsal láttuk el a balkezet, kész egy valódi mű kezdete:
328
329 @lilypond[verbatim,quote,ragged-right]
330 dallam = \relative { r4 d''8\noBeam g, c4 r }
331 dalszöveg = \lyricmode { Szólt az Úr, }
332 jobbkéz = \relative { <g' d g,>2~ <g d g,> }
333 balkéz = \relative { b,2 e2 }
334
335 \score {
336   <<
337     \new Staff = "ének" <<
338       \new Voice = "dallam" { \dallam }
339       \addlyrics { \dalszöveg }
340     >>
341     \new PianoStaff = "zongora" <<
342       \new Staff = "jobbkéz" { \jobbkéz }
343       \new Staff = "balkéz" {
344         \clef "bass"
345         \balkéz
346       }
347     >>
348   >>
349   \layout { }
350 }
351 @end lilypond
352
353 Amikor a @code{\score} blokkot írjuk vagy olvassuk, mindig lassan, gondosan
354 járjunk el. Haladjunk kívülről befelé, a magas szintű felépítéstől a részletek
355 felé haladva. Nagyban segít, ha ügyelünk a behúzásokra -- minden blokk
356 kezdődjön egy tabulátorral beljebb, így az egy szinten levő blokkok ugyanolyan
357 mértékben lesznek behúzva.
358
359 @seealso
360 Referencia: @ruser{Structure of a score}.
361
362
363 @node Zenei kifejezések egymásba ágyazása
364 @subsection Zenei kifejezések egymásba ágyazása
365 @translationof Nesting music expressions
366
367 @cindex ideiglenes kottasorok
368 @cindex ossia
369
370 Ossiák bevitelekor jön jól, hogy kottasorok bármikor, darab közben is
371 kezdődhetnek, és bármikor végződhetnek. Álljon itt erre egy példa:
372
373 @lilypond[verbatim,quote,ragged-right]
374 \new Staff {
375   \relative {
376     r4 g'8 g c4 c8 d |
377     e4 r8
378     <<
379       { f c c }
380       \new Staff {
381         f8 f c
382       }
383     >>
384     r4 |
385   }
386 }
387 @end lilypond
388
389 @noindent
390 Figyeljük meg, hogy a kulcs mérete némileg kisebb, mint a sor elején szereplő
391 kulcsé (mint ahogy kulcsváltásnál is).
392
393 @cindex kottasorok pozíciója
394
395 Az ossia a kottasor fölött is elhelyezkedhet:
396
397 @lilypond[verbatim,quote,ragged-right]
398 \new Staff = "main" {
399   \relative {
400     r4 g'8 g c4 c8 d |
401     e4 r8
402     <<
403       { f c c }
404       \new Staff \with {
405         alignAboveContext = #"main" }
406       { f8 f c }
407     >>
408     r4 |
409   }
410 }
411 @end lilypond
412
413 Ebben a példában a még ismeretlen @code{\with} parancsot használtuk, amelyet
414 később ismertetünk. Most elég annyit tudni róla, hogy a kottasor bizonyos
415 tulajdonságainak módosítására szolgál. Itt egy olyan tulajdonságot adunk meg,
416 ami azt mondja, hogy az új kottasor a @qq{main} nevű kottasor felett
417 helyezkedjen el (ahelyett, hogy alatta helyezkedne el, ami az alapértelmezés).
418
419
420 @seealso
421 Az ossiákat általában kulcs és ütemmutató nélkül, valamint kisebb méretben
422 szedjük. Ehhez további új parancsok kellenek; ld. az @ref{Size of objects} és
423 @ruser{Ossia staves} szakaszokat.
424
425
426 @node A gerendák és ívek átfedhetik egymást
427 @subsection A gerendák és ívek átfedhetik egymást
428 @translationof On the un-nestedness of brackets and ties
429
430 @cindex zárójeltípusok
431 @cindex zárójelek egymásba ágyazása
432
433 Már sok zárójelfajtával találkoztunk a LilyPond fájlok írása közben. Ezekre
434 különböző szabályok vonatkoznak, amelyeket érdemes tisztázni. Ismételjük át
435 ezeket a típusokat.
436
437 @need 50
438 @multitable @columnfractions .3 .7
439 @headitem Zárójelfajta
440   @tab Szerep
441 @item @code{@{ .. @}}
442   @tab Egymás után megszólaló hangokat tartalmaz
443 @item @code{< .. >}
444   @tab Egy akkord hangjait tartalmazza
445 @item @code{<< .. >>}
446   @tab Egyszerre megszólaló zenei kifejezéseket tartalmaz
447 @item @code{( .. )}
448   @tab Egy ív kezdetét és végét jelöli
449 @item @code{\( .. \)}
450   @tab Egy frazeálóív kezdetét és végét jelöli
451 @item @code{[ .. ]}
452   @tab Egy kézi gerenda kezdetét és végét jelöli
453 @end multitable
454
455 A LilyPond világán kívül a különböző fajtájú zárójeleket megfelelően egymásba
456 kell ágyazni, pl. így: @code{<< [ @{ ( .. ) @} ] >>}. Tehát a záró
457 zárójeleknek pontosan fordított sorrendben kell állniuk, mint a nyitó
458 zárójeleknek. A fenti táblázatban szereplő első három típusnál (a blokkoknál)
459 ezt a LilyPond is megköveteli. A többi parancsnál ez nem követelmény.
460 Valójában ezekre nem is úgy érdemes gondolni, mint a zárójelekre, hanem olyan
461 jelzésekre, amelyek zenei elemek kezdetét és végét jelölik.
462
463 Tehát például egy frazeálóív kezdődhet egy kézzel megadott gerenda előtt, és
464 befejeződhet a gerenda vége előtt -- lehet, hogy nem a legzeneibb megoldás, de
465 lehetséges:
466
467 @lilypond[quote,verbatim,fragment,ragged-right,relative=2]
468  { g8\( a b[ c b\) a] }
469 @end lilypond
470
471 Általánosságban az ívek, frazeálóívek, kötőívek és gerendák átnyúlhatnak
472 a triolák és előkék határain. A következő példában az 1. sorban egy gerenda,
473 a 2. sorban egy kötőív nyúl bele egy triolába, a 3. és 4. sorban pedig
474 mindezek mellett még egy kötőív is található két triola között, valamint egy
475 frazeálóív, amely túlnyúlik a triolán.
476
477 @lilypond[quote,verbatim,fragment,ragged-right]
478 {
479   r16[ g16 \tuplet 3/2 {r16 e'8] }
480   g16( a \tuplet 3/2 {b d) e' }
481   g8[( a \tuplet 3/2 {b d') e'~]}
482   \tuplet 5/4 {e'32\( a b d' e'} a'4.\)
483 }
484 @end lilypond
485
486
487 @node A szólamok zenét tartalmaznak
488 @section A szólamok zenét tartalmaznak
489 @translationof Voices contain music
490
491 Ahogy az énekeseknek dallamok kellenek ahhoz, hogy énekelhessenek, a LilyPondnak is szüksége van hangokra.
492 A valódi zene minden hangszer számára magában a kottában szereplő szólamokat jelenti -- 
493 ezek nem csak a zenének, hanem magának a LilyPondnak is alapkövei.
494
495 @menu
496 * Hangzatos szólamok::
497 * Szólamok kézi létrehozása::
498 * Szólamok és vokális zene::
499 @end menu
500
501 @node Hangzatos szólamok
502 @subsection Hangzatos szólamok
503 @translationof I'm hearing Voices
504
505
506 @cindex polyphony
507 @cindex layers
508 @cindex multiple voices
509 @cindex voices, multiple
510 @cindex Voice context
511 @cindex context, Voice
512 @cindex simultaneous music
513 @cindex music, simultaneous
514 @cindex concurrent music
515 @cindex music, concurrent
516 @cindex voices vs. chords
517 @cindex chords vs. voices
518
519 A LilyPond kotta legalsó rétege a  @q{Szólam környezet} vagy röviden @q{Szólamok}. 
520 A szólamokat egyes csomagokban csak rétegeknek nevezzük.
521
522 Valójában a szólam környezet az egyetlen, ami zenét tartalmazhat. 
523 Ha szólam környezetet nem hozunk létre, akkor automatikusan készül 
524 egy, ahogy láthattuk ennek a fejezetnek az elején. Egyes hangszerek 
525 -- mint az oboa is -- egy időben csak egy hangot képesek kiadni. 
526 Az ilyen hangszerekre írt zenék monofonikusak és csak egyetlen hangot 
527 tartalmaznak (egy időben). Azon hangszerek esetén, melyek képesek egy 
528 időben több hangot is kiadni -- mint a zongora -- sokszor többszörös 
529 szólamokra van szükségünk, akár különböző ütemben. 
530
531         
532 Egy egyszerű szólam  több hangjegyet is tartalmazhat egy akkordban, 
533 tehát felmerül a kérdés, hogy mikor is van szükségünk többszörös szólamra. 
534 Nézzük az első példát, 4 akkorddal:
535
536 @lilypond[quote,verbatim,fragment,ragged-right,relative=1]
537 \key g \major
538 <d g>4 <d fis> <d a'> <d g>
539 @end lilypond
540
541 A fenti példa leírható egyszerű, kúpos („kacsacsőr”) zárójelekkel, @code{< ... >}, 
542 így csak egy egyszeres szólamra volt szükségünk. De tegyük fel, hogy, hogy a FISZ 
543 egy nyolcad, melyet egy másik G nyolcad követ. Ebben esetben két hangunk van, 
544 mely ugyanakkor kezdődik, de különböző hanghosszúságú: a negyed D és a nyolcad FISZ. 
545 Hogy írjuk ezt le? Nem írhatjuk akkordként, hiszen egy akkordban minden hang azonos 
546 hosszúságú és nem írhatjuk egymást követő hangokként sem, hiszen egy időben kell 
547 kezdődniük a hangoknak. Ilyenkor van szükségünk két szólamra.
548
549
550
551 Nézzük, hogy néz ez ki a LilyPond szintaxisában.
552
553 @funindex << \\ >>
554 @funindex \\
555
556 A legegyszerűbb módja olyan részek rögzítésének, amelyek több mint egy hangot 
557 tartalmaznak egy szólamban, hogy szekvenciát @code{@{...@}} használunk és ezt 
558 kombináljuk a szögletes zárójelekkel @code{<<...>>}.
559 Az ilyen a részeket @code{\\} segítségével kell elválasztani ahhoz, hogy különböző szólamként jelenjenek meg. 
560 Az elválasztó jelek nélkül a hangok egyetlen szólamként szerepelnének, ami általában hibát okoz. 
561 Ez a technika használható olyan daraboknál melyek leginkább monofonikusak és néhány részük polifón.
562
563
564 Itt egy példa, ami a fenti akkord egyik hangját két szólamra osztja és kötést is tartalmaz:
565
566 @lilypond[quote,verbatim,fragment,ragged-right,relative=2]
567 \key g \major
568 %    1. szólam                  2. szólam
569 << { g4 fis8( g) a4 g }  \\  { d4 d d d }  >>
570 @end lilypond
571
572 Vegyük észre, hogy a második hang szárai lefele mutatnak.
573
574
575 Íme egy másik egyszerű példa:
576
577 @lilypond[quote,verbatim,fragment,ragged-right,relative=2]
578 \key d \minor
579 %    1. szólam               2. szólam
580 << { r4 g g4. a8 }    \\ { d,2 d4 g }       >>
581 << { bes4 bes c bes } \\ { g4 g g8( a) g4 } >>
582 << { a2. r4 }         \\ { fis2. s4 }       >>
583 @end lilypond
584
585 Nem szükséges, hogy minden ütemet elválasszunk a  @code{<< \\ >>} segítségével.  
586 Olyan zenék esetén, ahol csak néhány hang van minden ütemben, ez a felépítés 
587 segíti a kód olvashatóságát, de ha már sok hang van, akkor jobb, ha a
588 hangokat külön-külön jegyezzük le, például így:
589
590
591 @lilypond[quote,verbatim,fragment,ragged-right,relative=2]
592 \key d \minor
593 << {
594   % 1. szólam
595   r4 g g4. a8 |
596   bes4 bes c bes |
597   a2. r4 |
598 } \\ {
599   % 2. szólam
600   d,2 d4 g |
601   g4 g g8( a) g4 |
602   fis2. s4 |
603 } >>
604 @end lilypond
605
606
607 @cindex voices, naming
608 @cindex voices crossing brackets
609 @cindex slurs crossing brackets
610 @cindex ties crossing brackest
611
612
613 A fenti példában csak két szólam van, de ha három vagy több szólamot kell 
614 lejegyezni, azt is hasonlóan lehet megoldani visszaperjelek (back-slash) használatával.
615
616 A szólam környezetek nevei @code{"1"}, @code{"2"}, stb. 
617 Minden ilyen környezetben a függőleges elrendezés (kötések, szárak, dinamika, stb) megfelelően jelenik meg.
618
619
620 @lilypond[quote,verbatim,fragment]
621 \new Staff \relative {
622   % Fő hang
623   c'16 d e f
624   %   1. szólam       2. szólam                 3. szólam
625   << { g4 f e } \\ { r8 e4 d c8~ } >>
626   << { d2 e2 }  \\ { c8 b16 a b8 g~ g2 } \\ { s4 b4 c2 } >>
627 }
628 @end lilypond
629
630
631 A fő szólamtól különválasztva jelennek meg a @code{<< .. >>} között  
632 szereplő szólamok (hangok). Ezt hívjuk @emph{szimultán felépítésnek}. 
633 Az átkötések és kötőívek csak az azonos szólamon belül kötik 
634 össze a hangokat, tehát ezek nem kerülhetnek belülre vagy kívülre a 
635 szimultán felépítéshez képest.
636 Fordítva, szimultán felépítés esetén azok a párhuzamos szólamok, 
637 amelyek ugyanabban az ötvonalban vannak, egy szólamnak minősülnek. 
638 Egyéb szólamhoz kapcsolódó tulajdonságok átöröklődnek a szimultán 
639 felépítésbe is. Itt egy másik példa, melynél a különböző szólamokban 
640 különböző színű hangok szerepelnek. Vegyük észre, hogy 
641 adott szólambeli változások nincsenek hatással más szólamokra, 
642 de a változtatások ugyanabban a szólamban később is érvényesek. 
643 Vegyük észre azt is, hogy az összekötött hangokat szétválaszthatja 
644 az ütemhatár, ahogy a kék háromszöget jelző szólamban láthatjuk: 
645
646
647 @lilypond[quote,verbatim]
648 \new Staff \relative {
649   % Fő szólam
650   c'16 d e f
651   <<  % 1. ütem
652     {
653       \voiceOneStyle
654       g4 f e
655     }
656   \\
657     {
658       \voiceTwoStyle
659       r8 e4 d c8~
660     }
661   >>
662   <<  % 2. ütem
663      % 1. szólam folytatása
664     { d2 e2 }
665   \\
666      % 2. szólam folytatása
667     { c8 b16 a b8 g ~ g2 }
668   \\
669     {
670       \voiceThreeStyle
671       s4 b4 c2
672     }
673   >>
674 }
675 @end lilypond
676
677 @funindex \voiceOneStyle
678 @funindex \voiceTwoStyle
679 @funindex \voiceThreeStyle
680 @funindex \voiceFourStyle
681 @funindex \voiceNeutralStyle
682
683
684 A @code{\voiceXXXStyle} parancsot elsősorban oktatási célra érdemes 
685 használni, olyan esetben, mint amilyet ez is.  Ezek a parancsok 
686 módosítják a hangok színét illetve a kottafejet, a  szárat, a 
687 gerendákat és a hangfejek stílusát, így lesznek a szólamok könnyen felismerhetőek. 
688
689 Az első szólam piros rombusz, a második kék háromszög, a 
690 harmadik zöld áthúzott kör, a negyedik (itt nem használt) magenta kereszt. 
691 A @code{\voiceNeutralStyle} (szintén nem használt a fenti példában) visszaállítja 
692 a stílust az alapértelmezettre. Később az  @ref{Objektumok láthatósága és színe} 
693 és @ref{Változók felhasználása a finomhangoláshoz} fejezetekben majd látni fogjuk, 
694 hogyan lehet hasonló parancsokat létrehozni.
695
696
697 @cindex polyphony and relative note entry
698 @cindex relative note entry and polyphony
699
700
701 A polifónia nem változtatja meg a hangjegyek viszonyát a @code{\relative @{ @}} blokkon belül. 
702 Minden hangjegy helyzetét az azt megelőző hang illetve első hang helyzete határozza meg.
703
704 @example
705 \relative c' @{ noteA << < noteB noteC > \\ noteD >> noteE @}
706 @end example
707
708 @noindent
709 @code{noteB} is relative to @code{noteA}                      @*
710 @code{noteC} is relative to @code{noteB}, not @code{noteA};   @*
711 @code{noteD} is relative to @code{noteB}, not @code{noteA} or
712 @code{noteC};                                                 @*
713 @code{noteE} is relative to @code{noteD}, not @code{noteA}.
714
715
716 Van egy másik módszer, ami egyszerűbb, ha a hangjegyek a 
717 szólamokon belül teljesen szét vannak választva. 
718 Ezt úgy érthetjük el, hogy  a @code{\relative} parancsot használjuk minden szólam kezdetén:
719
720
721 @example
722 \relative c' @{ noteA ... @}
723 <<
724   \relative c'' @{ < noteB noteC > ... @}
725 \\
726   \relative g' @{ noteD ... @}
727 >>
728 \relative c' @{ noteE ... @}
729 @end example
730
731 Végül vizsgáljuk meg a szólamokat összetettebb zene esetén. 
732 Nézzük Chopin Deux Nocturne, Op 32. művének első két ütemét. 
733 A továbbiakban is ezt a példát fogjuk használni arra, hogy a 
734 jelölésekre használható különböző technikákat szemléltessük, 
735 ezért tekintsünk el attól, hogy az alábbi kód elsőre rejtélyesnek 
736 tűnhet és koncentráljunk csak a zenére és a szólamokra -- a nehezebb részeket majd a későbbi fejezetekben áttekintjük. 
737
738
739
740 @c The following should appear as music without code
741 @lilypond[quote,ragged-right]
742 \new Staff \relative {
743   \key aes \major
744   <<  % 1. szólam
745     { c''2 aes4. bes8 }
746   \\  % 2. szólam
747     { aes2 f4 fes }
748   \\  % Nincs 3. szólam
749   \\  % 4. szólam
750     {
751       % Az alábbival nem foglalkozunk most, a 4. fejezetben megtalálhatjuk a kód magyarázatát
752       \once \override NoteColumn #'force-hshift = #0
753       <ees c>2
754       \once \override NoteColumn #'force-hshift = #0.5
755       des2
756     }
757   >> |
758   <c ees aes c>1 |
759 }
760 @end lilypond
761
762 A szárak iránya gyakran jelzi két egyidejű dallamsor folytonosságát. 
763 A fenti példánál a legfelső hangjegy szárai felfelé mutatnak, az alsóké mind lefelé. 
764 Ez az első jelölés, amire szükségünk van több szólam lejegyzése során. 
765
766
767 Leginkább viszont akkor van szükségünk többszörös szólamokra, amikor a hangok
768 ugyanakkor kezdődnek ugyan, de különböző hosszúságúak. Nézzük azt a hangot,
769 ami első ütem harmadik ütésekor kezdődik. Az ASZ egy pontozott negyed, az
770 alatta levő F egy pontozatlan negyed,  a DESZ pedig egy fél hang. 
771 Ezek nem írhatók le akkordként, hiszen akkord esetén minden hang azonos hosszúságú.
772 Nem írhatóak le egymást követő hangokként sem, hiszen egy időben kell kezdődniük.
773 Az ütemnek ebben a részében három szólamra van szükségünk, és normál esetben az
774 egész ütem három szólamú, ahogy az alábbi példa mutatja, ahol különböző hangjegyfejeket
775 használunk különböző színekkel a három szólamhoz. Szeretnénk ismét kihangsúlyozni, hogy
776 az alábbi példa mögötti kódot később elmagyarázzuk, most csak hagyjuk figyelmen kívül
777 azokat a részeket, amik nem érthetőek. 
778
779
780 @c The following should appear as music without code
781 @c The three voice styles should be defined in -init
782 @lilypond[quote,ragged-right]
783 \new Staff \relative {
784   \key aes \major
785   <<
786     {  % 1. szólam
787       \voiceOneStyle
788       c''2 aes4. bes8
789     }
790   \\  % 2. szólam
791     { \voiceTwoStyle
792       aes2 f4 fes
793     }
794   \\  % Nincs 3. szólam (a hangjegyek szárait lefele szeretnénk)
795   \\  % 4. szólam
796     { \voiceThreeStyle
797        % Az alábbival nem foglalkozunk most, a 4. fejezetben megtalálhatjuk a kód magyarázatát
798       \once \override NoteColumn #'force-hshift = #0
799       <ees c>2
800       \once \override NoteColumn #'force-hshift = #0.5
801       des2
802     }
803   >>
804   <c ees aes c>1
805 }
806 @end lilypond
807
808 Kezdjük a legelején a fenti zene kódolását.  
809 Látni fogjuk, hogy beleütközünk majd több problémába is (de ez ne keserítsen el minket, a lényeg, hogy ezekből tanulunk :) ). 
810 Kezdjük azzal, amit tanultunk: a @code{<< \\  >>}  használatával. 
811 Gépeljük be a három szólam első ütemét:
812
813 @lilypond[quote,verbatim,fragment,ragged-right]
814 \new Staff \relative {
815   \key aes \major
816   <<
817     { c''2 aes4. bes8 } \\ { aes2 f4 fes } \\ { <ees c>2 des2 }
818   >>
819   <c ees aes c>1
820 }
821 @end lilypond
822
823 @cindex stem down
824 @cindex voices and stem directions
825 @cindex stem directions and voices
826 @cindex stem up
827
828
829 A szárak iránya automatikusan hozzárendelődik a szólamokhoz, a páratlan-sorszámú szólamoknál
830 felfelé, a párosoknál lefelé. Az első és második szólamhoz tartozó hangok szárai megfelelőek,
831 de a harmadik szólamban a száraknak lefelé kellene állniuk. Ezt úgy javíthatjuk, hogy a
832 harmadik szólamot átugorjuk (üresen hagyjuk) és a negyedik szólamba helyezzük az eredetileg harmadik szólamot. 
833 Ezt egyszerűen megtehetjük a @code{\\} segítségével:
834
835
836 @lilypond[quote,verbatim,fragment,ragged-right]
837 \new Staff \relative {
838   \key aes \major
839   <<  % 1. szólam
840     { c''2 aes4. bes8 }
841   \\  % 2. szólam
842     { aes2 f4 fes }
843   \\  % 3. szólam - elhagyjuk
844   \\  % 4. szólam
845     { <ees c>2 des2 }
846   >>
847   <c ees aes c>1
848 }
849 @end lilypond
850
851 @noindent
852 Látjuk, hogy ez megoldotta a problémát a szárak irányával kapcsolatban, 
853 de előhozott egy másikat, ami többszörös szólamoknál néha előfordul -- 
854 a hangok szárai a szólamon belül ütköznek más kottafejekkel más szólamokban. 
855 A hangok megtervezéséhez a LilyPond lehetővé teszi, hogy hangok illetve akkordok esetén, két hang ugyanazt a függőleges pozíciót foglalja el akár ellentétes szárirány esetén, viszont figyelembe veszi azt, hogy bizonyos esetekben a harmadik és a negyedik szólam elmozdulhat, ezzel elkerülve azt, hogy a kottafejek egymást fedjék. Ez általában működik, de a fenti példában egyértelmű, hogy az alacsonyabb szólamok alapértelmezetten nem jól helyezkednek el. Jelenleg még nem vagyunk készen rá, hogy ezt kijavítsuk, úgyhogy most ezt érintetlenül hagyjuk és visszatérünk rá egy későbbi fejezetben -- lásd  @code{force-hshift} tulajdonság az @ref{Egymást átfedő jelek javítása} fejezetben.
856
857
858 @seealso
859 A kottaírás kézikönyve:
860 @ruser{Multiple voices}.
861
862
863 @node Szólamok kézi létrehozása
864 @subsection Szólamok kézi létrehozása
865 @translationof Explicitly instantiating voices
866
867
868 @funindex \voiceOne
869 @funindex \voiceTwo
870 @funindex \voiceThree
871 @funindex \voiceFour
872 @funindex \oneVoice
873 @funindex \new Voice
874 @cindex voice contexts, creating
875
876 A @code{<< >>} blokkon belül is létrehozhatunk polifón zenét és ha szükséges, 
877 a  @code{\voiceOne} ... @code{\voiceFour} parancsokkal jelezhetjük a szárak, ívek, stb irányát. 
878 Hosszabb kották esetén ez a módszer átláthatóbb, mert így külön-külön írhatjuk a szólamokat és beszédesebb neveket is adhatunk nekik. 
879
880 Konkrétan a @code{<< \\ >>}szerkezet, amit az előző fejezetben használtunk:
881
882 @example
883 \new Staff @{
884   \relative @{
885     << @{ e'4 f g a @} \\ @{ c,4 d e f @} >>
886   @}
887 @}
888 @end example
889
890 @noindent
891 egyenértékű az alábbival:
892
893 @example
894 \new Staff <<
895   \new Voice = "1" @{ \voiceOne \relative @{ e'4 f g a @} @}
896   \new Voice = "2" @{ \voiceTwo \relative @{ c'4 d e f @} @}
897 >>
898 @end example
899
900 Mindkét fenti esetben az alábbi kottát kapjuk
901
902 @c The following example should not display the code
903 @lilypond[ragged-right,quote]
904 \new Staff <<
905   \new Voice = "1" { \voiceOne \relative { e'4 f g a } }
906   \new Voice = "2" { \voiceTwo \relative { c'4 d e f } }
907 >>
908 @end lilypond
909
910 @cindex voices, reverting to single
911 @cindex reverting to a single voice
912
913
914 A  @code{\voiceXXX} parancs meghatározza a szárak irányát, az 
915 átkötéseket, a kötőíveket, az artikulációt, a szöveges magyarázatokat, 
916 a pontozott hangokat és az ujjrendet.  A @code{\voiceOne} és a @code{\voiceThree} 
917 hatására a mutató elemek felfele mutatnak, míg a @code{\voiceTwo} és a 
918 @code{\voiceFour} esetén lefelé. Ezen parancsok ha szükséges vízszintes 
919 eltolást is létrehoznak minden szólam esetén, hogy elkerüljék a kottafejek 
920 ütközését. A @code{\oneVoice} parancs visszaállítja a beállításokat a normál egyszeres szólamra.
921
922
923 Nézzünk egy egyszerű példát arra, hogy a @code{\oneVoice}, @code{\voiceOne} és @code{\voiceTwo} 
924 parancsok milyen hatással vannak a jelzésekre, ívekre illetve dinamikára:
925
926 @lilypond[quote,ragged-right,verbatim]
927 \relative c'{
928   % Alapértelmezett viselkedés vagy  viselkedés \oneVoice után
929   c d8~ d e4( f g a) b-> c
930 }
931 @end lilypond
932
933 @lilypond[quote,ragged-right,verbatim]
934 \relative c'{
935   \voiceOne
936   c d8~ d e4( f g a) b-> c
937   \oneVoice
938   c, d8~ d e4( f g a) b-> c
939 }
940 @end lilypond
941
942 @lilypond[quote,ragged-right,verbatim]
943 \relative c'{
944   \voiceTwo
945   c d8~ d e4( f g a) b-> c
946   \oneVoice
947   c, d8~ d e4( f g a) b-> c
948 }
949 @end lilypond
950
951 Nézzük végig a három különböző lejegyzési módját ugyanannak a polifón dallamnak, 
952 és vizsgáljuk meg melyik milyen esetben előnyös, használva az előző fejezetbeli példát.
953
954
955 A @code{<< >>} közt található kifejezés a főszólamhoz tartozik (jegyezzük meg, hogy a @code{<< >>}  használata során ez @strong{nem} igaz). 
956 Ez akkor hasznos, amikor további szólamok jelennek meg a főszólam mellett. Egy helyesebb megvalósítása a példánknak alább látható. 
957 The red diamond-shaped notes demonstrate that the main melody is now in a single voice context,
958 permitting a phrasing slur to be drawn over them.
959
960 @lilypond[quote,ragged-right,verbatim]
961 \new Staff \relative {
962   \voiceOneStyle
963   % A következő hangok monofónok
964   c'16^( d e f
965   % Szimultán rész három szólammal
966   <<
967     % Continue the main voice in parallel
968     { g4 f e | d2 e2) | }
969     % Initiate second voice
970     \new Voice {
971       % Set stems, etc., down
972       \voiceTwo
973       r8 e4 d c8~ | c8 b16 a b8 g~ g2 |
974     }
975     % Initiate third voice
976     \new Voice {
977       % Set stems, etc, up
978       \voiceThree
979       s2. | s4 b4 c2 |
980     }
981   >>
982 }
983 @end lilypond
984
985 @cindex nesting music expressions
986 @cindex nesting simultaneous constructs
987 @cindex nesting voices
988 @cindex voices, temporary
989 @cindex voices, nesting
990
991 Létrehozhatunk többszörösen beágyazott polifón szerkezetet is, és ha a szólamok rövidek, az alábbi módon természetesebbnek tűnik a leírásuk:
992
993 @lilypond[quote,ragged-right,verbatim]
994 \new Staff \relative {
995   c'16^( d e f
996   <<
997     { g4 f e | d2 e2) | }
998     \new Voice {
999       \voiceTwo
1000       r8 e4 d c8~
1001       <<
1002         { c8 b16 a b8 g~ g2 }
1003         \new Voice {
1004           \voiceThree
1005           s4 b4 c2
1006         }
1007       >>
1008     }
1009   >>
1010 }
1011 @end lilypond
1012
1013 @cindex spacing notes
1014
1015 A szólamokat akkor érdemes így írni, ha a zene csak egy kis része polifón. Viszont amikor az egész ötvonalas kotta nagyrésze polifón, egyszerűbb, ha többszörös szólamokat  használunk mindenütt, --  ritkított hangokkal, hogy átlépjük azokat a részeket, ahol a szólamok  üresek. Az alábbi példa ezt mutatja:
1016
1017 @lilypond[quote,ragged-right,verbatim]
1018 \new Staff \relative <<
1019   % Initiate first voice
1020   \new Voice {
1021     \voiceOne
1022     c'16^( d e f g4 f e | d2 e2) |
1023   }
1024   % Initiate second voice
1025   \new Voice {
1026     % Set stems, etc, down
1027     \voiceTwo
1028     s4 r8 e4 d c8~ | c8 b16 a b8 g~ g2 |
1029   }
1030   % Initiate third voice
1031   \new Voice {
1032     % Set stems, etc, up
1033     \voiceThree
1034     s1 | s4 b4 c2 |
1035   }
1036 >>
1037 @end lilypond
1038
1039 @subsubheading Hangoszlopok
1040
1041 @cindex note column
1042 @cindex note collisions
1043 @cindex collisions, notes
1044 @cindex shift commands
1045 @funindex \shiftOff
1046 @funindex \shiftOn
1047 @funindex \shiftOnn
1048 @funindex \shiftOnnn
1049
1050
1051 Egymáshoz közel elhelyezkedő, különböző szólamban levő hangok esetén 
1052 kettő, esetenként több oszlopba rendezzük a hangokat, hogy a kottafejek 
1053 fedését elkerüljük. Ezeket hangoszlopoknak hívjuk. Különálló oszlopokat 
1054 hozunk létre minden szólamhoz és az éppen aktuális szólam-független eltolást 
1055 minden oszlopra alkalmazzuk, ezzel elkerülve az ütközéseket. A fenti példában 
1056 is ezt láthatjuk. A 2. ütemben a C a kettes szólamban eltolódik a D-tól jobbra 
1057 (ami az első szólamban van) és a végső C akkord a hármas szólamban szintén eltolódik jobbra a többi hangtól. 
1058
1059 A @code{\shiftOn}, @code{\shiftOnn}, @code{\shiftOnnn}, és
1060 @code{\shiftOff} parancsok meghatározzák, hogy melyik hangot vagy akkordot milyen mértékben kell megemelnünk ahhoz, hogy az ütközést elkerüljük. Alapértelmezett esetben, a külső szólamokban (az egyes és a kettes szólamban) a  @code{\shiftOff} érvényes, amíg a köztes szólamokban (hármas és négyes) a  @code{\shiftOn}. Eltolás esetén az egyes és a hármas szólam jobbra a kettes és a négyes balra tolódik
1061
1062
1063 A @code{\shiftOnn} és @code{\shiftOnnn} további eltolási szinteket 
1064 határoznak meg, melyek összetett esetekben ideiglenesen szükségesek 
1065 lehetnek ahhoz, hogy elkerüljük az ütközéseket – lásd @ref{Valós zenei példa}. 
1066
1067 Egy hangoszlop egyszerre csak egy hangot (vagy akkordot) tartalmazhat egy szólamból 
1068 szárral felfelé és egy másikat szárral lefelé. Ha két különböző szólambeli hang 
1069 azonos irányú szárral kerül ugyanabba a pozícióba és egyik szólamban sincs eltolás 
1070 vagy ugyanazt az eltolást adjuk meg, akkor a @qq{Too many clashing note columns} hibaüzenetet kapjuk.
1071
1072
1073 @seealso
1074 A kottaírás kézikönyve:
1075 @ruser{Multiple voices}.
1076
1077
1078 @node Szólamok és vokális zene
1079 @subsection Szólamok és vokális zene
1080 @translationof Voices and vocals
1081
1082 A vokális zene speciális nehézséget jelent: két kifejezést kell egyesíteni -- hangokat és a szöveget.
1083
1084 @funindex \new Lyrics
1085 @funindex \lyricsto
1086 @funindex Lyrics
1087 @cindex Lyrics context, creating
1088 @cindex lyrics, linking to voice
1089
1090 Korábban már találkoztunk a @code{\addlyrics@{@}} paranccsal, ami
1091 az egyszerű kottákhoz elegendő. Azonban ez a módszer eléggé korlátolt.
1092 Bonyolultabb zene esetén, muszáj bevezetni a @code{Lyrics} 
1093 környezetet a @code{\new Lyrics} paranccsal és közvetlenül összekötni a 
1094 dalszöveget a hangjegyekkel. A @code{\lyricsto@{@}} parancs használatával
1095 hozzárendelhetjük a szöveget a megfelelő szólamhoz.
1096
1097 @lilypond[quote,verbatim,fragment]
1098 <<
1099   \new Voice = "one" \relative {
1100     \autoBeamOff
1101     \time 2/4
1102     c''4 b8. a16 g4. f8 e4 d c2
1103   }
1104   \new Lyrics \lyricsto "one" {
1105     No more let sins and sor -- rows grow.
1106   }
1107 >>
1108 @end lilypond
1109
1110 Megjegyzés: a dalszövegnek egy @code{Voice} környezethez kell kapcsolódnia,
1111 @emph{nem} @code{Staff} környezethez.  Ez egy olyan eset, amikor
1112 muszáj közvetlenül készíteni @code{Staff} és @code{Voice} környezetet is.
1113
1114 @cindex lyrics and beaming
1115 @cindex beaming and lyrics
1116 @funindex \autoBeamOff
1117
1118 Az automatikus gerendázás -, amit a LilyPond használ - jól működik
1119 a hangszeres zenére, de nem túl jó a dalszövegek esetén,
1120 amikor előfordul, hogy nincs is szükség gerendákra vagy ha épp melizmát jeleznénk a dalszövegben.
1121 A fenti példában az @code{\autoBeamOff} paranccsal kikapcsoltuk az automatikus gerendázást.
1122
1123 @funindex \new ChoirStaff
1124 @funindex ChoirStaff
1125 @funindex \lyricmode
1126 @cindex vocal score structure
1127 @cindex choir staff
1128
1129 A korábbi Judas Maccabæus példát használva
1130 nézzünk meg egy rugalmasabb módszert.  Először írjuk újra
1131 változók használatával, így a zene és a dalszöveg a kotta struktúrájától 
1132 különválik. Vezessünk be egy kottasorcsoportot, mely kórusszólamokat fog össze
1133 (ChoirStaff).
1134 A dalszöveget magát egy @code{\lyricmode} paranccsal
1135 vezetjük be, ezzel biztosítva, hogy dalszövegként és 
1136 ne zeneként legyen értelmezve.
1137
1138 @lilypond[quote,verbatim]
1139 global = { \time 6/8 \partial 8 \key f \major}
1140 SopOneMusic = \relative {
1141   c''8 | c([ bes)] a a([ g)] f | f'4. b, | c4.~ 4 | }
1142 SopTwoMusic = \relative {
1143   r8 | r4. r4 c'8 | a'([ g)] f f([ e)] d | e([ d)] c bes' | }
1144 SopOneLyrics = \lyricmode {
1145   Let | flee -- cy flocks the | hills a -- dorn, __ | }
1146 SopTwoLyrics = \lyricmode {
1147   Let | flee -- cy flocks the | hills a -- dorn, | }
1148
1149 \score {
1150   \new ChoirStaff <<
1151     \new Staff <<
1152       \new Voice = "SopOne" {
1153         \global
1154         \SopOneMusic
1155       }
1156       \new Lyrics \lyricsto "SopOne" {
1157         \SopOneLyrics
1158       }
1159     >>
1160     \new Staff <<
1161       \new Voice = "SopTwo" {
1162         \global
1163         \SopTwoMusic
1164       }
1165       \new Lyrics \lyricsto "SopTwo" {
1166         \SopTwoLyrics
1167       }
1168     >>
1169   >>
1170 }
1171 @end lilypond
1172
1173 Ilyen az alapvető felépítése, struktúrája minden vokális zenének. Olykor több kottasor 
1174 szükséges vagy több szólam van egy-egy kottasorban, esetleg több versszakból áll a dalszöveg.
1175 A változók, amik a zenét tartalmazzák, könnyen külön fájlokba is rendezhetők, ha túl hosszúak lennének.
1176
1177 @cindex hymn structure
1178 @cindex SATB structure
1179 @cindex vocal scores with multiple verses
1180 @cindex multiple vocal verses
1181 @cindex versszakok, multiple vocal
1182
1183 Itt egy példa egy egyházi ének első sorára, aminek négy
1184 verszaka van, és négyszólamú kórusra íródott. Ebben az esetben a szavak mind a négy
1185 szólamra azonosak. Figyeljük meg, hogyan használjuk a változókat arra, 
1186 hogy különválasszuk a kottát és a szavakat a kotta felépítésétől.
1187 Figyeljük meg, hogy a  @q{TimeKey} nevű változó számos parancsot tartalmaz,
1188 melyet mindkét kottasorban felhasználunk!
1189 Más példákban ez a közös változó gyakran  @q{global} néven szerepel.
1190
1191 @lilypond[quote,verbatim]
1192 TimeKey = { \time 4/4 \partial 4 \key c \major}
1193 SopMusic   = \relative { c'4 | e4. e8 g4  g  | a a g | }
1194 AltoMusic  = \relative { c'4 | c4. c8 e4  e  | f f e | }
1195 TenorMusic = \relative  { e4 | g4. g8 c4. b8 | a8 b c d e4 | }
1196 BassMusic  = \relative  { c4 | c4. c8 c4  c  | f8 g a b c4 | }
1197 VerseOne   = \lyricmode {
1198   E -- | ter -- nal fa -- ther, | strong to save, | }
1199 VerseTwo   = \lyricmode {
1200   O | Christ, whose voice the | wa -- ters heard, | }
1201 VerseThree = \lyricmode {
1202   O | Ho -- ly Spi -- rit, | who didst brood | }
1203 VerseFour  = \lyricmode {
1204   O | Tri -- ni -- ty of | love and pow'r | }
1205
1206 \score {
1207   \new ChoirStaff <<
1208     \new Staff <<
1209       \clef "treble"
1210       \new Voice = "Sop"  { \voiceOne \TimeKey \SopMusic }
1211       \new Voice = "Alto" { \voiceTwo \AltoMusic }
1212       \new Lyrics \lyricsto "Sop" { \VerseOne   }
1213       \new Lyrics \lyricsto "Sop" { \VerseTwo   }
1214       \new Lyrics \lyricsto "Sop" { \VerseThree }
1215       \new Lyrics \lyricsto "Sop" { \VerseFour  }
1216     >>
1217     \new Staff <<
1218       \clef "bass"
1219       \new Voice = "Tenor" { \voiceOne \TimeKey \TenorMusic }
1220       \new Voice = "Bass"  { \voiceTwo \BassMusic }
1221     >>
1222   >>
1223 }
1224 @end lilypond
1225
1226 @cindex versszakok és refrének
1227
1228 A példát azzal fejezzük be, hogy megmutatjuk hogyan lehet egy olyan versszakot, 
1229 ami kétféle refrénnel folytatódik, két ötvonalas kottában leírni.
1230 Az egymást követő (szekvenciális) és egyidejű (szimultán) részek leírása
1231 egy kottán belül elég trükkös, úgyhogy a magyarázatot óvatosan kövessük!
1232
1233 Kezdjük egy score blokkal, ami tartalmaz egy @code{ChoirStaff}-ot, 
1234 úgy beágyazva, ahogy szeretnénk, hogy látszódjon a kórusrész kezdetén. 
1235 Alapesetben szükség lenne hegyes zárójelekre ( << és >> ) a @code{\new ChoirStaff} után, 
1236 hogy minden kottasor párhuzamos legyen, de most itt el szeretnénk kerülni a 
1237 párhuzamosságot a szóló résznél, ezért zárójeleket használunk - bár a 
1238 hegyes zárójelek nem árthatnak. A @code{ChoirStaff}-on belül először szerepeljen az
1239 a kottasor, ami a versszakot tartalmazni fogja. Hangokat és dalszöveget kell párhuzamosan tartalmaznia, 
1240 tehát szükség lesz hegyes zárójelre a @code{\new Voice} és @code{\new Lyrics} esetén, hogy egy időben kezdődjenek:
1241
1242 @lilypond[quote,verbatim,ragged-right]
1243 versszakhangok = \relative {
1244   \clef "treble"
1245   \key g \major
1246   \time 3/4
1247   g' g g | b b b |
1248 }
1249
1250 szoveg = \lyricmode {
1251   One two three four five six
1252 }
1253 \score {
1254  \new ChoirStaff {
1255   \new Staff <<
1256     \new Voice = "versszak" {
1257       \versszakhangok  \break
1258     }
1259     \new Lyrics \lyricsto "versszak" {
1260       \szoveg
1261     }
1262   >>
1263   }
1264 }
1265 @end lilypond
1266
1267 Ezzel kész a verssor.
1268
1269 Folytatni szeretnénk a refrenA-val ugyanabban az ötvonalas kottában, míg
1270 a második ötvonal ezzel párhuzamosan lenne a refrenB-nek, tehát
1271 ez egy párhuzamos rész, ami rögtön a @code{\break} után jön a "versszak" nevű szólamban.
1272 Igen, a a "versszak" nevű szólamon @emph{belül}! Íme a párhuzamos rész. Több kottasort 
1273 írhatunk hasonló módon. 
1274
1275 @example
1276 <<
1277   \refrenhangokA
1278   \new Lyrics \lyricsto versszak @{
1279     \refrenszovegA
1280   @}
1281   \new Staff <<
1282     \new Voice = "refrenB" @{
1283       \refrenhangokB
1284     @}
1285     \new Lyrics \lyricsto "refrenB" @{
1286       \refrenszovegB
1287     @}
1288   >>
1289 >>
1290 @end example
1291
1292 Itt a végső eredmény két kottasorral a kórusban, mutatva a verse Voice-on belül pozicionált
1293 párhuzamos részt:
1294
1295 @lilypond[quote,verbatim, ragged-right]
1296 versszakhangok = \relative {
1297   \clef "treble"
1298   \key g \major
1299   \time 3/4
1300   g' g g | b b b |
1301 }
1302 refrenhangokA = \relative {
1303   \time 2/4
1304   c'' c | g g \bar "|."
1305 }
1306 refrenhangokB = \relative {
1307   \clef "bass"
1308   \key g \major
1309   c e | d d |
1310 }
1311 szoveg = \lyricmode {
1312   One two three four five six
1313 }
1314 refrenszovegA = \lyricmode {
1315   la la la la
1316 }
1317 refrenszovegB = \lyricmode {
1318   dum dum dum dum
1319 }
1320 \score {
1321   \new ChoirStaff {
1322     \new Staff <<
1323       \new Voice = "versszak" {
1324         \versszakhangok \break
1325         <<
1326           \refrenhangokA
1327           \new Lyrics \lyricsto "versszak" {
1328             \refrenszovegA
1329           }
1330           \new Staff <<
1331             \new Voice = "refrenB" {
1332               \refrenhangokB
1333             }
1334             \new Lyrics \lyricsto "refrenB" {
1335               \refrenszovegB
1336             }
1337           >>
1338         >>
1339       }
1340       \new Lyrics \lyricsto "versszak" {
1341         \szoveg
1342       }
1343     >>
1344   }
1345 }
1346 @end lilypond
1347
1348 @cindex book, example of using
1349 @funindex \book
1350
1351 Habár ez egy érdekes és hasznos példa arra, hogy megértsük, hogyan működnek
1352 az egymásutáni és egyidejű blokkok, gyakorlatban valószínűleg a többség ezt két
1353 @code{\score} blokként írná meg egy implicit  @code{\book} blokkon belül, valahogy így:
1354
1355
1356 @lilypond[quote,verbatim,ragged-right]
1357 versenotes = \relative {
1358   \clef "treble"
1359   \key g \major
1360   \time 3/4
1361   g' g g | b b b |
1362 }
1363 refrainnotesA = \relative {
1364   \time 2/4
1365   c'' c | g g \bar "|."
1366 }
1367 refrainnotesB = \relative {
1368   \clef "bass"
1369   \key g \major
1370   c e | d d |
1371 }
1372 versewords = \lyricmode {
1373   One two three four five six
1374 }
1375 refrainwordsA = \lyricmode {
1376   la la la la
1377 }
1378 refrainwordsB = \lyricmode {
1379   dum dum dum dum
1380 }
1381 \score {
1382   \new Staff <<
1383     \new Voice = "verse" {
1384       \versenotes
1385     }
1386     \new Lyrics \lyricsto "verse" {
1387       \versewords
1388     }
1389   >>
1390 }
1391
1392 \score {
1393   \new ChoirStaff <<
1394     \new Staff <<
1395       \new Voice = "refrainA" {
1396         \refrainnotesA
1397       }
1398       \new Lyrics \lyricsto "refrainA" {
1399         \refrainwordsA
1400       }
1401     >>
1402     \new Staff <<
1403       \new Voice = "refrainB" {
1404         \refrainnotesB
1405       }
1406       \new Lyrics \lyricsto "refrainB" {
1407         \refrainwordsB
1408       }
1409     >>
1410   >>
1411 }
1412 @end lilypond
1413
1414
1415 @seealso
1416 A kottaírás kézikönyve:
1417 @ruser{Vocal music}.
1418
1419
1420 @node Kontextusok és ábrázolók
1421 @section Kontextusok és ábrázolók
1422 @translationof Contexts and engravers
1423
1424
1425 Kontextusok és ábrázolók korábban említésre kerültek; viszont most részletesebben
1426 foglalkozunk a fogalommal, mivel ezeket használhatjuk a LilyPond kimeneti eredményének finomhangolására.
1427
1428
1429 @menu
1430 * A kontextus fogalma::
1431 * Kontextusok létrehozása::
1432 * Az ábrázoló fogalma::
1433 * Kontextusok tulajdonságainak módosítása::
1434 * Ábrázolók hozzáadása és eltávolítása::
1435 @end menu
1436
1437 @node A kontextus fogalma
1438 @subsection A kontextus fogalma
1439 @translationof Contexts explained
1440
1441 @cindex contexts explained
1442
1443 When music is printed, many notational elements which do not
1444 appear explicitly in the input file must be added to the
1445 output.  For example, compare the input and output of the
1446 following example:
1447
1448 @lilypond[quote,verbatim,relative=2,fragment]
1449 cis4 cis2. g4
1450 @end lilypond
1451
1452 The input is rather sparse, but in the output, bar lines,
1453 accidentals, clef, and time signature have been added.  When
1454 LilyPond @emph{interprets} the input the musical information
1455 is parsed from left to right, similar to the way a performer
1456 reads the score.  While reading the input, the program remembers
1457 where measure boundaries are, and which pitches require explicit
1458 accidentals.  This information must be held on several levels.
1459 For example, an accidental affects only a single staff, while
1460 a bar line must be synchronized across the entire score.
1461
1462 Within LilyPond, these rules and bits of information are grouped in
1463 @emph{Contexts}.  We have already introduced the @code{Voice} context.
1464 Others are the @code{Staff} and @code{Score} contexts.  Contexts are
1465 hierarchical to reflect the hierarchical nature of a musical score.
1466 For example: a @code{Staff} context can contain many @code{Voice}
1467 contexts, and a @code{Score} context can contain many @code{Staff}
1468 contexts.
1469
1470 @quotation
1471 @sourceimage{context-example,5cm,,}
1472 @end quotation
1473
1474 Each context has the responsibility for enforcing some notation rules,
1475 creating some notation objects and maintaining the associated
1476 properties.  For example, the @code{Voice} context may introduce an
1477 accidental and then the @code{Staff} context maintains the rule to
1478 show or suppress the accidental for the remainder of the measure.
1479
1480 As another example, the synchronization of bar lines is, by default,
1481 handled in the @code{Score} context.
1482 However, in some music we may not want the bar lines to be
1483 synchronized -- consider a polymetric score in 4/4 and 3/4 time.
1484 In such cases, we must modify the default settings of the
1485 @code{Score} and @code{Staff} contexts.
1486
1487 For very simple scores, contexts are created implicitly, and you need
1488 not be aware of them.  For larger pieces, such as anything with more
1489 than one staff, they must be
1490 created explicitly to make sure that you get as many staves as you
1491 need, and that they are in the correct order.  For typesetting pieces
1492 with specialized notation, it is usual to modify existing, or
1493 even to define totally new, contexts.
1494
1495 In addition to the @code{Score,} @code{Staff} and
1496 @code{Voice} contexts there are contexts which fit between
1497 the score and staff levels to control staff groups, such as the
1498 @code{PianoStaff} and @code{ChoirStaff} contexts.  There
1499 are also alternative staff and voice contexts, and contexts for
1500 lyrics, percussion, fret boards, figured bass, etc.
1501
1502 The names of all context types are formed from one or more
1503 words, each word being capitalized and joined immediately to the
1504 preceding word with no hyphen or underscore, e.g.,
1505 @code{GregorianTranscriptionStaff}.
1506
1507
1508 @seealso
1509 A kottaírás kézikönyve:
1510 @ruser{A kontextus fogalma}.
1511
1512
1513 @node Kontextusok létrehozása
1514 @subsection Kontextusok létrehozása
1515 @translationof Creating contexts
1516
1517
1518 @funindex \new
1519 @cindex new contexts
1520 @cindex creating contexts
1521 @cindex contexts, creating
1522
1523 In an input file a score block, introduced with a @code{\score}
1524 command, contains a single music expression and an associated
1525 output definition (either a @code{\layout} or a @code{\midi} block).
1526 The @code{Score} context is usually left to be created automatically
1527 when the interpretation of that music expression starts.
1528
1529 For scores with only one voice and one staff, the @code{Voice} and
1530 @code{Staff} contexts may also be left to be created automatically,
1531 but for more complex scores it is necessary to create them by hand.
1532 The simplest command that does this is @code{\new}.  It is prepended
1533 to a music expression, for example
1534
1535 @example
1536 \new @var{type} @var{music-expression}
1537 @end example
1538
1539 @noindent
1540 where @var{type} is a context name (like @code{Staff} or
1541 @code{Voice}).  This command creates a new context, and starts
1542 interpreting the @var{music-expression} within that context.
1543
1544 (Note that a @code{\new Score} command is not normally required,
1545 as the essential top-level @code{Score} context is created
1546 automatically when the music expression within the @code{\score}
1547 block is interpreted.  The only reason for creating a @code{Score}
1548 context explicitly using @code{\new Score} is to introduce a
1549 @code{\with} block in which one or more score-wide default values
1550 of context properties may be specified.  Information on using
1551 @code{\with} blocks can be found under the heading
1552 @qq{Setting context properties with @code{\\with} } in
1553 @ref{Kontextusok tulajdonságainak módosítása}.)
1554
1555 You have seen many practical examples which created new
1556 @code{Staff} and @code{Voice} contexts in earlier sections, but
1557 to remind you how these commands are used in practice, here's an
1558 annotated real-music example:
1559
1560 @lilypond[quote,verbatim,ragged-right]
1561 \score {  % start of single compound music expression
1562   <<  % start of simultaneous staves section
1563     \time 2/4
1564     \new Staff {  % create RH staff
1565       \key g \minor
1566       \clef "treble"
1567       \new Voice {  % create voice for RH notes
1568         \relative {  % start of RH notes
1569           d''4 ees16 c8.
1570           d4 ees16 c8.
1571         }  % end of RH notes
1572       }  % end of RH voice
1573     }  % end of RH staff
1574     \new Staff <<  % create LH staff; needs two simultaneous voices
1575       \key g \minor
1576       \clef "bass"
1577       \new Voice {  % create LH voice one
1578         \voiceOne
1579         \relative {  % start of LH voice one notes
1580           g8 <bes d> ees, <g c>
1581           g8 <bes d> ees, <g c>
1582         }  % end of LH voice one notes
1583       }  % end of LH voice one
1584       \new Voice {  % create LH voice two
1585         \voiceTwo
1586         \relative {  % start of LH voice two notes
1587           g4 ees
1588           g4 ees
1589         }  % end of LH voice two notes
1590       }  % end of LH voice two
1591     >>  % end of LH staff
1592   >>  % end of simultaneous staves section
1593 }  % end of single compound music expression
1594 @end lilypond
1595
1596 (Note how all the statements which open a block with either a
1597 curly bracket, @code{@{}, or double angle brackets, @code{<<},
1598 are indented by two further spaces, and the corresponding
1599 closing bracket is indented by exactly the same amount.  While
1600 this is not required, following this practice will greatly
1601 reduce the number of @q{unmatched bracket} errors, and is
1602 strongly recommended.  It enables the structure of the music to
1603 be seen at a glance, and any unmatched brackets will be obvious.
1604 Note too how the LH staff is created using double angle brackets
1605 because it requires two voices for its music, whereas the RH staff
1606 is created with a single music expression surrounded by curly
1607 brackets because it requires only one voice.)
1608
1609 @cindex contexts, naming
1610 @cindex naming contexts
1611
1612 The @code{\new} command may also give an identifying name to the
1613 context to distinguish it from other contexts of the same type,
1614
1615 @example
1616 \new @var{type} = @var{id} @var{music-expression}
1617 @end example
1618
1619 Note the distinction between the name of the context type,
1620 @code{Staff}, @code{Voice}, etc, and the identifying name of a
1621 particular instance of that type, which can be any sequence of letters
1622 invented by the user.  Digits and spaces can also be used in the
1623 identifying name, but then it has to be placed in quotes,
1624 i.e. @code{\new Staff = "MyStaff 1" @var{music-expression}}.
1625 The identifying name is used to
1626 refer back to that particular instance of a context.  We saw this in
1627 use in the section on lyrics, see @ref{Szólamok és vokális zene}.
1628
1629
1630 @seealso
1631 A kottaírás kézikönyve:
1632 @ruser{Kontextusok létrehozása}.
1633
1634
1635 @node Az ábrázoló fogalma
1636 @subsection Az ábrázoló fogalma
1637 @translationof Engravers explained
1638
1639 @cindex engravers
1640
1641 Every mark on the printed output of a score produced by LilyPond
1642 is produced by an @code{Engraver}.  Thus there is an engraver
1643 to print staves, one to print note heads, one for stems, one for
1644 beams, etc, etc.  In total there are over 120 such engravers!
1645 Fortunately, for most scores it is not necessary to know about
1646 more than a few, and for simple scores you do not need to know
1647 about any.
1648
1649 Engravers live and operate in Contexts.  Engravers such as the
1650 @code{Metronome_mark_engraver}, whose action and output apply to the
1651 score as a whole, operate in the highest level context -- the
1652 @code{Score} context.
1653
1654 The @code{Clef_engraver} and @code{Key_engraver} are to be
1655 found in every @code{Staff} Context, as different staves may require
1656 different clefs and keys.
1657
1658 The @code{Note_heads_engraver} and @code{Stem_engraver} live
1659 in every @code{Voice} context, the lowest level context of all.
1660
1661 Each engraver processes the particular objects associated
1662 with its function, and maintains the properties that relate
1663 to that function.  These properties, like the properties
1664 associated with contexts, may be modified to change the
1665 operation of the engraver or the appearance of those elements
1666 in the printed score.
1667
1668 Engravers all have compound names formed from words which
1669 describe their function.  Just the first word is capitalized,
1670 and the remainder are joined to it with underscores.  Thus
1671 the @code{Staff_symbol_engraver} is responsible for creating the
1672 lines of the staff, the @code{Clef_engraver} determines and sets
1673 the pitch reference point on the staff by drawing a clef symbol.
1674
1675 Here are some of the most common engravers together with their
1676 function.  You will see it is usually easy to guess the function
1677 from the name, or vice versa.
1678
1679 @multitable @columnfractions .3 .7
1680 @headitem Engraver
1681   @tab Function
1682 @item Accidental_engraver
1683   @tab Makes accidentals, cautionary and suggested accidentals
1684 @item Beam_engraver
1685   @tab Engraves beams
1686 @item Clef_engraver
1687   @tab Engraves clefs
1688 @item Completion_heads_engraver
1689   @tab Splits notes which cross bar lines
1690 @item Dynamic_engraver
1691   @tab Creates hairpins and dynamic texts
1692 @item Forbid_line_break_engraver
1693   @tab Prevents line breaks if a musical element is still active
1694 @item Key_engraver
1695   @tab Creates the key signature
1696 @item Metronome_mark_engraver
1697   @tab Engraves metronome marking
1698 @item Note_heads_engraver
1699   @tab Engraves note heads
1700 @item Rest_engraver
1701   @tab Engraves rests
1702 @item Staff_symbol_engraver
1703   @tab Engraves the five (by default) lines of the staff
1704 @item Stem_engraver
1705   @tab Creates stems and single-stem tremolos
1706 @item Time_signature_engraver
1707   @tab Creates time signatures
1708 @end multitable
1709
1710 @smallspace
1711
1712 We shall see later how the output of LilyPond can be changed
1713 by modifying the action of Engravers.
1714
1715
1716 @seealso
1717 Internals reference: @rinternals{Engravers and Performers}.
1718
1719
1720 @node Kontextusok tulajdonságainak módosítása
1721 @subsection Kontextusok tulajdonságainak módosítása
1722 @translationof Modifying context properties
1723
1724 @cindex context properties
1725 @cindex context properties, modifying
1726 @cindex modifying context properties
1727 @funindex \set
1728 @funindex \unset
1729
1730 Contexts are responsible for holding the values of a number of
1731 context @emph{properties}.  Many of them can be changed to
1732 influence the interpretation of the input and so change the
1733 appearance of the output.  They are changed by the
1734 @code{\set} command.  This takes the form
1735
1736 @example
1737 \set @emph{ContextName}.@emph{propertyName} = #@emph{value}
1738 @end example
1739
1740 Where the @emph{ContextName} is usually @code{Score},
1741 @code{Staff} or @code{Voice}.  It may be omitted,
1742 in which case the current context (typically @code{Voice}) is assumed.
1743
1744 The names of context properties consist of words joined
1745 together with no hyphens or underscores, all except the
1746 first having a capital letter.  Here are a few examples
1747 of some commonly used ones.  There are many more.
1748
1749 @c attempt to force this onto a new page
1750 @need 50
1751 @multitable @columnfractions .25 .15 .45 .15
1752 @headitem propertyName
1753   @tab Type
1754   @tab Function
1755   @tab Example Value
1756 @item extraNatural
1757   @tab Boolean
1758   @tab If true, set extra natural signs before accidentals
1759   @tab @code{#t}, @code{#f}
1760 @item currentBarNumber
1761   @tab Integer
1762   @tab Set the current bar number
1763   @tab @code{50}
1764 @item doubleSlurs
1765   @tab Boolean
1766   @tab If true, print slurs both above and below notes
1767   @tab @code{#t}, @code{#f}
1768 @item instrumentName
1769   @tab Text
1770   @tab Set the name to be placed at the start of the staff
1771   @tab @code{"Cello I"}
1772 @item fontSize
1773   @tab Real
1774   @tab Increase or decrease the font size
1775   @tab @code{2.4}
1776 @item stanza
1777   @tab Text
1778   @tab Set the text to print before the start of a verse
1779   @tab @code{"2"}
1780 @end multitable
1781
1782 @noindent
1783 where a Boolean is either True (@code{#t}) or False (@code{#f}),
1784 an Integer is a positive whole number, a Real is a positive
1785 or negative decimal number, and text is enclosed in double
1786 apostrophes.  Note the occurrence of hash signs,
1787 (@code{#}), in two different places -- as part of the Boolean
1788 value before the @code{t} or @code{f}, and before @emph{value}
1789 in the @code{\set} statement.  So when a Boolean is being
1790 entered you need to code two hash signs, e.g., @code{##t}.
1791
1792 @cindex properties operating in contexts
1793 @cindex setting properties within contexts
1794
1795 Before we can set any of these properties we need to know
1796 in which context they operate.  Sometimes this is obvious,
1797 but occasionally it can be tricky.  If the wrong context
1798 is specified, no error message is produced, but the expected
1799 action will not take place.  For example, the
1800 @code{instrumentName} clearly lives in the @code{Staff} context, since
1801 it is the staff that is to be named.
1802 In this example the first staff is labeled, but not the second,
1803 because we omitted the context name.
1804
1805 @lilypond[quote,verbatim,ragged-right]
1806 <<
1807   \new Staff \relative {
1808     \set Staff.instrumentName = #"Soprano"
1809     c''4 c
1810  }
1811   \new Staff \relative {
1812   \set instrumentName = #"Alto"  % Wrong!
1813   d'4 d
1814  }
1815 >>
1816 @end lilypond
1817
1818 Remember the default context name is @code{Voice}, so the second
1819 @code{\set} command set the property @code{instrumentName} in the
1820 @code{Voice} context to @qq{Alto}, but as LilyPond does not look
1821 for any such property in the @code{Voice} context, no
1822 further action took place.  This is not an error, and no error
1823 message is logged in the log file.
1824
1825 Similarly, if the property name is mis-spelt no error message is
1826 produced, and clearly the expected action cannot be performed.  In
1827 fact, you can set any (fictitious) @q{property} using any name you
1828 like in any context that exists by using the @code{\set} command.  But
1829 if the name is not known to LilyPond it will not cause any action to
1830 be taken.  Some text editors with special support for LilyPond input
1831 files document property names with bullets when you hover them with
1832 the mouse, like JEdit with LilyPondTool, or highlight unknown property
1833 names differently, like ConTEXT.  If you do not use an editor with
1834 such features, it is recommended to check the property name in the
1835 Internals Reference: see @rinternals{Tunable context properties}, or
1836 @rinternals{Contexts}.
1837
1838 The @code{instrumentName} property will take effect only
1839 if it is set in the @code{Staff} context, but
1840 some properties can be set in more than one context.
1841 For example, the property @code{extraNatural} is by
1842 default set to ##t (true) for all staves.
1843 If it is set to ##f (false) in one particular @code{Staff}
1844 context it applies just to the accidentals on that staff.
1845 If it is set to false in the @code{Score} context
1846 it applies to all staves.
1847
1848 So this turns off extra naturals in one staff:
1849
1850 @lilypond[quote,verbatim,ragged-right]
1851 <<
1852   \new Staff \relative {
1853     ais'4 aes
1854   }
1855   \new Staff \relative {
1856     \set Staff.extraNatural = ##f
1857     ais'4 aes
1858   }
1859 >>
1860 @end lilypond
1861
1862 @noindent
1863 and this turns them off in all staves:
1864
1865 @lilypond[quote,verbatim,ragged-right]
1866 <<
1867   \new Staff \relative {
1868     ais'4 aes
1869   }
1870   \new Staff \relative {
1871     \set Score.extraNatural = ##f
1872     ais'4 aes
1873   }
1874 >>
1875 @end lilypond
1876
1877 As another example, if @code{clefTransposition} is set in
1878 the @code{Score} context this immediately changes the value
1879 of the octavation in all current staves and sets a new default
1880 value which will be applied to all staves.
1881
1882 The opposite command, @code{\unset}, effectively removes the
1883 property from the context, which causes most properties to
1884 revert to their default value.  Usually @code{\unset} is not
1885 required as a new @code{\set} command will achieve what is
1886 wanted.
1887
1888 The @code{\set} and @code{\unset} commands can appear anywhere
1889 in the input file and will take effect from the time they are
1890 encountered until the end of the score or until the property is
1891 @code{\set} or @code{\unset} again.  Let's try changing the
1892 font size, which affects the size of the note heads (among
1893 other things) several times.  The change is from the default
1894 value, not the most recently set value.
1895
1896 @lilypond[quote,verbatim,ragged-right,relative=1,fragment]
1897 c4
1898 % make note heads smaller
1899 \set fontSize = #-4
1900 d e
1901 % make note heads larger
1902 \set fontSize = #2.5
1903 f g
1904 % return to default size
1905 \unset fontSize
1906 a b
1907 @end lilypond
1908
1909 We have now seen how to set the values of several different types of
1910 property.  Note that integers and numbers are always preceded by a
1911 hash sign, @code{#}, while a true or false value is specified by
1912 @code{##t} and @code{##f}, with two hash signs.  A text property
1913 should be enclosed in double quotation signs, as above, although we
1914 shall see later that text can actually be specified in a much more
1915 general way by using the very powerful @code{\markup} command.
1916
1917 @subsubheading Setting context properties with @code{\with}
1918
1919 @funindex \with
1920 @cindex context properties, setting with \with
1921
1922 The default value of context properties may be set at the time the
1923 context is created.  Sometimes this is a clearer way of setting a
1924 property value if it is to remain fixed for the duration of
1925 the context.  When a context is created with a @code{\new}
1926 command it may be followed immediately by a @code{\with @{ .. @}}
1927 block in which the default property values are set.  For example,
1928 if we wish to suppress the printing of extra naturals for the
1929 duration of a staff we would write:
1930
1931 @example
1932 \new Staff \with @{ extraNatural = ##f @}
1933 @end example
1934
1935 @noindent
1936 like this:
1937
1938 @lilypond[quote,verbatim,ragged-right]
1939 <<
1940   \new Staff
1941   \relative {
1942     gis' ges aes ais
1943   }
1944   \new Staff \with { extraNatural = ##f }
1945   \relative {
1946     gis' ges aes ais
1947   }
1948 >>
1949 @end lilypond
1950
1951 Or, if the property override is to be applied to all staves
1952 within the score, it may be appended to an explicit
1953 @code{\new Score} command, like this:
1954
1955 @lilypond[quote,verbatim,ragged-right]
1956 \score {
1957   \new Score \with { extraNatural = ##f } <<
1958     \new Staff {
1959       \relative {
1960         gis' ges aes ais
1961       }
1962     }
1963     \new Staff {
1964       \relative {
1965         gis' ges aes ais
1966       }
1967     }
1968   >>
1969 }
1970 @end lilypond
1971
1972 Properties set in this way may still be changed dynamically using
1973 @code{\set} and returned to the default value set in the
1974 @code{\with} block with @code{\unset}.
1975
1976 @cindex fontSize, default and setting
1977
1978 So if the @code{fontSize} property is set in a @code{\with} clause
1979 it sets the default value of the font size.  If it is later changed
1980 with @code{\set}, this new default value may be restored with the
1981 @code{\unset fontSize} command.
1982
1983 @subsubheading Setting context properties with @code{\context}
1984
1985 @cindex context properties, setting with \context
1986 @funindex \context
1987
1988 The values of context properties may be set in @emph{all} contexts
1989 of a particular type, such as all @code{Staff} contexts, with a single
1990 command.  The context type is identified by using its
1991 type name, like @code{Staff}, prefixed by a back-slash: @code{\Staff}.
1992 The statement which sets the property value is the same as that in a
1993 @code{\with} block, introduced above.  It is placed in a
1994 @code{\context} block within a @code{\layout} block.  Each
1995 @code{\context} block will affect all contexts of the type specified
1996 throughout the @code{\score} or @code{\book} block in which the
1997 @code{\layout} block appears.  Here is a example to show the format:
1998
1999 @lilypond[verbatim,quote]
2000 \score {
2001   \new Staff {
2002     \relative {
2003       cis''4 e d ces
2004     }
2005   }
2006   \layout {
2007     \context {
2008       \Staff
2009       extraNatural = ##t
2010     }
2011   }
2012 }
2013 @end lilypond
2014
2015 @noindent
2016 Context properties set in this way may be overridden for particular
2017 instances of contexts by statements in a @code{\with} block, and by
2018 @code{\set} commands embedded in music statements.
2019
2020
2021 @seealso
2022 A kottaírás kézikönyve:
2023 @ruser{Changing context default settings}.
2024 @ruser{The set command}.
2025
2026 Internals Reference:
2027 @rinternals{Contexts},
2028 @rinternals{Tunable context properties}.
2029
2030
2031 @node Ábrázolók hozzáadása és eltávolítása
2032 @subsection Ábrázolók hozzáadása és eltávolítása
2033 @translationof Adding and removing engravers
2034
2035 @cindex engravers, adding
2036 @cindex adding engravers
2037 @cindex engravers, removing
2038 @cindex removing engravers
2039
2040 @funindex \consists
2041 @funindex \remove
2042
2043 We have seen that contexts each contain several engravers, each
2044 of which is responsible for producing a particular part of the
2045 output, like bar lines, staves, note heads, stems, etc.  If an
2046 engraver is removed from a context, it can no longer produce its
2047 output.  This is a crude way of modifying the output, but it
2048 can sometimes be useful.
2049
2050 @subsubheading Changing a single context
2051
2052 To remove an engraver from a single context we use the
2053 @code{\with} command placed immediately after the context creation
2054 command, as in the previous section.
2055
2056 As an illustration, let's repeat an example from the previous section
2057 with the staff lines removed.  Remember that the staff lines are
2058 produced by the @code{Staff_symbol_engraver}.
2059
2060 @lilypond[quote,verbatim,ragged-right]
2061 \new Staff \with {
2062   \remove "Staff_symbol_engraver"
2063 }
2064 \relative {
2065   c'4
2066   \set fontSize = #-4  % make note heads smaller
2067   d e
2068   \set fontSize = #2.5  % make note heads larger
2069   f g
2070   \unset fontSize  % return to default size
2071   a b
2072 }
2073 @end lilypond
2074
2075 @cindex ambitus engraver
2076
2077 Engravers can also be added to individual contexts.
2078 The command to do this is
2079
2080 @code{\consists @var{Engraver_name}},
2081
2082 @noindent
2083 placed inside a @code{\with} block.  Some vocal scores have an ambitus
2084 placed at the beginning of a staff to indicate the range of notes in
2085 that staff -- see @rglos{ambitus}.  The ambitus is produced by the
2086 @code{Ambitus_engraver}, which is not normally included in any
2087 context.  If we add it to the @code{Voice} context, it calculates the
2088 range from that voice only:
2089
2090 @lilypond[quote,verbatim,ragged-right]
2091 \new Staff <<
2092   \new Voice \with {
2093     \consists "Ambitus_engraver"
2094   }
2095   \relative {
2096     \voiceOne
2097     c'' a b g
2098   }
2099   \new Voice
2100   \relative {
2101     \voiceTwo
2102     c' e d f
2103   }
2104 >>
2105 @end lilypond
2106
2107 @noindent
2108 but if we add the ambitus engraver to the
2109 @code{Staff} context, it calculates the range from all
2110 the notes in all the voices on that staff:
2111
2112 @lilypond[quote,verbatim,ragged-right]
2113 \new Staff \with {
2114     \consists "Ambitus_engraver"
2115   }
2116   <<
2117   \new Voice
2118   \relative {
2119     \voiceOne
2120     c'' a b g
2121   }
2122   \new Voice
2123   \relative {
2124     \voiceTwo
2125     c' e d f
2126   }
2127 >>
2128 @end lilypond
2129
2130 @subsubheading Changing all contexts of the same type
2131
2132 @funindex \layout
2133
2134 The examples above show how to remove or add engravers to
2135 individual contexts.  It is also possible to remove or add
2136 engravers to every context of a specific type by placing the
2137 commands in the appropriate context in a @code{\layout}
2138 block.  For example, if we wanted to show an ambitus for every
2139 staff in a four-staff score, we could write
2140
2141 @lilypond[quote,verbatim,ragged-right]
2142 \score {
2143   <<
2144     \new Staff <<
2145       \relative {
2146         c'' a b g
2147       }
2148     >>
2149     \new Staff <<
2150       \relative {
2151         c' a b g
2152       }
2153     >>
2154     \new Staff <<
2155       \clef "G_8"
2156       \relative {
2157         c' a b g
2158       }
2159     >>
2160     \new Staff <<
2161       \clef "bass"
2162       \relative {
2163         c a b g
2164       }
2165     >>
2166   >>
2167   \layout {
2168     \context {
2169       \Staff
2170       \consists "Ambitus_engraver"
2171     }
2172   }
2173 }
2174 @end lilypond
2175
2176 @noindent
2177 The values of context properties may also be set
2178 for all contexts of a particular type by including the
2179 @code{\set} command in a @code{\context} block in the
2180 same way.
2181
2182
2183 @seealso
2184 A kottaírás kézikönyve:
2185 @ruser{Modifying context plug-ins},
2186 @ruser{Changing context default settings}.
2187
2188
2189 @node A sablonok kibővítése
2190 @section A sablonok kibővítése
2191 @translationof Extending the templates
2192
2193 You've read the tutorial, you know how to write music, you
2194 understand the fundamental concepts.  But how can you
2195 get the staves that you want?  Well, you can find lots of
2196 templates (see @ref{Templates}) which may give you a start.
2197 But what if you want something that isn't covered there?  Read on.
2198
2199 @menu
2200 * Szoprán és cselló::
2201 * Négyszólamú vegyeskar::
2202 * Kotta létrehozása az alapoktól::
2203 * Kevesebb gépelés változókkal és függvényekkel::
2204 * Partitúra és szólamkották::
2205 @end menu
2206
2207 @node Szoprán és cselló
2208 @subsection Szoprán és cselló
2209 @translationof Soprano and cello
2210
2211 @cindex template, modifying
2212 @cindex modifying templates
2213
2214 Start off with the template that seems closest to what you want to
2215 end up with.  Let's say that you want to write something for
2216 soprano and cello.  In this case, we would start with the
2217 @q{Notes and lyrics} template (for the soprano part).
2218
2219 @example
2220 \version @w{"@version{}"}
2221 melody = \relative @{
2222   \clef treble
2223   \key c \major
2224   \time 4/4
2225   a4 b c d
2226 @}
2227
2228 text = \lyricmode @{
2229   Aaa Bee Cee Dee
2230 @}
2231
2232 \score @{
2233   <<
2234     \new Voice = "one" @{
2235       \autoBeamOff
2236       \melody
2237     @}
2238     \new Lyrics \lyricsto "one" \text
2239   >>
2240   \layout @{ @}
2241   \midi @{ @}
2242 @}
2243 @end example
2244
2245 Now we want to add a cello part.  Let's look at the @q{Notes only} example:
2246
2247 @example
2248 \version @w{"@version{}"}
2249 melody = \relative @{
2250   \clef treble
2251   \key c \major
2252   \time 4/4
2253   a4 b c d
2254 @}
2255
2256 \score @{
2257   \new Staff \melody
2258   \layout @{ @}
2259   \midi @{ @}
2260 @}
2261 @end example
2262
2263 We don't need two @code{\version} commands.  We'll need the
2264 @code{melody} section.  We don't want two @code{\score} sections
2265 -- if we had two @code{\score}s, we'd get the two parts separately.
2266 We want them together, as a duet.  Within the @code{\score}
2267 section, we don't need two @code{\layout} or @code{\midi}.
2268
2269 If we simply cut and paste the @code{melody} section, we would
2270 end up with two @code{melody} definitions.  This would not generate
2271 an error, but the second one would be used for both melodies.
2272 So let's rename them to make them distinct.  We'll call the
2273 section for the soprano @code{sopranoMusic} and the section for
2274 the cello @code{celloMusic}.  While we're doing this, let's rename
2275 @code{text} to be @code{sopranoLyrics}.  Remember to rename both
2276 instances of all these names -- both the initial definition (the
2277 @code{melody = \relative c' @{ } part) and the name's use (in the
2278 @code{\score} section).
2279
2280 While we're doing this, let's change the cello part's staff --
2281 celli normally use bass clef.  We'll also give the cello some
2282 different notes.
2283
2284 @example
2285 \version @w{"@version{}"}
2286 sopranoMusic = \relative @{
2287   \clef treble
2288   \key c \major
2289   \time 4/4
2290   a4 b c d
2291 @}
2292
2293 sopranoLyrics = \lyricmode @{
2294   Aaa Bee Cee Dee
2295 @}
2296
2297 celloMusic = \relative @{
2298   \clef bass
2299   \key c \major
2300   \time 4/4
2301   d4 g fis8 e d4
2302 @}
2303
2304 \score @{
2305   <<
2306     \new Voice = "one" @{
2307       \autoBeamOff
2308       \sopranoMusic
2309     @}
2310     \new Lyrics \lyricsto "one" \sopranoLyrics
2311   >>
2312   \layout @{ @}
2313   \midi @{ @}
2314 @}
2315 @end example
2316
2317 This is looking promising, but the cello part won't appear in the
2318 score -- we haven't used it in the @code{\score} section.  If we
2319 want the cello part to appear under the soprano part, we need to add
2320
2321 @example
2322 \new Staff \celloMusic
2323 @end example
2324
2325 @noindent
2326 underneath the soprano stuff.  We also need to add @code{<<} and
2327 @code{>>} around the music -- that tells LilyPond that there's
2328 more than one thing (in this case, two @code{Staves}) happening
2329 at once.  The @code{\score} looks like this now:
2330
2331 @c Indentation in this example is deliberately poor
2332 @example
2333 \score @{
2334   <<
2335     <<
2336       \new Voice = "one" @{
2337         \autoBeamOff
2338         \sopranoMusic
2339       @}
2340       \new Lyrics \lyricsto "one" \sopranoLyrics
2341     >>
2342     \new Staff \celloMusic
2343   >>
2344   \layout @{ @}
2345   \midi @{ @}
2346 @}
2347 @end example
2348
2349 @noindent
2350 This looks a bit messy; the indentation is messed up now.  That is
2351 easily fixed.  Here's the complete soprano and cello template.
2352
2353 @lilypond[quote,verbatim,ragged-right,addversion]
2354 sopranoMusic = \relative {
2355   \clef treble
2356   \key c \major
2357   \time 4/4
2358   a4 b c d
2359 }
2360
2361 sopranoLyrics = \lyricmode {
2362   Aaa Bee Cee Dee
2363 }
2364
2365 celloMusic = \relative {
2366   \clef bass
2367   \key c \major
2368   \time 4/4
2369   d4 g fis8 e d4
2370 }
2371
2372 \score {
2373   <<
2374     <<
2375       \new Voice = "one" {
2376         \autoBeamOff
2377         \sopranoMusic
2378       }
2379       \new Lyrics \lyricsto "one" \sopranoLyrics
2380     >>
2381     \new Staff \celloMusic
2382   >>
2383   \layout { }
2384   \midi { }
2385 }
2386 @end lilypond
2387
2388
2389 @seealso
2390 The starting templates can be found in the @q{Templates} appendix,
2391 see @ref{Single staff}.
2392
2393
2394 @node Négyszólamú vegyeskar
2395 @subsection Négyszólamú vegyeskar
2396 @translationof Four-part SATB vocal score
2397
2398 @cindex template, SATB
2399 @cindex SATB template
2400
2401 Most vocal scores of music written for four-part mixed choir
2402 with orchestral accompaniment such as Mendelssohn's Elijah or
2403 Handel's Messiah have the choral music and words on four
2404 staves, one for each of SATB, with a piano reduction of the
2405 orchestral accompaniment underneath.  Here's an example
2406 from Handel's Messiah:
2407
2408 @c The following should appear as music without code
2409 @lilypond[quote,ragged-right]
2410 global = { \key d \major \time 4/4 }
2411 sopranoMusic = \relative {
2412   \clef "treble"
2413   r4 d''2 a4 | d4. d8 a2 | cis4 d cis2 |
2414 }
2415 sopranoWords = \lyricmode {
2416   Wor -- thy is the lamb that was slain
2417 }
2418 altoMusic = \relative {
2419   \clef "treble"
2420   r4 a'2 a4 | fis4. fis8 a2 | g4 fis e2 |
2421 }
2422 altoWords = \sopranoWords
2423 tenorMusic = \relative {
2424   \clef "G_8"
2425   r4 fis'2 e4 | d4. d8 d2 | e4 a, cis2 |
2426 }
2427 tenorWords = \sopranoWords
2428 bassMusic = \relative {
2429   \clef "bass"
2430   r4 d'2 cis4 | b4. b8 fis2 | e4 d a'2 |
2431 }
2432 bassWords = \sopranoWords
2433 upper = \relative {
2434   \clef "treble"
2435   \global
2436   r4 <a' d fis>2 <a e' a>4
2437   <d fis d'>4. <d fis d'>8 <a d a'>2
2438   <g cis g'>4 <a d fis> <a cis e>2
2439 }
2440 lower = \relative {
2441   \clef "bass"
2442   \global
2443   <d, d'>4 <d d'>2 <cis cis'>4
2444   <b b'>4. <b' b'>8 <fis fis'>2
2445   <e e'>4 <d d'> <a' a'>2
2446 }
2447
2448 \score {
2449   <<  % combine ChoirStaff and PianoStaff in parallel
2450     \new ChoirStaff <<
2451       \new Staff = "sopranos" <<
2452         \set Staff.instrumentName = #"Soprano"
2453         \new Voice = "sopranos" {
2454           \global
2455           \sopranoMusic
2456         }
2457       >>
2458       \new Lyrics \lyricsto "sopranos" {
2459         \sopranoWords
2460       }
2461       \new Staff = "altos" <<
2462         \set Staff.instrumentName = #"Alto"
2463         \new Voice = "altos" {
2464           \global
2465           \altoMusic
2466         }
2467       >>
2468       \new Lyrics \lyricsto "altos" { \altoWords }
2469       \new Staff = "tenors" <<
2470         \set Staff.instrumentName = #"Tenor"
2471         \new Voice = "tenors" {
2472           \global
2473           \tenorMusic
2474         }
2475       >>
2476       \new Lyrics \lyricsto "tenors" { \tenorWords }
2477       \new Staff = "basses" <<
2478         \set Staff.instrumentName = #"Bass"
2479         \new Voice = "basses" {
2480           \global
2481           \bassMusic
2482         }
2483       >>
2484       \new Lyrics \lyricsto "basses" {
2485         \bassWords
2486       }
2487     >>  % end ChoirStaff
2488     \new PianoStaff <<
2489       \set PianoStaff.instrumentName = #"Piano"
2490       \new Staff = "upper" \upper
2491       \new Staff = "lower" \lower
2492     >>
2493   >>
2494 }
2495 @end lilypond
2496
2497 None of the templates provides this layout exactly.  The nearest is
2498 @q{SATB vocal score and automatic piano reduction} -- see @ref{Vocal
2499 ensembles} -- but we need to change the layout and add a piano
2500 accompaniment which is not derived automatically from the vocal parts.
2501 The variables holding the music and words for the vocal parts are
2502 fine, but we shall need to add variables for the piano reduction.
2503
2504 The order in which the contexts appear in the ChoirStaff of the
2505 template do not correspond with the order in the vocal score shown
2506 above.  We need to rearrange them so there are four staves with the
2507 words written directly underneath the notes for each part.  All the
2508 voices should be @code{\voiceOne}, which is the default, so the
2509 @code{\voiceXXX} commands should be removed.  We also need to specify
2510 the tenor clef for the tenors.  The way in which lyrics are specified
2511 in the template has not yet been encountered so we need to use the
2512 method with which we are familiar.  We should also add the names of
2513 each staff.
2514
2515 Doing this gives for our ChoirStaff:
2516
2517 @example
2518     \new ChoirStaff <<
2519       \new Staff = "sopranos" <<
2520         \set Staff.instrumentName = #"Soprano"
2521         \new Voice = "sopranos" @{
2522           \global
2523           \sopranoMusic
2524         @}
2525       >>
2526       \new Lyrics \lyricsto "sopranos" @{
2527         \sopranoWords
2528      @}
2529       \new Staff = "altos" <<
2530         \set Staff.instrumentName = #"Alto"
2531         \new Voice = "altos" @{
2532           \global
2533           \altoMusic
2534         @}
2535       >>
2536       \new Lyrics \lyricsto "altos" @{
2537         \altoWords
2538       @}
2539       \new Staff = "tenors" <<
2540         \set Staff.instrumentName = #"Tenor"
2541         \new Voice = "tenors" @{
2542           \global
2543           \tenorMusic
2544         @}
2545       >>
2546       \new Lyrics \lyricsto "tenors" @{
2547         \tenorWords
2548       @}
2549       \new Staff = "basses" <<
2550         \set Staff.instrumentName = #"Bass"
2551         \new Voice = "basses" @{
2552           \global
2553           \bassMusic
2554         @}
2555       >>
2556       \new Lyrics \lyricsto "basses" @{
2557         \bassWords
2558       @}
2559     >>  % end ChoirStaff
2560 @end example
2561
2562 Next we must work out the piano part.  This is
2563 easy - we just pull out the piano part from the
2564 @q{Solo piano} template:
2565
2566 @example
2567 \new PianoStaff <<
2568   \set PianoStaff.instrumentName = #"Piano  "
2569   \new Staff = "upper" \upper
2570   \new Staff = "lower" \lower
2571 >>
2572 @end example
2573
2574 and add the variable definitions for @code{upper}
2575 and @code{lower}.
2576
2577 The ChoirStaff and PianoStaff must be combined
2578 using angle brackets as we want them to be
2579 stacked one above the other:
2580
2581 @example
2582 <<  % combine ChoirStaff and PianoStaff one above the other
2583   \new ChoirStaff <<
2584     \new Staff = "sopranos" <<
2585       \new Voice = "sopranos" @{
2586         \global
2587         \sopranoMusic
2588       @}
2589     >>
2590     \new Lyrics \lyricsto "sopranos" @{
2591       \sopranoWords
2592      @}
2593     \new Staff = "altos" <<
2594       \new Voice = "altos" @{
2595         \global
2596         \altoMusic
2597       @}
2598     >>
2599     \new Lyrics \lyricsto "altos" @{
2600       \altoWords
2601     @}
2602     \new Staff = "tenors" <<
2603       \clef "G_8"  % tenor clef
2604       \new Voice = "tenors" @{
2605         \global
2606         \tenorMusic
2607       @}
2608     >>
2609     \new Lyrics \lyricsto "tenors" @{
2610       \tenorWords
2611     @}
2612     \new Staff = "basses" <<
2613       \clef "bass"
2614       \new Voice = "basses" @{
2615         \global
2616         \bassMusic
2617       @}
2618     >>
2619     \new Lyrics \lyricsto "basses" @{
2620       \bassWords
2621     @}
2622   >>  % end ChoirStaff
2623
2624   \new PianoStaff <<
2625     \set PianoStaff.instrumentName = #"Piano"
2626     \new Staff = "upper" \upper
2627     \new Staff = "lower" \lower
2628   >>
2629 >>
2630 @end example
2631
2632 Combining all these together and adding the music
2633 for the three bars of the example above gives:
2634
2635 @lilypond[quote,verbatim,ragged-right,addversion]
2636 global = {
2637   \key d \major
2638   \time 4/4
2639 }
2640 sopranoMusic = \relative {
2641   \clef "treble"
2642   r4 d''2 a4 | d4. d8 a2 | cis4 d cis2 |
2643 }
2644 sopranoWords = \lyricmode {
2645   Wor -- thy is the lamb that was slain
2646 }
2647 altoMusic = \relative {
2648   \clef "treble"
2649   r4 a'2 a4 | fis4. fis8 a2 | g4 fis fis2 |
2650 }
2651 altoWords = \sopranoWords
2652 tenorMusic = \relative {
2653   \clef "G_8"
2654   r4 fis'2 e4 | d4. d8 d2 | e4 a, cis2 |
2655 }
2656 tenorWords = \sopranoWords
2657 bassMusic = \relative {
2658   \clef "bass"
2659   r4 d'2 cis4 | b4. b8 fis2 | e4 d a'2 |
2660 }
2661 bassWords = \sopranoWords
2662 upper = \relative {
2663   \clef "treble"
2664   \global
2665   r4 <a' d fis>2 <a e' a>4
2666   <d fis d'>4. <d fis d'>8 <a d a'>2
2667   <g cis g'>4 <a d fis> <a cis e>2
2668 }
2669 lower = \relative {
2670   \clef "bass"
2671   \global
2672   <d, d'>4 <d d'>2 <cis cis'>4
2673   <b b'>4. <b' b'>8 <fis fis'>2
2674   <e e'>4 <d d'> <a' a'>2
2675 }
2676
2677 \score {
2678   <<  % combine ChoirStaff and PianoStaff in parallel
2679     \new ChoirStaff <<
2680       \new Staff = "sopranos" <<
2681         \set Staff.instrumentName = #"Soprano"
2682         \new Voice = "sopranos" {
2683           \global
2684           \sopranoMusic
2685         }
2686       >>
2687       \new Lyrics \lyricsto "sopranos" {
2688         \sopranoWords
2689       }
2690       \new Staff = "altos" <<
2691         \set Staff.instrumentName = #"Alto"
2692         \new Voice = "altos" {
2693           \global
2694           \altoMusic
2695         }
2696       >>
2697       \new Lyrics \lyricsto "altos" {
2698         \altoWords
2699       }
2700       \new Staff = "tenors" <<
2701         \set Staff.instrumentName = #"Tenor"
2702         \new Voice = "tenors" {
2703           \global
2704           \tenorMusic
2705         }
2706       >>
2707       \new Lyrics \lyricsto "tenors" {
2708         \tenorWords
2709       }
2710       \new Staff = "basses" <<
2711         \set Staff.instrumentName = #"Bass"
2712         \new Voice = "basses" {
2713           \global
2714           \bassMusic
2715         }
2716       >>
2717       \new Lyrics \lyricsto "basses" {
2718         \bassWords
2719       }
2720     >>  % end ChoirStaff
2721
2722     \new PianoStaff <<
2723       \set PianoStaff.instrumentName = #"Piano  "
2724       \new Staff = "upper" \upper
2725       \new Staff = "lower" \lower
2726     >>
2727   >>
2728 }
2729 @end lilypond
2730
2731
2732 @node Kotta létrehozása az alapoktól
2733 @subsection Kotta létrehozása az alapoktól
2734 @translationof Building a score from scratch
2735
2736 @cindex template, writing your own
2737 @cindex example of writing a score
2738 @cindex writing a score, example
2739 @cindex score, example of writing
2740
2741 After gaining some facility with writing LilyPond code, you
2742 may find that it is easier to build a score from scratch
2743 rather than modifying one of the templates.  You can also
2744 develop your own style this way to suit the sort of music you
2745 like.  Let's see how to put together the score for an organ
2746 prelude as an example.
2747
2748 We begin with a header section.  Here go the title, name
2749 of composer, etc, then come any variable definitions, and
2750 finally the score block.  Let's start with these in outline
2751 and fill in the details later.
2752
2753 We'll use the first two bars of Bach's prelude
2754 based on @emph{Jesu, meine Freude} which is written for two
2755 manuals and pedal organ.  You can see these two bars of music
2756 at the bottom of this section.  The top manual part has two voices,
2757 the lower and pedal organ one each.  So we need four
2758 music definitions and one to define the time signature
2759 and key:
2760
2761 @example
2762 \version @w{"@version{}"}
2763 \header @{
2764   title = "Jesu, meine Freude"
2765   composer = "J S Bach"
2766 @}
2767 TimeKey = @{
2768   \time 4/4
2769   \key c \minor
2770 @}
2771 ManualOneVoiceOneMusic = @{ s1 @}
2772 ManualOneVoiceTwoMusic = @{ s1 @}
2773 ManualTwoMusic = @{ s1 @}
2774 PedalOrganMusic = @{ s1 @}
2775
2776 \score @{
2777 @}
2778 @end example
2779
2780 For now we've just used a spacer note, @code{s1},
2781 instead of the real music.  We'll add that later.
2782
2783 Next let's see what should go in the score block.
2784 We simply mirror the staff structure we want.
2785 Organ music is usually written on three staves,
2786 one for each manual and one for the pedals.  The
2787 manual staves should be bracketed together, so we
2788 need to use a PianoStaff for them.  The first
2789 manual part needs two voices and the second manual
2790 part just one.
2791
2792 @example
2793   \new PianoStaff <<
2794     \new Staff = "ManualOne" <<
2795       \new Voice @{
2796         \ManualOneVoiceOneMusic
2797       @}
2798       \new Voice @{
2799         \ManualOneVoiceTwoMusic
2800       @}
2801     >>  % end ManualOne Staff context
2802     \new Staff = "ManualTwo" <<
2803       \new Voice @{
2804         \ManualTwoMusic
2805       @}
2806     >>  % end ManualTwo Staff context
2807   >>  % end PianoStaff context
2808 @end example
2809
2810 Next we need to add a staff for the pedal organ.
2811 This goes underneath the PianoStaff, but it must
2812 be simultaneous with it, so we need angle brackets
2813 around the two.  Missing these out would generate
2814 an error in the log file.  It's a common mistake
2815 which you'll make sooner or later!  Try copying
2816 the final example at the end of this section,
2817 remove these angle brackets, and compile it to
2818 see what errors it generates.
2819
2820 @example
2821 <<  % PianoStaff and Pedal Staff must be simultaneous
2822   \new PianoStaff <<
2823     \new Staff = "ManualOne" <<
2824       \new Voice @{
2825         \ManualOneVoiceOneMusic
2826       @}
2827       \new Voice @{
2828         \ManualOneVoiceTwoMusic
2829       @}
2830     >>  % end ManualOne Staff context
2831     \new Staff = "ManualTwo" <<
2832       \new Voice @{
2833         \ManualTwoMusic
2834       @}
2835     >>  % end ManualTwo Staff context
2836   >>  % end PianoStaff context
2837   \new Staff = "PedalOrgan" <<
2838     \new Voice @{
2839       \PedalOrganMusic
2840     @}
2841   >>
2842 >>
2843 @end example
2844
2845 It is not necessary to use the simultaneous construct
2846 @code{<< .. >>} for the manual two staff and the pedal organ staff,
2847 since they contain only one music expression, but it does no harm,
2848 and always using angle brackets after @code{\new Staff} is a good
2849 habit to cultivate in case there are multiple voices.  The opposite
2850 is true for Voices: these should habitually be followed by braces
2851 @code{@{ .. @}} in case your music is coded in several variables
2852 which need to run consecutively.
2853
2854 Let's add this structure to the score block, and adjust the indenting.
2855 We also add the appropriate clefs, ensure stems, ties and slurs in
2856 each voice on the upper staff point to the right direction with
2857 @code{\voiceOne} and @code{\voiceTwo}, and enter the time signature
2858 and key to each staff using our predefined variable, @code{\TimeKey}.
2859
2860 @example
2861 \score @{
2862   <<  % PianoStaff and Pedal Staff must be simultaneous
2863     \new PianoStaff <<
2864       \new Staff = "ManualOne" <<
2865         \TimeKey  % set time signature and key
2866         \clef "treble"
2867         \new Voice @{
2868           \voiceOne
2869           \ManualOneVoiceOneMusic
2870         @}
2871         \new Voice @{
2872           \voiceTwo
2873           \ManualOneVoiceTwoMusic
2874         @}
2875       >>  % end ManualOne Staff context
2876       \new Staff = "ManualTwo" <<
2877         \TimeKey
2878         \clef "bass"
2879         \new Voice @{
2880           \ManualTwoMusic
2881         @}
2882       >>  % end ManualTwo Staff context
2883     >>  % end PianoStaff context
2884     \new Staff = "PedalOrgan" <<
2885       \TimeKey
2886       \clef "bass"
2887       \new Voice @{
2888         \PedalOrganMusic
2889       @}
2890     >>  % end PedalOrgan Staff
2891   >>
2892 @}  % end Score context
2893 @end example
2894
2895 That completes the structure.  Any three-staff organ music
2896 will have a similar structure, although the number of voices
2897 may vary.  All that remains now
2898 is to add the music, and combine all the parts together.
2899
2900 @lilypond[quote,verbatim,ragged-right,addversion]
2901 \header {
2902   title = "Jesu, meine Freude"
2903   composer = "J S Bach"
2904 }
2905 TimeKey = {
2906   \time 4/4
2907   \key c \minor
2908 }
2909 ManualOneVoiceOneMusic = \relative {
2910   g'4 g f ees
2911   d2 c2
2912 }
2913 ManualOneVoiceTwoMusic = \relative {
2914   ees'16 d ees8~ 16 f ees d c8 d~ d c~
2915   c c4 b8 c8. g16 c b c d
2916 }
2917 ManualTwoMusic = \relative {
2918   c'16 b c8~ 16 b c g a8 g~ 16 g aes ees
2919   f ees f d g aes g f ees d e8~ 8es16 f ees d
2920 }
2921 PedalOrganMusic = \relative {
2922   r8 c16 d ees d ees8~ 16 a, b g c b c8
2923   r16 g ees f g f g8 c,2
2924 }
2925
2926 \score {
2927   <<  % PianoStaff and Pedal Staff must be simultaneous
2928     \new PianoStaff <<
2929       \new Staff = "ManualOne" <<
2930         \TimeKey  % set time signature and key
2931         \clef "treble"
2932         \new Voice {
2933           \voiceOne
2934           \ManualOneVoiceOneMusic
2935         }
2936         \new Voice {
2937           \voiceTwo
2938           \ManualOneVoiceTwoMusic
2939         }
2940       >>  % end ManualOne Staff context
2941       \new Staff = "ManualTwo" <<
2942         \TimeKey
2943         \clef "bass"
2944         \new Voice {
2945           \ManualTwoMusic
2946         }
2947       >>  % end ManualTwo Staff context
2948     >>  % end PianoStaff context
2949     \new Staff = "PedalOrgan" <<
2950       \TimeKey
2951       \clef "bass"
2952       \new Voice {
2953         \PedalOrganMusic
2954       }
2955     >>  % end PedalOrgan Staff context
2956   >>
2957 }  % end Score context
2958 @end lilypond
2959
2960
2961 @node Kevesebb gépelés változókkal és függvényekkel
2962 @subsection Kevesebb gépelés változókkal és függvényekkel
2963 @translationof Saving typing with variables and functions
2964
2965 @cindex variables
2966 @cindex variables
2967
2968 By this point, you've seen this kind of thing:
2969
2970 @lilypond[quote,verbatim,ragged-right]
2971 hornNotes = \relative { c''4 b dis c }
2972 \score {
2973   {
2974     \hornNotes
2975   }
2976 }
2977 @end lilypond
2978
2979 You may even realize that this could be useful in minimalist music:
2980
2981 @lilypond[quote,verbatim,ragged-right]
2982 fragmentA = \relative { a'4 a8. b16 }
2983 fragmentB = \relative { a'8. gis16 ees4 }
2984 violin = \new Staff {
2985   \fragmentA
2986   \fragmentA
2987   \fragmentB
2988   \fragmentA
2989 }
2990 \score {
2991   {
2992     \violin
2993   }
2994 }
2995 @end lilypond
2996
2997 However, you can also use these variables (also known as
2998 macros, or user-defined commands) for tweaks:
2999
3000 @c TODO Avoid padtext - not needed with skylining
3001 @lilypond[quote,verbatim,ragged-right]
3002 dolce = \markup { \italic \bold dolce }
3003 padText = { \once \override TextScript.padding = #5.0 }
3004 fthenp=_\markup { \dynamic f \italic \small { 2nd } \hspace #0.1 \dynamic p }
3005 violin = \relative {
3006   \repeat volta 2 {
3007     c''4._\dolce b8 a8 g a b
3008     \padText
3009     c4.^"hi there!" d8 e' f g d
3010     c,4.\fthenp b8 c4 c-.
3011   }
3012 }
3013 \score {
3014   {
3015     \violin
3016   }
3017 \layout { ragged-right=##t }
3018 }
3019 @end lilypond
3020
3021 These variables are obviously useful for saving
3022 typing.  But they're worth considering even if you
3023 only use them once -- they reduce complexity.  Let's
3024 look at the previous example without any
3025 variables.  It's a lot harder to read, especially
3026 the last line.
3027
3028 @example
3029 violin = \relative @{
3030   \repeat volta 2 @{
3031     c''4._\markup @{ \italic \bold dolce @} b8 a8 g a b
3032     \once \override TextScript.padding = #5.0
3033     c4.^"hi there!" d8 e' f g d
3034     c,4.\markup @{ \dynamic f \italic \small @{ 2nd @}
3035       \hspace #0.1 \dynamic p @}
3036     b8 c4 c-.
3037   @}
3038 @}
3039 @end example
3040
3041 @c TODO Replace the following with a better example  -td
3042 @c Skylining handles this correctly without padText
3043
3044 So far we've seen static substitution -- when LilyPond
3045 sees @code{\padText}, it replaces it with the stuff that
3046 we've defined it to be (ie the stuff to the right of
3047 @code{padtext=}).
3048
3049 LilyPond can handle non-static substitution, too (you
3050 can think of these as functions).
3051
3052 @lilypond[quote,verbatim,ragged-right]
3053 padText =
3054 #(define-music-function (padding) (number?)
3055   #{
3056     \once \override TextScript.padding = #padding
3057   #})
3058
3059 \relative {
3060   c'''4^"piu mosso" b a b
3061   \padText #1.8
3062   c4^"piu mosso" d e f
3063   \padText #2.6
3064   c4^"piu mosso" fis a g
3065 }
3066 @end lilypond
3067
3068 Using variables is also a good way to reduce work if the
3069 LilyPond input syntax changes (see
3070 @rprogram{Updating files with convert-ly}).  If
3071 you have a single definition (such as @code{\dolce}) for all your
3072 input files (see @ref{Style sheets}), then if the syntax changes, you
3073 only need to update your single @code{\dolce} definition,
3074 instead of making changes throughout every @file{.ly} file.
3075
3076
3077 @node Partitúra és szólamkották
3078 @subsection Partitúra és szólamkották
3079 @translationof Scores and parts
3080
3081 In orchestral music, all notes are printed twice.  Once in a part for
3082 the musicians, and once in a full score for the conductor.  Variables can
3083 be used to avoid double work.  The music is entered once, and stored in
3084 a variable.  The contents of that variable is then used to generate
3085 both the part and the full score.
3086
3087 It is convenient to define the notes in a special file.  For example,
3088 suppose that the file @file{horn-music.ly} contains the following part
3089 of a horn/@/bassoon duo
3090
3091 @example
3092 hornNotes = \relative @{
3093   \time 2/4
3094   r4 f8 a cis4 f e d
3095 @}
3096 @end example
3097
3098 @noindent
3099 Then, an individual part is made by putting the following in a file
3100
3101 @example
3102 \include "horn-music.ly"
3103 \header @{
3104   instrument = "Horn in F"
3105 @}
3106
3107 @{
3108  \transpose f c' \hornNotes
3109 @}
3110 @end example
3111
3112 The line
3113
3114 @example
3115 \include "horn-music.ly"
3116 @end example
3117
3118 @noindent
3119 substitutes the contents of @file{horn-music.ly} at this position in
3120 the file, so @code{hornNotes} is defined afterwards.  The command
3121 @code{\transpose f@tie{}c'} indicates that the argument, being
3122 @code{\hornNotes}, should be transposed by a fifth upwards.  Sounding
3123 @code{f} is denoted by notated @code{c'}, which corresponds with the
3124 tuning of a normal French Horn in@tie{}F.  The transposition can be seen
3125 in the following output
3126
3127 @lilypond[quote,ragged-right]
3128 \transpose f c' \relative {
3129   \time 2/4
3130   r4 f8 a cis4 f e d
3131 }
3132 @end lilypond
3133
3134 In ensemble pieces, one of the voices often does not play for many
3135 measures.  This is denoted by a special rest, the multi-measure
3136 rest.  It is entered with a capital @code{R} followed by a duration
3137 (@code{1}@tie{}for a whole note, @code{2}@tie{}for a half note,
3138 etc.).  By multiplying the
3139 duration, longer rests can be constructed.  For example, this rest
3140 takes 3@tie{}measures in 2/4 time
3141
3142 @example
3143 R2*3
3144 @end example
3145
3146 When printing the part, multi-rests
3147 must be condensed.  This is done by setting a run-time variable
3148
3149 @example
3150 \set Score.skipBars = ##t
3151 @end example
3152
3153 @noindent
3154 This command sets the property @code{skipBars} in the
3155 @code{Score} context to true (@code{##t}).  Prepending the rest and
3156 this option to the music above, leads to the following result
3157
3158 @lilypond[quote,ragged-right]
3159 \transpose f c' \relative {
3160   \time 2/4
3161   \set Score.skipBars = ##t
3162   R2*3
3163   r4 f8 a cis4 f e d
3164 }
3165 @end lilypond
3166
3167
3168 The score is made by combining all of the music together.  Assuming
3169 that the other voice is in @code{bassoonNotes} in the file
3170 @file{bassoon-music.ly}, a score is made with
3171
3172 @example
3173 \include "bassoon-music.ly"
3174 \include "horn-music.ly"
3175
3176 <<
3177   \new Staff \hornNotes
3178   \new Staff \bassoonNotes
3179 >>
3180 @end example
3181
3182 @noindent
3183 leading to
3184
3185 @lilypond[quote,ragged-right]
3186 \relative <<
3187   \new Staff {
3188     \time 2/4
3189     R2*3
3190     r4 f8 a cis4 f e d
3191   }
3192   \new Staff {
3193     \clef bass
3194     r4 d,8 f | gis4 c | b bes |
3195     a8 e f4 | g d | gis f |
3196   }
3197 >>
3198 @end lilypond